Jump to content

Recommended Posts

I have a strange issue with couriers' error messages at checkout in PS 1.6.1.14 (Default Theme).

To emulate a minimum amount for purchases needed for a specific group, I've disabled its assigned couriers below a certain purchase amount (let's say 150). The behavior is correct and there's an error showing until the cart reaches 150 euros.

But the error message is printed twice for every assigned courier!
The message comes from order-carrier.tpl, I guess: if I change that line into tpl file, it changes in error box too (and, of course, it is repeated two times for every courier that is active for that group). The url that shows the error is /quick-order

Some years ago someone modified a controller to have this thing of minimum purchase amount working. 
Something like this: https://www.prestashop.com/forums/topic/585753-set-minimum-order-purchase-for-customers-group-prestashop-16/

Any suggestion on on what to do? Where to check?
Is there a way to force a single error message to be printed?

PS: of course the message "The product selection cannot be delivered by the available carrier(s). Please amend your cart." has been translated to fit the need of warining about minum purchase amount.

Thanks for your time

 

Edited by beepow (see edit history)
Link to comment
Share on other sites

  • beepow changed the title to PS 1.6: Error printed twice (for every courier)

Maybe it could be that  foreach statement finds two times the same value for $error into $errors array...
I've seen that in Trasations settings (in back office), The same string appears three times: one in ORDER-CARRIER-ADVANCED, one in ORDER-CARRIER-OPC-ADVANCED and one in ORDER-CARRIER... The quick checkout is active, if it may help. But the string that is printed on screen two times is the one ORDER-CARRIER

(sorry for my english)

 

Link to comment
Share on other sites

I've added a {break] inside foreach cycle in order-carrier.tpl and it's working...

But I can't say if other issues could occurr...

 

{foreach $errors as $error}
	{if $error == Carrier::SHIPPING_WEIGHT_EXCEPTION}
		{$flag_error_message = true}
		{l s='The product selection cannot be delivered by the available carrier(s): it is too heavy. Please amend your cart to lower its weight.'}
		{break}
	{elseif $error == Carrier::SHIPPING_PRICE_EXCEPTION}
		{$flag_error_message = true}
		{l s='The product selection cannot be delivered by the available carrier(s). Please amend your cart.'}
		{break}
	{elseif $error == Carrier::SHIPPING_SIZE_EXCEPTION}
		{$flag_error_message = true}
		{l s='The product selection cannot be delivered by the available carrier(s): its size does not fit. Please amend your cart to reduce its size.'}
		{break}
	{/if}
{/foreach}

 

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...