Forums / All Other Contributions/Addons / Discount Code - Invalid Code Message Not Appearing - FEC

Discount Code - Invalid Code Message Not Appearing - FEC

Locked

Started by pennylane on 11 Jan 2010, 5:08 PM · Views: 1,878

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
11 Jan 2010, 5:08 PM
#1
pennylane avatar

pennylane

New Zenner

Join Date:
Aug 2009
Posts:
31
Plugin Contributions:
0

Discount Code - Invalid Code Message Not Appearing - FEC

I have Zen Cart 1.3.8a installed and recently installed Fast and Easy Checkout (FEC) 1.6.2. I am testing the Discount Coupon function. When a correct discount code is entered, the discount is applied. I noticed, however, that when an incorrect coupon code is entered, no error message is returned. How can I add a message - something along the lines of "You have entered an invalid code, please try again."?

my site is https://www.pennylanepapersgiftbags.com

Appreciate the help!

11 Jan 2010, 10:21 PM
#2
pennylane avatar

pennylane

New Zenner

Join Date:
Aug 2009
Posts:
31
Plugin Contributions:
0

Re: Discount Code - Invalid Code Message Not Appearing - FEC

Got this question answered on the Numinix site:

This will be included in the next release:

Open includes/classes/observers/class.fec.php and replace the entire update() function with:

function update(&$class, $eventID, $paramsArray) {
global $messageStack;
if (FEC_STATUS == 'true') {
$error = false;
if ($_GET['main_page'] == FILENAME_CHECKOUT_PAYMENT and sizeof($messageStack->messages) > 0) {
$error = true;
for ($i=0, $n=sizeof($messageStack->messages); $i<$n; $i++) {
if ($messageStack->messages[$i]['class'] == 'checkout_payment') {
$checkout_payment_output[] = $messageStack->messages[$i];
}
if ($messageStack->messages[$i]['class'] == 'redemptions') {
$redemptions_output[] = $messageStack->messages[$i];
}
}
$messageStack->reset();
if (sizeof($checkout_payment_output) > 0) {
for ($i=0, $n=sizeof($checkout_payment_output); $i<$n; $i++) {
$messageStack->add_session('checkout_payment', strip_tags($checkout_payment_output[$i]['text']), 'error');
}
}
if (sizeof($redemptions_output) > 0) {
for ($i=0, $n=sizeof($redemptions_output); $i<$n; $i++) {
$messageStack->add_session('redemptions', strip_tags($redemptions_output[$i]['text']), 'caution');
}
}
}
if ($_GET['credit_class_error']) {
$error = true;
$messageStack->add_session('checkout_payment', htmlspecialchars(urldecode($_GET['credit_class_error'])), 'error');
}
if ($error) {
zen_redirect(zen_href_link(FILENAME_CHECKOUT, "&action=null", 'SSL'));
} else {
zen_redirect(zen_href_link(FILENAME_CHECKOUT, '', 'SSL'));
}
}
}