Zen Cart Logo
Forums / All Other Contributions/Addons / Sale Ending/Special Ending Support thread

Sale Ending/Special Ending Support thread

Views: 10,019

Results 21 to 27 of 27
3 Jan 2015, 5:14 PM
#21
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,715
Plugin Contributions:
56

Sale Ending/Special Ending Support thread

While doing my analysis for 1.5.4, I noticed this mod had a template file which changed in 1.5.3 which I missed, so I updated it. The update is now available on the downloads site.

19 Jul 2016, 8:17 PM
#22
dennisns7d avatar

dennisns7d

New Zenner

Join Date:
Jan 2010
Posts:
55
Plugin Contributions:
0

Re: Sale Ending/Special Ending Support thread

I recently encountered the problem describe in post #17: I set the expiration date to 8/01/2016 only to have the date displayed as 7/30/2016 instead of the expected 7/31/2016. I've tracked the source of the problem to be that MySQL and PHP are operating in different timezones. In my case MySQL is operating in the Mountain Time Zone and PHP is operating in the Pacific Time Zone. The timestamp returned for 2016-08-01 00:00:00 by MySQL is interpreted as 2016-07-31 23:00:00 by PHP.

Studying the documentation for PHP's strtotime() function led me to the following solution. The only changes are in includes/functions/extra_functions/sale_special_ending.php.

Change lines 16-18 from

            $enddate = $specials->fields['unix_expires_date']; 
            $enddate_ts = strtotime("-1 day", $enddate);
            $enddate = date("Y-m-d H:i:s", $enddate_ts); 

to

            $enddate = $specials->fields['expires_date']; 
            $enddate_ts = strtotime("-1 day ".$enddate);
            $enddate = date("Y-m-d H:i:s", $enddate_ts); 

Change lines 38-40 from

         $enddate = $sales->fields['unix_sale_date_end']; 
         $enddate_ts = strtotime("-1 day", $enddate);
         $enddate = date("Y-m-d H:i:s", $enddate_ts); 

to

         $enddate = $sales->fields['sale_date_end']; 
         $enddate_ts = strtotime("-1 day ".$enddate);
         $enddate = date("Y-m-d H:i:s", $enddate_ts); 

I also removed the ', UNIX_TIMESTAMP(...) as ...' from the SQL in lines 11 and 32.

3 Dec 2021, 4:07 PM
#23
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,715
Plugin Contributions:
56

Re: Sale Ending/Special Ending Support thread

The countdown timer feature has been added to sale ending/special ending in the latest version.

3 Dec 2021, 4:13 PM
#24
caroleas avatar

caroleas

Totally Zenned

Join Date:
Feb 2009
Posts:
896
Plugin Contributions:
0

Re: Sale Ending/Special Ending Support thread

Does that have a DATE countdown only or also an HOUR countdown?

3 Dec 2021, 4:21 PM
#25
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,715
Plugin Contributions:
56

Re: Sale Ending/Special Ending Support thread

It prints out non-zero values for Months, Days, Hours, Minutes, Seconds.
If you go to the extended help on my website you can see a screenshot. The link is in the README file.

3 Oct 2025, 10:33 PM
#26
heavensportal avatar

heavensportal

New Zenner

Join Date:
Jun 2021
Posts:
95
Plugin Contributions:
0

Re: Sale Ending/Special Ending Support thread

does this still work in v2.1.0.? I am using 2.10 with Ceon Uri Mapping (SEO), Edit Orders, Image Handler and Blank Sideboxes

4 Oct 2025, 9:59 AM
#27
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,715
Plugin Contributions:
56

Re: Sale Ending/Special Ending Support thread

It should. Report any issues here.