Jump to content

Discount Vouchers (Cart Rules) not showing in MultiStore Mode?


Recommended Posts

Hi

 

We have created discount cart rules in Prestashoip 1.5.4 but the Voucher box does not appear in the checkout process?

 

Anyone having the same issue?

 

hello

 

make sure that in ps_configuration tabe, entry: PS_CART_RULE_FEATURE_ACTIVE has got value: 1

Link to comment
Share on other sites

well, it's hard to say, i think about two possibilities:

- theme that you use hasn't got voucher fields in shopping-cart.tpl

- cache problems, have you tried to recompile theme? clear shop cache? maybe some kind of caching system on your host?

Link to comment
Share on other sites

Hi

 

I have cleared and recompiled, this is the piece of code in question: 

 

(found in shopping-cart.tpl - line 177)

 
{if $voucherAllowed}
{if isset($errors_discount) && $errors_discount}
<ul class="error">
{foreach $errors_discount as $k=>$error}
<li>{$error|escape:'htmlall':'UTF-8'}</li>
{/foreach}
</ul>
{/if}
<form action="{if $opc}{$link->getPageLink('order-opc', true)}{else}{$link->getPageLink('order', true)}{/if}" method="post" id="voucher">
<fieldset>
<p class="title_block"><label for="discount_name">{l s='Vouchers'}</label></p>
<p>
<input type="text" class="discount_name" id="discount_name" name="discount_name" value="{if isset($discount_name) && $discount_name}{$discount_name}{/if}" />
</p>
<p class="submit"><input type="hidden" name="submitDiscount" /><input type="submit" name="submitAddDiscount" value="{l s='OK'}" class="button" /></p>
</fieldset>
</form>
{if $displayVouchers}
<p id="title" class="title_offers">{l s='Take advantage of our offers:'}</p>
<div id="display_cart_vouchers">
{foreach $displayVouchers as $voucher}
{if $voucher.code != ''}<span onclick="$('#discount_name').val('{$voucher.code}');return false;" class="voucher_name">{$voucher.code}</span> - {/if}{$voucher.name}<br />
{/foreach}
</div>
{/if}
{/if}
</td>
 
If I remove the surrounding "{if $voucherAllowed}" statement the voucher appears? so it seems that the system is not picking up the "Allowed" settings for each store, as this Cart Rule is set just for this store and not for the other 2... I have even added a store id to the PS_CART_RULE_FEATURE_ACTIVE  table, but no luck. Really really strange.. I do not have this issue with any of my single stores, just this multi store. To note... I also have tested with a clean Default template on the test store (as store number 4 on this site).. and still the same issue, so to eliminate any custom template issues. Running out of ideas :(
 
Nick
Link to comment
Share on other sites

i have no idea what's goin on there :(

 

 

let's analyse it ;)

 

$voucherAllowed variable is a result of this function: CartRule::isFeatureActive(),

 

this funciton looks like:

	public static function isFeatureActive()
	{
		static $is_feature_active = null;
		if ($is_feature_active === null)
			$is_feature_active = (bool)Configuration::get('PS_CART_RULE_FEATURE_ACTIVE');
		return $is_feature_active;
	}

maybe try to change it to just simple:

 

public static function isFeatureActive()
{
return true;
}
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...