News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

[fixed]Cart can't handle quantity changes when using quantity discounts.

Started by KaiKaiKai, December 28, 2012, 04:09:36 AM

Previous topic - Next topic

KaiKaiKai

Hi,

My problem is, that the cart does not calculate the quantity discounts correctly when the customer chances the quantity after putting the product in the cart. For example:

Product A costs 100€ when the customer orders 1-4 of it. He gets a 8% discount when the customer orders 5 or more (92€). The product page displays that correctly, also when I add the product to the cart, it shows the original price, tax, and discount like it should be. The problem occurs when I/the customer now changes the quantity of product A.

The customer put 2 items of Product A in the cart => the cart shows 200€ => correct. Now the customer decides to add 3 more items to get the discount. (For example changing the quantity directly in the cart or adding 3 more via the product page). In this case no discount will be given by the cart.

This also works the other way round when the customer first put 5 items in the cart (discount is calculated and shown) and then changes the quantity in the cart to 1 he still gets 8% discount on this product.

I'm using this versions:
Virtuemart 2.0.16
Joomla 2.5.8
PHP 5.2.17

Does anybody have a solution / hint how I can solve this problem?

Thank you so much. Kai

bytelord

Hello,

Is only the "cosmetic" thing or when you checkout the discount is not calculated as it should be?

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

KaiKaiKai

Hey,

thanks for your reply. I just tested what you wrote on a test-Website and the shop also checks out with the wrong discount like it is in the cart. So this definitely is a bug.

I fixed it by first delating the product from the cart and adding it new when the customer wants to update the quantity. Than the cart calculates the new prices with new discount values. I don't know whether this is a good way but it works so far.

regards

Neurotransmitter

Hi!

Yes, it seems to be bug in vm 2.0.16. I put a product with chosen quantity 4 (pricechart: 1 for 10,- and >3 for = 9,- each) in the cart and the cart shows 4x9,-. Then i reduce the quantity to 1 in the cart/checkout. The cart still uses the price per piece 9,-.

@kai³: Could you please post your workaround with some code-snippets? Thanx!

Greetings,
Thomas


Neurotransmitter

Hallo Kai,

danke für die weiterführende Infos. Mein Shop meldet gerade: Update auf 2.0.18a verfügbar. Ich prüfe gleich nach dem Update wieder unser Szenario durch und werde mich ans debuggen machen, denn mein Projekt soll demnächst online gehen...mit funktionierenden quantity discounts.

Grüße,
Thomas

Neurotransmitter

Update 2.0.16 -> 2.0.18a lief perfekt, nun rechnet mein Warenkorb korrekt!

@admin: Problem solved!

Ein Bitte: Wäre super, wenn Du dies bei Gelegenheit verifizieren könntest.

Viele Grüße,
Thomas

Milbo

Ist richtig, ich habe das gefixed in version 2.0.16c glaub.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

KaiKaiKai

Super Sache! Ich hätte nicht gedacht, dass dazu so schnell ein Update kommt. Stehe aber auch unter Zeitdruck und war gezwungen zu basteln ;-) Meinen vorherigen Post hab ich mal wieder rausgeschmissen, damit keiner auf dumme Gedanken kommt.

Grüße und viel Erfolg bei deinem Shop

Kai

Problem solved. Thanks to the VirtueMart-Team!

Kamen Rider

Sorry to dig up this old thread. But I am having the same problem using VM 2.0.16 and the product price does not update inside checkout page (but it works in product details page). Is there any files that is required to edit to fix this problem? I tried updating and it crush my VM, I had reverted it back already.

Kamen Rider

I have solve the issue. For those who are having this problem and are not updating their Virtuemart version you can download the latest version for 2.0.16 and then replace the file components/com_virtuemart/views/cart/view.html.php and administrator/components/com_virtuemart/models/product.php with the new file. That would fix it.