The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Product Discounts not re-calculating if products removed from cart (store v2.0)

Hi there,

I have a question on Product Discounts as described in the 2.0 documentation:

I'm generating the discount form code fine and the bulk discounts are applying properly, however, in a situation such as:

1) I have a bulk percentage discount on all units that applies a 10% discount on 5 or more products.
2) The user adds a quantity of 4 items to their cart.
3) The user then adds a quantity of 1 (of the same product) to their cart. This essentially gets them to the 10% discount.
4) The user then removes the cart item with the quantity of 4.

Should the cart then re-check the bulk discount and remove the 10% discount on the single product left in the cart? If I proceed to checkout it also keeps the 10% discount on the single product. Am I missing a step or not configuring something properly or could this be a bug?

Screenshots:

2)
image

3)
image

4)
image

Checkout)
image
Comments
  • fc_adamfc_adam FoxyCart Team
    @muskie9,

    The discount should definitely be recalculated with any cart change - whether adding a product, changing quantities or removing a product. I tried to replicate this on my test store but was unable to. Could you link us to your add to cart page so we can do some testing ourselves? Feel free to whisper if you'd prefer to keep it private by selecting the whisper checkbox and entering my forum username.
  • My scenarios were on a local vagrant box so I'm not sure if that would make a difference. I'll try again on a remote server and update this thread with the results.

    Thanks!
  • @fc_admin,

    I've tested remotely and it seems to be doing the same thing. I have a bulk discount on this product in our demo store.

    The discount is 5 gets 10% off, so to recreate the issue:

    Add 4 of that product to the cart, continue shopping.
    Add 1 of that product (this now applies the discount).
    Remove the set of 4 from the cart.
    Checkout.

    I also tried continuing shopping after removing the set of 4 then going back into the cart but it seems to still have bulk discount of 10% applied.

    Thanks!
  • fc_adamfc_adam FoxyCart Team
    @muskie9,

    So this issue seems to stem from the fact that this product is being added to the cart as a separate product - when in fact it's the exact same product and should just be increasing it's quantity.

    The reason that is happening is there is a slight error with your product option modifiers on the color select. For example, you have this:
    <option value="White{p0.00|w0|c+-0}">White</option>
    Which instead should look like this:
    <option value="White{p+0.00|w+0|c+-0}">White</option>
    Note the+ between the price and weight option modifiers. Alternatively, you could also set those to not be included if they're not making any changes, so it would just be:
    <option value="White{c+-0}">White</option>
    Correcting that gets the product adding to itself rather than adding a new product each time, and also ensures the discount works correctly.
  • That makes sense. I'll update our code to implement the fix. Thanks for the help!
Sign In or Register to comment.