Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,20 @@ public function validateCode(Varien_Event_Observer $observer)
return;
}

$quote = $observer->getQuote();
$quote = $observer->getQuote();
$couponCode = $quote->getCouponCode();

if (!$couponCode || $couponCode == '') {
// parent validation has failed
$couponCode = (string)Mage::app()->getRequest()->getParam('coupon_code');
Mage::getModel('hackathon_promocodemessages/validator')->validate($couponCode, $quote);
try {
Mage::getModel('hackathon_promocodemessages/validator')->validate($couponCode, $quote);
} catch (Mage_Core_Exception $e) {
$msg = Mage::helper('hackathon_promocodemessages')->__('Your coupon could not be redeemed.');
$msg = "<p class=\"promo_error_intro\">$msg</p>";
$msg .= $e->getMessage();
throw new Mage_Core_Exception($msg, 0, $e);
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/app/locale/de_DE/Hackathon_PromoCodeMessages.csv
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
"Your coupon is not valid for your Customer Group.","Der Gutschein ist für Ihre Kundengruppe nicht freigeschaltet."
"Your coupon is not valid yet. It will be active on %s.","Der Gutschein ist noch nicht aktiv. Er wird am %s freigeschaltet."
"Your coupon was already used.","Ihr Gutschein wurde bereits benutzt."
"Your coupon could not be redeemed.","Ihr Gutschein konnte nicht eingelöst werden."
5 changes: 3 additions & 2 deletions src/app/locale/en_US/Hackathon_PromoCodeMessages.csv
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
"This will give customers further information on what exactly has failed with their coupon code.","This will give customers further information on what exactly has failed with their coupon code."
"Validate cart rule conditions","Validate cart rule conditions"
"Validate cart rule actions","Validate cart rule actions"
"Provides error messaging for conditions under \"Conditions\" tab","Provides error messaging for conditions under \"Conditions\" tab"
"Provides error messaging for actions under \"Actions\" tab","Provides error messaging for actions under \"Actions\" tab"
"Provides error messaging for conditions under ""Conditions"" tab","Provides error messaging for conditions under ""Conditions"" tab"
"Provides error messaging for actions under ""Actions"" tab","Provides error messaging for actions under ""Actions"" tab"
"Your coupon could not be redeemed.","Your coupon could not be redeemed."