// Small fixes for cart rules

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12756 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-01-27 14:38:04 +00:00
parent d1882d8e77
commit 113d3a5174
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -92,13 +92,13 @@ class ParentOrderControllerCore extends FrontController
{
if (Tools::isSubmit('submitAddDiscount'))
{
if (!($code = Tools::getValue('discount_name')))
if (!($code = trim(Tools::getValue('discount_name'))))
$this->errors[] = Tools::displayError('You must enter a voucher code');
elseif (!Validate::isDiscountName($code))
$this->errors[] = Tools::displayError('Voucher code invalid');
else
{
if ($cartRule = new CartRule(CartRule::getIdByCode($code)) && Validate::isLoadedObject($cartRule))
if (($cartRule = new CartRule(CartRule::getIdByCode($code))) && Validate::isLoadedObject($cartRule))
{
if ($error = $cartRule->checkValidity($this->context))
$this->errors[] = $error;