PrestaShop / PrestaShop

PrestaShop is the universal open-source software platform to build your e-commerce solution.
https://www.prestashop-project.org/
Other
8.14k stars 4.8k forks source link

Disabled or expired voucher is not removed from the cart #36982

Open Codencode opened 3 weeks ago

Codencode commented 3 weeks ago

Prerequisites

Describe the bug and add attachments

If a discount is added to the cart and later deactivated or its expiration date is changed, making it expire, the discount remains in the cart.

Warning! There must be at least 2 discounts created, because if there is only one discount and it is disabled, it works correctly due to the system performing this check: CartRule::isFeatureActive().

Case with disabled voucher Disabled_voucher.webm

Case with expired_voucher Expired_voucher.webm

Expected behavior

No response

Steps to reproduce

  1. Create 2 valid discounts.
  2. Add one of the 2 discounts to the cart.
  3. Disable the discount in the admin panel or change the date to make it expire.
  4. View the cart in the front office.
  5. The discount still appears in the cart.

PrestaShop version(s) where the bug happened

8.x, 9.x

PHP version(s) where the bug happened

No response

If your bug is related to a module, specify its name and its version

No response

Your company or customer's name goes here (if applicable).

@codencode

florine2623 commented 2 weeks ago

Hello @Codencode 👋

Is your issue the same as https://github.com/PrestaShop/PrestaShop/issues/26235 ?

Codencode commented 2 weeks ago

Hello @Codencode 👋

Is your issue the same as #26235 ?

Hi @florine2623, It seems very similar to me, so I think so even if it's related to PS 1.7

florine2623 commented 2 weeks ago

Ok, when your PR is ready for QA, the standard case with your issue should be tested, as well as the case presented in the issue https://github.com/PrestaShop/PrestaShop/issues/26235.

Once the PR is OK, both issues should be closed with label Fixed.

https://github.com/user-attachments/assets/91b2bd90-c61a-4f88-9225-2c558ff6530c

Thanks @Codencode :)

Codencode commented 2 weeks ago

Yes of course. We are thinking carefully about how to modify the PR that I created because it does not take into account (for the moment) some things.

Thanks to you @florine2623