X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Order today and Receive By Calculator? (https://forum.x-cart.com/showthread.php?t=51196)

tqualizerman 12-08-2009 07:56 AM

Order today and Receive By Calculator?
 
Has anyone been able to find a javascript which could take the current date, add two days (shipping time) and output the result as "Orders placed today will arrive by X, X, 2009"

The script would also have to compensate for not being able to ship Saturday/Sunday, so when the date = Thursday it will know Monday is the earliest time to deliver. For Friday delivery would be Tuesday, etc.

if anyone has a handle on something like this and can share that would be very helpful!

cflsystems 12-08-2009 08:55 AM

Re: Order today and Receive By Calculator?
 
I did a similar mod not long ago. PM me if interested for details

ubergeek 02-02-2010 08:39 AM

Re: Order today and Receive By Calculator?
 
Totally off topic, but I bought one of the Tqualizer shirts for my son here in Minnesota. He wore it to school and the teachers and other kids loved it! Really fun product!

ARW VISIONS 02-02-2010 09:55 AM

Re: Order today and Receive By Calculator?
 
Pleas make a backup of all files you are changing.



I added this


$config['date'] = '%D';
$smarty->assign('config', $config);
$smarty->assign('holDate', strtotime('+2day'));
$smarty->assign('holDateSat', strtotime('+3day'));
$smarty->assign('holDateFri', strtotime('+4 day'));

to home.php at the end right before
func_display("customer/home.tpl",$smarty);
?>




then added this to head.tpl
<b>{$lng.lbl_holiday_bar} {if $smarty.now|date_format:"%A" eq "Friday"}{$holDateFri|date_format:$config.date } {elseif $smarty.now|date_format:"%A" eq "Thursday"}{$holDateFri|date_format:$config.da te} {elseif $smarty.now|date_format:"%A" eq "Saturday"} {$holDateSat|date_format:$config.date}{else}{$holD ate|date_format:$config.date}{/if}</b>

PLEASE NOTE:there is a space in the line above that should no be there $holD ate|date_format - ^^^^^I tried to fix it but it won't go away!!!


The holiday_bar language variable is something like this.

If you purchase today, then receive by -
the rest displays the date.

You may have to play with the php to suit your date needs.

It does take into account the weekend for non business days.

If you want this to show up on static pages, cart page... etc you will need to add the php to those pages also.

I think you could add it to auth.php to get it site wide. Not sure if it's a good idea to add stuff to auth.php tho, need one of the php gurus to answer that.

Ash


All times are GMT -8. The time now is 05:18 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.