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

Bug with coupon code and cart update

Started by visitmontaione, September 02, 2023, 10:31:14 AM

Previous topic - Next topic

visitmontaione

Joomla version 4.3.4
VirtueMart 4.0.12 10777

I have created a coupon with these conditions:
- 10% discount
. Minimum order € 200

You can reproduce the bug in the cart as follow;

https://www.visitmontaione.com/joomla4/it/shop coupon = VMONT23

1- place in the cart goods for more than € 200 to activate the coupon. For example € 300
2- enter the coupon and save, you will see the discount is calculated € 300 + 10% = € 270
3- now, decrease the order less than € 200, let's say at € 140
4- Update the cart
5- you can see now that the coupon is still active and calculated € 140 - 10% = € 126

I have to say that if you proceed the purchase, at the last step the discount is removed.
However, when you update the cart for an amount lower than the minimum for the coupon and the discount is still there, a customer can believe that the discount is still valid.

Do you think it is possible to cancel the coupon on cart update if the amount is less than the minimum for the coupon?

Thanks and kind regards

hazael

#1
Similarly, you can see a product with a 30% discount on a page that is cached on the server.
The customer may also happily think that he has a discount, but if he adds this product to the basket, there will only be big sadness   :'(

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

visitmontaione

Quote from: jenkinhill on September 02, 2023, 13:07:31 PM
Have you checked this with VM4.2 ?

Not jet, I will set a staging site and test it. Than I will post the results here.

visitmontaione

Tried with VirtueMart 4.2.0 10905 but nothing change.

If I decrease the quantity of products to make the order lower than € 200,00 (the limit for activate the coupon) the discount is still calculated.

See screenshot.

hazael

I don't see a problem there. This is easily solved with simple JavaScript.
Make a javascript function to detect the unique CSS class or ID where the discount appears. With this function, activate a script that will reload the page each time you press the button to remove the product from the cart.
The page after refreshing in the browser will display the actual prices in the cart.

Milbo

Hazael, the cart is doing that already. The problem is that there is no check if the coupon is already set.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/