Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    Sep 2008
    Posts
    781
    Plugin Contributions
    3

    red flag 15% Sale for all orders over £50 on specified category

    I have Quantity Discounts installed on a website.

    It is used to offer 10% Discount over the whole site for orders over £150.

    However I need to set up a special offer which offers 15% discount for all orders over £50 from 'category X'.

    If ordering under £50 from category X then 10% should be applied as normal if the cart adds up to £150 when in a combination with other products.

    If ordering over £50 from category X then 15% should be applied to the products from category X.

    Really what I need to do is disable quantity discounts on category X and make the offer of 15% off for all orders over £50...or find some other method.

    How would I do this?


    I've thought about duplicating the quantity discounts module, which I think would achieve the above but I am not sure what the process would be in order to duplicate the module.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,835
    Plugin Contributions
    9

    Default Re: 15% Sale for all orders over £50 on specified category

    There is a way to do this within the current code....

    I am hoping that Ajeh will happen along to assist....
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Sep 2008
    Posts
    781
    Plugin Contributions
    3

    Default Re: 15% Sale for all orders over £50 on specified category

    Thanks for replying Kobra, I'm hoping Ajeh can assist.

  4. #4
    Join Date
    Sep 2008
    Posts
    781
    Plugin Contributions
    3

    Default Re: 15% Sale for all orders over £50 on specified category

    Just an update:

    'If ordering over £50 from category X then 15% should be applied to the products from category X.'

    So just to make it clear, the normal '10% off £150' would be disabled if someone order over £50 from category X - so they only get 15% off and not 25% off.

  5. #5
    Join Date
    Jul 2012
    Posts
    11,628
    Plugin Contributions
    13

    Default Re: 15% Sale for all orders over £50 on specified category

    What about if someone orders 200 with 100 of that being in category X? Do they get the 10% off of the other 100 or only the 15% off of the first? Ie. Can multiple discounts be applied at all?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  6. #6
    Join Date
    Jul 2012
    Posts
    11,628
    Plugin Contributions
    13

    Default Re: 15% Sale for all orders over £50 on specified category

    Or if a purchase of 300 is made, with 100 from category X (savings of 15 available) and the remaining 200 at 10% (savings of 20) would this be allowed, is the customer to be offered a direct choice, or through proper fine print advised to make two separate purchases (possibly incurring increased shipping prices)?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  7. #7
    Join Date
    Sep 2008
    Posts
    781
    Plugin Contributions
    3

    Default Re: 15% Sale for all orders over £50 on specified category

    They get 10% off the 100 say from categories 'A, B, and C' and 15% off 100 from category X

    So the calculation would be 15% Discount for all products in category X - it would not carry over the 15% to other products

    All other categories would apply 10% off for all orders over £150 as normal

    It would then add together the products in the cart like this:

    Category X products: 15% off

    All other category products that add up to £150: 10% off

    Does that make sense?

  8. #8
    Join Date
    Jul 2012
    Posts
    11,628
    Plugin Contributions
    13

    Default Re: 15% Sale for all orders over £50 on specified category

    Yup, wasn't as clear before, but is now! :)

    That should definitely help in identifying a solution.

    Not so sure that there is a built in method of applying the discount in that situation, because it does get a little more "complicated" in that scenario of applying multiple discounts to a single cart.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  9. #9
    Join Date
    Sep 2008
    Posts
    781
    Plugin Contributions
    3

    Default Re: 15% Sale for all orders over £50 on specified category

    Yes I realise it gets 'a little' more complicated :-) hence why I am asking for help!

    This is nothing to do with this post but if you can't help with this one, would you mind taking a look at my post here regarding stripping html tags.

    https://www.zen-cart.com/showthread....04#post1308604

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,403
    Plugin Contributions
    6

    Default Re: 15% Sale for all orders over £50 on specified category

    If I understand what you are trying to do, then you appear to want to add another 5% to Category X products if over 50.00 ...

    Eidt the file:
    /includes/classes/shopping_cart.php

    and add the code in RED to the bottom of the file:
    Code:
      function in_cart_product_total_price_category($category_id) {
        $products = $this->get_products();
    //echo '<pre>'; echo print_r($products); echo '</pre>';
        for ($i=0, $n=sizeof($products); $i<$n; $i++) {
          $productsName = $products[$i]['name'];
          $ppe = $products[$i]['final_price'];
          $ppt = $ppe * $products[$i]['quantity'];
          $productsPriceEach = $ppe + $products[$i]['onetime_charges'];
          $productsPriceTotal = $ppt + $products[$i]['onetime_charges'];
          if ($products[$i]['category'] == $category_id) {
            $in_cart_product_price += $productsPriceTotal;
          }
        } // end FOR loop
        return $in_cart_product_price;
      }
    
    }
    NOTE: that is added just before the existing closing bracket ...

    Then, add the code in RED to the file:
    /includes/modules/order_total/ot_coupon.php

    Code:
        $od_amount = array('tax'=>0, 'total'=>0);
    
    global $discount_coupon;
    $dc_check = $discount_coupon->fields['coupon_code'];
    // bof: coupon add 5% to 1 category if over 50.00
    if ($dc_check == '10OFFALL') {
      $cat_id = 10;
      $chk_disc = 0.00;
      $chk_amount = $_SESSION['cart']->in_cart_product_total_price_category($cat_id);
      if ($chk_amount >= 50.00) {
        $chk_disc = $chk_amount * .05;
      }
    }
    // bof: coupon add 5% to 1 category if over 50.00
    
        if ($_SESSION['cc_id'])
    and a little further down:
    Code:
                case 'P': // percentage
                  $od_amount['total'] = zen_round($orderTotalDetails['orderTotal']*($coupon->fields['coupon_amount']/100) + $chk_disc, $currencyDecimalPlaces);
                  $od_amount['type'] = $coupon->fields['coupon_type'];
                  $ratio = $od_amount['total']/$orderTotalDetails['orderTotal'];
                  break;
                case 'E': // percentage & Free Shipping
                  $od_amount['total'] = zen_round($orderTotalDetails['orderTotal']*($coupon->fields['coupon_amount']/100) + $chk_disc, $currencyDecimalPlaces);
                  $od_amount['type'] = $coupon->fields['coupon_type'];
                  $ratio = $od_amount['total']/$orderTotalDetails['orderTotal'];
                  // add in Free Shipping
                  $od_amount['total'] = $od_amount['total'] + $orderTotalDetails['shipping'];
                  $od_amount['tax'] = ($this->calculate_tax == 'Standard') ? $orderTotalDetails['shippingTax'] : 0;
                  if (isset($_SESSION['shipping_tax_description']) && $_SESSION['shipping_tax_description'] != '') {
                    $od_amount['tax_groups'][$_SESSION['shipping_tax_description']] = $od_amount['tax'];
                  }
                  break;
    See if that does what you are trying to do ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v151 View sales over a specified period
    By nigelt74 in forum General Questions
    Replies: 2
    Last Post: 6 Apr 2013, 01:00 AM
  2. v139h Creating a new category for all "Sale items"
    By swamyg1 in forum Setting Up Specials and SaleMaker
    Replies: 3
    Last Post: 25 Sep 2012, 09:36 PM
  3. Specified shipping for Specified products?
    By joshuaove in forum Built-in Shipping and Payment Modules
    Replies: 24
    Last Post: 17 Mar 2011, 12:38 AM
  4. SALE for all downloadable products on a certain category
    By shmints in forum Setting Up Specials and SaleMaker
    Replies: 4
    Last Post: 1 Mar 2007, 04:02 PM
  5. Configure Free Shipping For orders in Category over $50
    By nwagoner in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 4 Dec 2006, 06:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR