Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Coupon Expiration From Date of Issuance

Coupon Expiration From Date of Issuance

Locked

Started by smykey on 30 Mar 2009, 7:11 AM · Views: 3,436

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
30 Mar 2009, 7:11 AM
#1
smykey avatar

smykey

New Zenner

Join Date:
Jul 2008
Posts:
15
Plugin Contributions:
0

Coupon Expiration From Date of Issuance

Is there a way I could limit the coupon to be used within two weeks from the time it was issued to the customer?

I am currently issuing coupons for first time customer registration automatically and it seems the expiration date is tagged with when you (the admin) created the coupon not when it was created.

30 Mar 2009, 6:42 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Coupon Expiration From Date of Issuance

As you pointed out, the Discount Coupons are based on the dates set when the Discount Coupon is created in the Admin ...

To change this, you would need to customize the code to actually create a new Discount Coupon for each day so that it will have the full 2 weeks ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

31 Mar 2009, 12:43 AM
#3
smykey avatar

smykey

New Zenner

Join Date:
Jul 2008
Posts:
15
Plugin Contributions:
0

Re: Coupon Expiration From Date of Issuance

Ajeh:

As you pointed out, the Discount Coupons are based on the dates set when the Discount Coupon is created in the Admin ...

To change this, you would need to customize the code to actually create a new Discount Coupon for each day so that it will have the full 2 weeks ...

Thank you for your assistance. Would you be able to point me out to which file you believe I can achieve this through re-coding?

31 Mar 2009, 3:06 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Coupon Expiration From Date of Issuance

You would need to customize how the Create Account module works for this section:

    if (NEW_SIGNUP_DISCOUNT_COUPON != '' and NEW_SIGNUP_DISCOUNT_COUPON != '0') {
      $coupon_id = NEW_SIGNUP_DISCOUNT_COUPON;
      $coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_id = '" . $coupon_id . "'");
      $coupon_desc = $db->Execute("select coupon_description from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . $_SESSION['languages_id'] . "'");
      $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $email_address . "', now() )");

      $text_coupon_help = sprintf(TEXT_COUPON_HELP_DATE, zen_date_short($coupon->fields['coupon_start_date']),zen_date_short($coupon->fields['coupon_expire_date']));

      // if on, add in Discount Coupon explanation
      //        $email_text .= EMAIL_COUPON_INCENTIVE_HEADER .
      $email_text .= "\n" . EMAIL_COUPON_INCENTIVE_HEADER .
      (!empty($coupon_desc->fields['coupon_description']) ? $coupon_desc->fields['coupon_description'] . "\n\n" : '') . $text_coupon_help  . "\n\n" .
      strip_tags(sprintf(EMAIL_COUPON_REDEEM, ' ' . $coupon->fields['coupon_code'])) . EMAIL_SEPARATOR;

      $html_msg['COUPON_TEXT_VOUCHER_IS'] = EMAIL_COUPON_INCENTIVE_HEADER ;
      $html_msg['COUPON_DESCRIPTION']     = (!empty($coupon_desc->fields['coupon_description']) ? '<strong>' . $coupon_desc->fields['coupon_description'] . '</strong>' : '');
      $html_msg['COUPON_TEXT_TO_REDEEM']  = str_replace("\n", '', sprintf(EMAIL_COUPON_REDEEM, ''));
      $html_msg['COUPON_CODE']  = $coupon->fields['coupon_code'] . $text_coupon_help;
    } //endif coupon

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

31 Mar 2009, 5:39 AM
#5
smykey avatar

smykey

New Zenner

Join Date:
Jul 2008
Posts:
15
Plugin Contributions:
0

Re: Coupon Expiration From Date of Issuance

Thank you so much, we will try to figure this one out.

31 Mar 2009, 1:22 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Coupon Expiration From Date of Issuance

You might look at how the Copy Discount Coupon feature works in the Admin and see if you can't adapt that ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

7 Sep 2009, 4:01 PM
#7
kannasai avatar

kannasai

New Zenner

Join Date:
Sep 2008
Posts:
7
Plugin Contributions:
0

Re: Coupon Expiration From Date of Issuance

I did sent out the discount coupon to my customer through Admin panel. At the bottom of the mail suppose to have coupon expire date but it show "TEXT_COUPON_HELP_DATE".

Please help!! Which part i should update to solve out the problem.

Thank you

8 Sep 2009, 3:43 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Coupon Expiration From Date of Issuance

Check your language file:

/admin/includes/languages/english/coupon_admin.php

Line #50 : define('TEXT_COUPON_HELP_DATE', '<p><p>The coupon is valid between %s and %s</p></p>');

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Jan 2010, 12:43 PM
#9
netgirlz avatar

netgirlz

New Zenner

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

Re: Coupon Expiration From Date of Issuance

did anyone get this working ??

it would be a much appreciated share..