Jump to content

Problem with displaying voucher in cart


Dan.Jan

Recommended Posts

Hi,

I have generated a voucher for a specific group of customers. To display it to them when they log into their account, I selected the "Highlight" option for the voucher (I don't know what exactly this is called - that's why I'm attaching a picture). 

The voucher is displayed both in the account and in the cart when you make an order. That's OK.

If the voucher is redeemed, it is no longer available in the account, but still displays in the cart? 
Can you help me what to do? 
Prestashop 8.1.1 

Thanks.

 

voucher.jpg

cart.jpg

Edited by Dan.Jan (see edit history)
Link to comment
Share on other sites

Hello,

thank you for reaching out to us.

You need to set the condition for the discount to be used only one time on the backoffice. 

image.thumb.png.04d7e9950ab2bc1a36aab459010fb5c5.png

If the problem persists, you must therefore create a ticket on Github from this link:- https://github.com/PrestaShop/PrestaShop/issues

It will be necessary to detail the problem using useful information :
- Prestashop version,
- PHP version
- Screenshots

I wish you a good day
- Steps to reproduce the problem

Link to comment
Share on other sites

The problem is that the voucher list for the cart contains also vouchers that have already been used by the user, they have quantity_for_user = 0.

So there is probably a bug in some controller that fills this list for the cart???

Link to comment
Share on other sites

On 2/14/2024 at 7:54 PM, SeifF said:

Hello,

thank you for reaching out to us.

You need to set the condition for the discount to be used only one time on the backoffice. 

image.thumb.png.04d7e9950ab2bc1a36aab459010fb5c5.png

If the problem persists, you must therefore create a ticket on Github from this link:- https://github.com/PrestaShop/PrestaShop/issues

It will be necessary to detail the problem using useful information :
- Prestashop version,
- PHP version
- Screenshots

I wish you a good day
- Steps to reproduce the problem

The solution, that works for me is to add the following code to:

\src\Adapter\Presenter\Cart\CartPresenter.php

cart_voucher1.thumb.jpg.265f615c8c9835b1c075f928c1588117.jpg

 

Can someone from the Prestashop Developer team have a look at this and tell me if this is the right solution?

Is it possible to override this file?

Thank you.

 

 

 

Edited by Dan.Jan (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...