russnyc_2 Posted December 28, 2017 Share Posted December 28, 2017 Hi, Does anyone know how to extend the End Date listed when creating coupon codes. Right now I'm only able to go out until 12/31/2018 when creating new discount coupon codes. I'm using 2.2-MS2 Thanks Link to comment Share on other sites More sharing options...
radhavallabh Posted December 29, 2017 Share Posted December 29, 2017 Hi, How about using the below addon it helps you select the desired end date with year as well- https://apps.oscommerce.com/k6tJy Hope it helps! Regds./ radhavallabh Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 29, 2017 Share Posted December 29, 2017 You don't say what addon you are using but I'm guessing it is Gift Vouchers. The following will change the date though your code may vary a little since there are many versions of that addon. In admin/coupon_admin.php, find $coupon_startdate = split("[-]", date('Y-m-d')); And change it to $coupon_startdate = explode("-", date('Y-m-d', strtotime('+5 years'))); You'll need to do the same for the $coupon_finishdate line. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
henryxli Posted June 18, 2018 Share Posted June 18, 2018 I tried Jack's code but got some errors, hope someone could help solve this. Link to comment Share on other sites More sharing options...
henryxli Posted June 18, 2018 Share Posted June 18, 2018 Here are the codes involved with the date of Gift Vouchers: <tr> <?php // molafish: fixed reset to default of dates when editing an existing coupon or showing an error message if ($HTTP_GET_VARS['action'] == 'new' && !$HTTP_POST_VARS['coupon_startdate'] && !$HTTP_GET_VARS['oldaction'] == 'new') { $coupon_startdate = preg_split("/[-]/", date('Y-m-d')); } elseif (tep_not_null($HTTP_POST_VARS['coupon_startdate'])) { $coupon_startdate = preg_split("/[-]/", $HTTP_POST_VARS['coupon_startdate']); } elseif (!$HTTP_GET_VARS['oldaction'] == 'new') { // for action=voucheredit $coupon_startdate = preg_split("/[-]/", date('Y-m-d', strtotime($coupon['coupon_start_date']))); } else { // error is being displayed $coupon_startdate = preg_split("/[-]/", date('Y-m-d', mktime(0, 0, 0, $HTTP_POST_VARS['coupon_startdate_month'],$HTTP_POST_VARS['coupon_startdate_day'] ,$HTTP_POST_VARS['coupon_startdate_year'] ))); } if ($HTTP_GET_VARS['action'] == 'new' && !$HTTP_POST_VARS['coupon_finishdate'] && !$HTTP_GET_VARS['oldaction'] == 'new') { $coupon_finishdate = preg_split("/[-]/", date('Y-m-d')); $coupon_finishdate[0] = $coupon_finishdate[0] + 1; } elseif (tep_not_null($HTTP_POST_VARS['coupon_finishdate'])) { $coupon_finishdate = preg_split("/[-]/", $HTTP_POST_VARS['coupon_finishdate']); } elseif (!$HTTP_GET_VARS['oldaction'] == 'new') { // for action=voucheredit $coupon_finishdate = preg_split("/[-]/", date('Y-m-d', strtotime($coupon['coupon_expire_date']))); } else { // error is being displayed $coupon_finishdate = preg_split("/[-]/", date('Y-m-d', mktime(0, 0, 0, $HTTP_POST_VARS['coupon_finishdate_month'],$HTTP_POST_VARS['coupon_finishdate_day'] ,$HTTP_POST_VARS['coupon_finishdate_year'] ))); } ?> <td align="left" class="main"><?php echo COUPON_STARTDATE; ?></td> <td align="left"><?php echo tep_draw_date_selector('coupon_startdate', mktime(0,0,0, $coupon_startdate[1], $coupon_startdate[2], $coupon_startdate[0])); ?></td> <td align="left" class="main"><?php echo COUPON_STARTDATE_HELP; ?></td> </tr> <tr> <td align="left" class="main"><?php echo COUPON_FINISHDATE; ?></td> <td align="left"><?php echo tep_draw_date_selector('coupon_finishdate', mktime(0,0,0, $coupon_finishdate[1], $coupon_finishdate[2], $coupon_finishdate[0])); ?></td> <td align="left" class="main"><?php echo COUPON_FINISHDATE_HELP; ?></td> I's really appreciate id someone can help me extend the date. Link to comment Share on other sites More sharing options...
sucoboy Posted December 12, 2018 Share Posted December 12, 2018 Hello, I have exactly same problem, anyone can help? Thanks. Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 12, 2018 Share Posted December 12, 2018 I will try to get my edited version uploaded before the end of the year. I'll post here when I do. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 31, 2018 Share Posted December 31, 2018 @henryxli@sucoboyI started to change the date code has mentioned but found so many problems with the code that I decided to write a new version. It requires more to switch to it but the result will be worth it since the new version has many, many security fixes as well as new options. If you, anyone, has questions about the new version, please post those in its support thread. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.