Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Coupon End Expiration Date beyond 2018?

Coupon End Expiration Date beyond 2018?

Views: 27,994

Results 1 to 17 of 17
31 Oct 2014, 4:08 PM
#1
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Coupon End Expiration Date beyond 2018?

When I enter a coupon, the maximum expiration date is December 31, 2018. Is it possible to add more years into that drop-down menu so I can make coupons that have a longer expiration date? Or is it possible to have coupons without expiration dates at all?

31 Oct 2014, 4:49 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Coupon End Expiration Date beyond 2018?

If you need a ridiculously forever date on the Discount Coupon so things like:
The coupon is valid between 07/19/2014 and 07/19/2025

rather than a shorter time period to encourage people to buy today rather than in 2022 ... you could edit the date in phpMyAdmin in the table:
coupons

and change the date in the field:
coupon_expire_date

I tend to opt for the shorter date range to encourage coupon usage rather than a longer date range just to save an edit every year ... :lookaroun

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 Oct 2014, 5:10 PM
#3
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Coupon End Expiration Date beyond 2018?

laurelsstitchery:

When I enter a coupon, the maximum expiration date is December 31, 2018. Is it possible to add more years into that drop-down menu so I can make coupons that have a longer expiration date? Or is it possible to have coupons without expiration dates at all?

Load the file /youradmin/includes/functions/general.php into a text editor

On line#1976 you should see code that reads like

for ($i=2001:$i<2019;$i++) {

Change these years to suit your needs.

Save the file.

Note: This date selector is used in several parts of ZenCart. This change will affect them all.

Cheers
RodG

PS. I've just taken another look and it seems that it is only the coupon editor that uses this bit of code. Everything else appears to use SpiffyCal instead.

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

4 Nov 2014, 5:15 PM
#4
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Re: Coupon End Expiration Date beyond 2018?

Thanks for the info! For whatever reason I never think of updating the database directly. :)

14 Mar 2018, 4:19 PM
#5
dml73 avatar

dml73

Zen Follower

Join Date:
Oct 2007
Posts:
416
Plugin Contributions:
0

Re: Coupon End Expiration Date beyond 2018?

In Admin->Discount Coupons/Gift Certificates->Coupon Admin when creating a new coupon the latest selectable "End Date" from the drop-down list is 31 December 2018. How can I add more years to the drop-down list?

14 Mar 2018, 4:31 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Coupon End Expiration Date beyond 2018?

Issue is corrected in ZC 1.5.5; however, if you search admin/includes/functions/general.php for 2019 should find a line that looks like:

 for ($i=2001;$i<2019;$i++){

And replace with the below:

   for ($i = date('Y') - 5, $j = date('Y') + 11; $i < $j; $i++) {

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

15 Mar 2018, 8:34 AM
#7
dml73 avatar

dml73

Zen Follower

Join Date:
Oct 2007
Posts:
416
Plugin Contributions:
0

Re: Coupon End Expiration Date beyond 2018?

Thanks a lot!

17 Nov 2018, 8:30 AM
#8
k_mcintyre avatar

k_mcintyre

New Zenner

Join Date:
Oct 2013
Location:
Indiana, United States
Posts:
5
Plugin Contributions:
0

Re: Coupon End Expiration Date beyond 2018?

I am going to assume that this information is now erratically different than what is posted in this thread... I have searched my file directory extensively for the "($i=2001:$i<2019;$i++) { " string, yes while using the Developers tool kit, and my search result returns ZERO results... even when search several different variations of the suggested code.

I came to this thread because I too am having the same problem with my Zen Cart (yes I am using the latest version), but when I attempt to create a coupon code that I want to be valid past December 31st 2018, I simply can not do such because the date "2019" does not exist in the drop-down menu for "Expiration Dates" for the Coupon Generator. I additionally searched the /mydomain/admin panel/includes/English/coupon_admin, and the code to alter the dates does not exist there either....

Just trying to figure out why this is still a problem even in 2017.... I mean, I get it why it may have been a problem in 2014, but you would think that by 2017 someone would have updated the "updates" of newer versions to have made accommodations for this by now. I'm not the only person having this issue, am I ?

How do I add additional years to my coupon section? (and is there any other parts of my Zencart that will stop displaying the correct date come Jan 1st, 2019? )

Thank you in advance

~ Kevin

17 Nov 2018, 9:36 AM
#9
k_mcintyre avatar

k_mcintyre

New Zenner

Join Date:
Oct 2013
Location:
Indiana, United States
Posts:
5
Plugin Contributions:
0

Re: Coupon End Expiration Date beyond 2018?

Forget the previous question.... I found the location in my version of Zencart.

It is located inside of my domain / admin panel / includes / functions / general.php

I had to find it manually, for some reason or another the Tool Kit simply would not return any results for that line of text. Strange, but not the first time I have had that problem with the developers tool kit though.

Thank you for the pointers, your comment is the ONLY reason I was able to fix the problem.

17 Nov 2018, 11:40 AM
#10
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Coupon End Expiration Date beyond 2018?

K.McIntyre, I don't know what version of Zen Cart you're using, but the zen_draw_date_selector function was updated for this issue in Zen Cart 1.5.5, released in March of 2016.

26 Nov 2018, 4:31 PM
#11
safeldy avatar

safeldy

New Zenner

Join Date:
Dec 2017
Location:
CA
Posts:
5
Plugin Contributions:
0

Re: Coupon End Expiration Date beyond 2018?

In attempting to set up a coupon code for 2019 and beyond, the drop down menu only currently goes to 2018. How can I get the expiration date to appear further than 2018?

(You are presently using: v1.3.9h)

[Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

26 Nov 2018, 6:51 PM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Coupon End Expiration Date beyond 2018?

safeldy:

In attempting to set up a coupon code for 2019 and beyond, the drop down menu only currently goes to 2018. How can I get the expiration date to appear further than 2018?

(You are presently using: v1.3.9h)

[Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

The preferred/suggested correction for this would be to upgrade to a current version of Zen Cart and for more reasons than just to get the date selector to recognize more than the next month or so of date options. The problem though is possibly in the zen_draw_date_selector function possibly found in admin/includes/functions/general.php and how it used to target a specific end date rather than so many years out from today.

The recommended reading to support the upgrade by rebuild is: https://www.zen-cart.com/entry.php?3-How-do-I-rebuild-my-site-on-the-new-version-instead-of-upgrading

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

26 Nov 2018, 8:05 PM
#13
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Coupon End Expiration Date beyond 2018?

While you're planning your Zen Cart upgrade:smile:, you can refer to this (https://www.zen-cart.com/showthread.php?215092-Coupon-Expiration-Date) posting that describes how to update the PHP file that is currently limiting those dates.

13 Jan 2019, 8:00 PM
#14
mariscrap avatar

mariscrap

New Zenner

Join Date:
Jun 2012
Posts:
31
Plugin Contributions:
0

Re: Coupon End Expiration Date beyond 2018?

lat9:

K.McIntyre, I don't know what version of Zen Cart you're using, but the zen_draw_date_selector function was updated for this issue in Zen Cart 1.5.5, released in March of 2016.

I used the version : v1.5.1
as this was my husband who took care of my Zencart and I'm now divorced, i don't want to update the version because he told me that it's hard to do it by someone as me (who doesn't no a lot of things about Zencart and codes)

so if there a way to find the line to change 2018 by 2019 in the version v1.5.1? BEcause like K.McIntyre, i didn't find the code at line 1976.
Thank ou so much in advancec for any help :-)

14 Jan 2019, 12:51 AM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Coupon End Expiration Date beyond 2018?

Mariscrap:

I used the version : v1.5.1

so if there a way to find the line to change 2018 by 2019 in the version v1.5.1? BEcause like K.McIntyre, i didn't find the code at line 1976.
In v1.5.1 it's line 1911

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Jan 2022, 4:15 AM
#16
johnniejetski2 avatar

johnniejetski2

New Zenner

Join Date:
Dec 2017
Location:
FLAH-DUH
Posts:
45
Plugin Contributions:
0

Re: Coupon End Expiration Date beyond 2018?

same thing here

19 Jan 2022, 9:45 AM
#17
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Coupon End Expiration Date beyond 2018?

johnniejetski2:

same thing here

If truly seeking assistance and not just wanting to sort up this thread by a post, or would be more helpful to you if more information were provided. Same thing here is very nondescript. One answer is to do the same thing suggested, but that would be said without offering an opportunity to explain a problem or issue.

The more that is described perhaps the easier or more direct the solution.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...