Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Order today and Receive By Calculator?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-08-2009, 07:56 AM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default 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!
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #2  
Old 12-08-2009, 08:55 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Order today and Receive By Calculator?

I did a similar mod not long ago. PM me if interested for details
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 02-02-2010, 08:39 AM
 
ubergeek ubergeek is offline
 

Member
  
Join Date: Apr 2006
Posts: 22
 

Default 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!
__________________
Evolve Systems
Xcart: (50+ installs, ranging from 4.0.9 to 4.5.x)
php: 5.2.13 (Mostly)
MySQL: 5.0.95 (Mostly)
Reply With Quote
  #4  
Old 02-02-2010, 09:55 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default 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
__________________
xcart 5.1.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:53 PM.

   

 
X-Cart forums © 2001-2020