Welcome, Guest. Please login or register.
Login with username, password and session length


VirtueMart 1.1.8 - [SECURITY RELEASE] is available! Read more....

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
Pages: [1]   Go Down
Print
Author Topic: Availability:::: "Should Arrive By Date"  (Read 389 times)
BanquetTables.pro
Global Moderator
Hero Member
*
Posts: 4741



« on: June 06, 2011, 10:24:19 AM »

This code DOES NOT
  • Take Location into account
  • Take shipping location into account

This code takes "Availability" which is an exact number of weekdays AND "average" shipping time together, and adds it to TODAY.

I ship only in the USA, so I add the maximum amount of days transit time can take to the amount of days it takes to ship out. (5)
So if a product takes 3 business days to ship out. I make availability "8". Then the result on the products page is 8 business days from today.


avalability.tpl

<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); ?>

<?php
$DeliveryDate = date('mdY', strtotime("+$product_availability Weekdays"));
$EDD= $DeliveryDate;


$mo = substr($EDD, 0, 2);
$da = substr($EDD, 2, 2);
$yr = substr($EDD, 4, 4);
 
$DDD = $mo . "/" . $da . "/" . $yr;
?>
         <strong>Should Arrive</strong>
<?php
echo $DDD;
?>


* Untitled.png (3.43 KB, 315x104 - viewed 49 times.)
Logged

"Banquet Tables Pro"
Pages: [1]   Go Up
Print
Jump to: