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)
-   -   Time based shipping message (https://forum.x-cart.com/showthread.php?t=37904)

Tony Pearce 02-27-2008 09:41 AM

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

Yurij 02-28-2008 08:07 AM

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


Tony Pearce 02-29-2008 01:24 AM

Re: Time based shipping message
 
Works great, thanks so much.

Really great instructions!!

Tony

Yurij 02-29-2008 03:20 AM

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


Tony Pearce 02-29-2008 04:48 AM

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

Yurij 02-29-2008 07:08 AM

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.

Tony Pearce 02-29-2008 08:46 AM

Re: Time based shipping message
 
Great, finished code works a charm.

Much thanks

Tony


All times are GMT -8. The time now is 09:45 AM.

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