Jump to content

[SOLVED] Can't enter my voucher code!


Recommended Posts

Hello everyone.

 

I have upgraded a shop from 1.3.1.1 to 1.5.4.1, and everything sort of went fine. Though I have a few things not working.

 

x1g5qq.jpg

As you can see on the picture (picture of shopping cart) there is not line to enter the voucher code. I have 2 voucher codes activated in my backoffice, so that shouldn't be a problem.

 

Here is the code from my shopping-cart.tpl from the theme:

 

<div class="col-2 span4">

<div class="discount">
	<h2>{l s='Discount Codes'}</h2>
	<div class="discount-form">
		<label for="coupon_code">{l s='Enter your coupon code if you have one.'}</label>
						 {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 class="discount_name_block">
	<input type="text" class="discount_name" id="discount_name" name="discount_name" value="{if isset($discount_name) && $discount_name}{$discount_name}{/if}" />
   </p>
	   <div class="buttons-set"><input type="hidden" name="submitDiscount" />

														<button type="submit" name="submitAddDiscount" title="Apply Coupon" class="button"  value="Apply Coupon"><span><span>{l s='Apply Coupon'}</span></span></button>

													  </div>
  </fieldset>
 </form>
 {if $displayVouchers}
  <p id="title" class="title_offers">{l s='Take advantage of our exclusive 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}
	 </div>
</div>
	</div>

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

Hi,

 

I've similar problem. PS 1.4.6

 

when I've inserted the voucher code in the cart (voucher name random create by prestashop with the 10% on total amount, with correct data, all clients and etc.. ) and I clicked add, it shows "voucher code don't applicable" and didn't calculate nothing. in the cart i've added 3 items. The theme is the prestashop default.

 

How I can solve this problem?How I can modify my file .php?

 

This my DiscountController.php in the path public_html/controllers/DiscountController.php

 

class DiscountControllerCore extends FrontController

{

public $auth = true;

public $php_self = 'discount.php';

public $authRedirection = 'discount.php';

public $ssl = true;

 

public function process()

{

parent::process();

 

$discounts = Discount::getCustomerDiscounts((int)(self::$cookie->id_lang), (int)(self::$cookie->id_customer), true, false);

$nbDiscounts = 0;

foreach ($discounts AS $discount)

if ($discount['quantity_for_user'])

$nbDiscounts++;

 

self::$smarty->assign(array('nbDiscounts' => (int)($nbDiscounts), 'discount' => $discounts));

}

 

public function displayContent()

{

parent::displayContent();

self::$smarty->display(_PS_THEME_DIR_.'discount.tpl');

}

}

 

 

Thanks

Link to comment
Share on other sites

  • 1 month later...

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