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

Time based shipping message

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-27-2008, 09:41 AM
 
Tony Pearce Tony Pearce is offline
 

eXpert
  
Join Date: Apr 2004
Location: Totnes, Devon, UK
Posts: 217
 

Default Time based shipping message

Hi All,

I'm trying to get a small message to open on the cart based on the time, basically to warn customers that they are too late for courier deliveries that day, below is the code (very rough and needs loads of work, anyone??)

<?php
if ( strftime("%H") < 14 ) {
echo "Courier orders are still being accepted (hurry for delivery tomorrow";
}
elseif ( strftime("%H") < 15 ) {
echo "We are sorry but Courier orders cannot be placed today for delivery tommorow";
}
else {
echo "Couriers orders will not be dispatched until tomorrow ";
}
?>

I have tried an include and having the above code as a tpl file, straight on the page, but no luck, first time I've tried anything like this so be kind...

Tony
__________________
X Cart version 4.1.9, 4.1.10, 4.1.11, 4.1.12
(Looking after 15 stores)
Just started 4.4.1 for client....
One Page Checkout, On-Sale, Dynamic Images ++++ Loads of others.
+ 2 Multi Domain stores on 4.1.9
Reply With Quote
  #2  
Old 02-28-2008, 08:07 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Time based shipping message

Insert in the end file "auth.php":

PHP Code:
$a "";
if ( 
strftime("%H") < 14 ) {
$a "Courier orders are still being accepted (hurry for delivery tomorrow";
}
elseif ( 
strftime("%H") < 15 ) {
$a "We are sorry but Courier orders cannot be placed today for delivery tommorow";
}
else {
$a "Couriers orders will not be dispatched until tomorrow ";
}

$smarty->assign("cart_mess"$a); 

Open file "skin1/modules/Fast_Lane_Checkout/home.tpl", find lines:
PHP Code:
<td align="left">
<!-- 
central space --> 

insert after:
PHP Code:
<h2>{$cart_mess}</h2
Reply With Quote
  #3  
Old 02-29-2008, 01:24 AM
 
Tony Pearce Tony Pearce is offline
 

eXpert
  
Join Date: Apr 2004
Location: Totnes, Devon, UK
Posts: 217
 

Default Re: Time based shipping message

Works great, thanks so much.

Really great instructions!!

Tony
__________________
X Cart version 4.1.9, 4.1.10, 4.1.11, 4.1.12
(Looking after 15 stores)
Just started 4.4.1 for client....
One Page Checkout, On-Sale, Dynamic Images ++++ Loads of others.
+ 2 Multi Domain stores on 4.1.9
Reply With Quote
  #4  
Old 02-29-2008, 03:20 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Time based shipping message

Quote:
Originally Posted by Tony Pearce
Works great, thanks so much.

Really great instructions!!

Tony

You can display this message on any page,
just add this code in the "tpl" - file:


PHP Code:
{$cart_mess
Reply With Quote
  #5  
Old 02-29-2008, 04:48 AM
 
Tony Pearce Tony Pearce is offline
 

eXpert
  
Join Date: Apr 2004
Location: Totnes, Devon, UK
Posts: 217
 

Default Re: Time based shipping message

Hi,

If I wanted to mix 2 variables, for example:

if (strftime("%A") =="Friday") AND ( strftime("%H") < 14 ) {
echo "Courier orders placed today will not be dispatched until Monday for delivery on Tuesday";
}

Any idea how would I do that?

Thanks for all your help so far.

Tony
__________________
X Cart version 4.1.9, 4.1.10, 4.1.11, 4.1.12
(Looking after 15 stores)
Just started 4.4.1 for client....
One Page Checkout, On-Sale, Dynamic Images ++++ Loads of others.
+ 2 Multi Domain stores on 4.1.9
Reply With Quote
  #6  
Old 02-29-2008, 07:08 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Time based shipping message

Quote:
Originally Posted by Tony Pearce
Hi,

If I wanted to mix 2 variables, for example:

if (strftime("%A") =="Friday") AND ( strftime("%H") < 14 ) {
echo "Courier orders placed today will not be dispatched until Monday for delivery on Tuesday";
}

Any idea how would I do that?

Thanks for all your help so far.

Tony

Insert in the end file "auth.php":

PHP Code:
$a "";
if ( 
strftime("%H") < 14 ) {
$a "Courier orders are still being accepted (hurry for delivery tomorrow";
}
elseif ( 
strftime("%H") < 15 ) {
$a "We are sorry but Courier orders cannot be placed today for delivery tommorow";
}
else {
$a "Couriers orders will not be dispatched until tomorrow ";
}

if (
strftime("%A") =="Friday") AND ( strftime("%H") < 14 ) {
  
$a"Courier orders placed today will not be dispatched until Monday for delivery on Tuesday";
}



$smarty->assign("cart_mess"$a); 

The rest is done in the past as an example.
Reply With Quote
  #7  
Old 02-29-2008, 08:46 AM
 
Tony Pearce Tony Pearce is offline
 

eXpert
  
Join Date: Apr 2004
Location: Totnes, Devon, UK
Posts: 217
 

Default Re: Time based shipping message

Great, finished code works a charm.

Much thanks

Tony
__________________
X Cart version 4.1.9, 4.1.10, 4.1.11, 4.1.12
(Looking after 15 stores)
Just started 4.4.1 for client....
One Page Checkout, On-Sale, Dynamic Images ++++ Loads of others.
+ 2 Multi Domain stores on 4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 09:59 AM.

   

 
X-Cart forums © 2001-2020