Author Topic: Add delivery date & time at checkout process  (Read 124556 times)

zdjl505

  • Beginner
  • *
  • Posts: 18
    • roncekembang
Add delivery date & time at checkout process
« on: March 13, 2009, 10:48:13 am »
This modification adds a field that allow shopper to select a delivery date & time from a popup calendar. The delivery date & time selection is added in ‘shipping method’ step (checkuot 2nd step).  The selected date & time will be shown at order information, order information print & order confirmation email, also can be edited in order admin page. There is an error checking for empty delivery date & time. Delivery date time format follows the format that defined in store info.

Utilize JHTMLBehaviours class to show popup calendar that installed together with joomla. The calendar translation is included in joomla language translation file (languange\en-GB\en-GB.ini). The popup calendar includes script that blocks date before today. You can adjust the appearance of the calendar at media\system\css\calendar-jos.css.

This modification based on VM1.1.3 Joomla 1.5.9 and Ja-Larix template. Modified files from a fresh installation of VM1.1.3 and Joomla 1.5.9 are attached. To see sample of implementation visit:www.roncekembang.com.

The modified files are:
administrator\components\com_virtuemart\languages\common\english.php
components\com_virtuemart\themes\ja_larix\templates\checkout\get_shipping_method.tpl.php
administrator\components\com_virtuemart\html\checkout.index.php
administrator\components\com_virtuemart\classes\ps_checkout.php
components\com_virtuemart\themes\ja_larix\templates\checkout\get_final_confirmation.tpl.php
components\com_virtuemart\themes\ja_larix\templates\checkout\checkout_bar.tpl.php
components\com_virtuemart\themes\ja_larix\templates\pages\account.order_details.tpl.php
administrator\components\com_virtuemart\html\order.order_print.php
administrator\components\com_virtuemart\html\order.order_printdetails.php
components\com_virtuemart\themes\ja_larix\templates\order_emails\confirmation_email.tpl.php
administrator\components\com_virtuemart\classes\ps_order_change.php
administrator\components\com_virtuemart\classes\ps_order_change_html.php
administrator\components\com_virtuemart\sql\sql.virtuemart.php
administrator\components\com_virtuemart\classes\export\ps_olsi.php

The 1st step add new field delivery_date_time in jos_vm_orders table, field type varchar(40). OK let go detail into each file.

File administrator\components\com_virtuemart\languages\common\english.php:
Add 3 following declarations. Add your own translation in language other than English.
After:
Code: [Select]
'PHPSHOP_CHECKOUT_CUSTOMER_NOTE' => 'Please leave a note to us with your order if you want to',Add:
Code: [Select]
'PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME' => 'Please select expected delivery date & time',After:
Code: [Select]
'PHPSHOP_INFO_MSG_SHIPPING_PRICE' => 'Price',Add:
Code: [Select]
'PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME' => 'To be delivered at',After:
Code: [Select]
'PHPSHOP_CHECKOUT_ERR_NO_SHIPTO' => 'Please select a Ship To address.',Add:
Code: [Select]
'PHPSHOP_CHECKOUT_ERR_NO_DELIVERY_DATE' => 'Please select delivery date & time.',
File components\com_virtuemart\themes\ja_larix\templates\checkout\get_shipping_method.tpl.php:
After (line 21):
Code: [Select]
echo $basket_html;Add:
Code: [Select]
$delivery_date_time = vmGet( $_REQUEST, 'delivery_date_time');
JHTML::_('behavior.calendar');
echo '<br />';
echo '<strong>' . strtoupper($VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME')) . ':&nbsp;&nbsp;</strong>';
?>

<input type="text" class="inputbox" size="40" name="delivery_date_time" id="delivery_date_time_input" value="<?php echo $delivery_date_time?>"/>
<script type="text/javascript">
    Calendar.setup({
        inputField : "delivery_date_time_input",
        ifFormat : "<?php echo $vendor_date_format?>",
        showsTime : true,
timeFormat : "12",
singleClick : false,
dateStatusFunc  :   function (date) {
                              var myDate = new Date();
  if (date.getTime() < myDate.setDate(myDate.getDate() - 1)) return true;
  }
});
</script>
<?php
// Delivery date time end

File administrator\components\com_virtuemart\html\checkout.index.php:
After (line 25):
Code: [Select]
$Itemid = $sess->getShopItemid();Add:
Code: [Select]
$delivery_date_time = vmGet( $_REQUEST, 'delivery_date_time'); //delivery date timeReplace (line 109):
Code: [Select]
<input type="hidden" name="checkout_last_step" value="'. $current_stage .'" />';With:
Code: [Select]
<input type="hidden" name="checkout_last_step" value="'. $current_stage .'" />
<input type="hidden" name="delivery_date_time" value="'. $delivery_date_time .'" />'; //delivery date time

File administrator\components\com_virtuemart\classes\ps_checkout.php:
Replace (line 230):
Code: [Select]
global $sess, $ship_to_info_id, $shipping_rate_id, $VM_LANG;with:
Code: [Select]
global $sess, $ship_to_info_id, $shipping_rate_id, $VM_LANG, $delivery_date_time;Replace (line 273):
Code: [Select]
'shipping_rate_id' => vmGet( $_REQUEST, 'shipping_rate_id')with:
Code: [Select]
'shipping_rate_id' => vmGet( $_REQUEST, 'shipping_rate_id'),
'delivery_date_time' => vmGet( $_REQUEST, 'delivery_date_time')
After (line 402-405):
Code: [Select]
if( empty($d['shipping_rate_id']) ) {
$vmLogger->err( $VM_LANG->_('PHPSHOP_CHECKOUT_ERR_NO_SHIP',false) );
return false;
}
Add:
Code: [Select]
//start check is delivery date time empty
if (empty($d["delivery_date_time"])) {
$vmLogger->err( $VM_LANG->_('PHPSHOP_CHECKOUT_ERR_NO_DELIVERY_DATE',false) );
return False;
}
//end check
Replace (line 853-856):
Code: [Select]
if( $VM_CHECKOUT_MODULES['CHECK_OUT_GET_PAYMENT_METHOD']['order'] != $VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'] ) {
if ($count <= 1 && $cc_payments==false) {
vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&payment_method_id=$first_payment_method_id&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], false, false ),"");
}
with:
Code: [Select]
$delivery_date_time = vmGet($_REQUEST,'delivery_date_time');
if( $VM_CHECKOUT_MODULES['CHECK_OUT_GET_PAYMENT_METHOD']['order'] != $VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'] ) {
if ($count <= 1 && $cc_payments==false) {
vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&payment_method_id=$first_payment_method_id&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&delivery_date_time=$delivery_date_time&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], false, false ),"");
}
After (line 994):
Code: [Select]
'customer_note' => htmlspecialchars(strip_tags($d['customer_note']), ENT_QUOTES ),Add:
Code: [Select]
'delivery_date_time' => $d['delivery_date_time'], //delivery date time
File components\com_virtuemart\themes\ja_larix\templates\checkout\get_final_confirmation.tpl.php:
After (line 75):
Code: [Select]
echo "</td></tr>";Add:
Code: [Select]
//show delivery date time
echo '<tr><td valign="top"><strong>'.$VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME') . ":</strong></td>";
echo '<td>';
$delivery_date_time = vmGet($_REQUEST,'delivery_date_time');
echo $delivery_date_time;
echo "</td></tr>";

File components\com_virtuemart\themes\ja_larix\templates\checkout\checkout_bar.tpl.php:
Replace (line 38):
Code: [Select]
echo '<a href="'. $sess->url(SECUREURL."index.php?page=checkout.index&amp;option=com_virtuemart&amp;ship_to_info_id=$ship_to_info_id&amp;shipping_rate_id=".@$shipping_rate_id."&amp;checkout_stage=".$step[0]['step_order'] ).'">';with:
Code: [Select]
echo '<a href="'. $sess->url(SECUREURL."index.php?page=checkout.index&amp;option=com_virtuemart&amp;ship_to_info_id=$ship_to_info_id&amp;shipping_rate_id=".@$shipping_rate_id."&amp;delivery_date_time=$delivery_date_time&amp;checkout_stage=".$step[0]['step_order'] ).'">';
File components\com_virtuemart\themes\ja_larix\templates\pages\account.order_details.tpl.php:
After (line 192-196):
Code: [Select]
<td><?php 
         echo 
$CURRENCY_DISPLAY->getFullValue($details[3], ''$db->f('order_currency'));
         ?>

</td>
      </tr>
Add:
Code: [Select]
<!--Start delivery date time-->
<tr>
       <td colspan="3"><br/><strong><?php echo $VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME'?>: </strong><?php echo $db->f("delivery_date_time"); ?> </td>
</tr>
<!--End delivery date time-->

File administrator\components\com_virtuemart\html\order.order_print.php:
After (line 517-522):
Code: [Select]
      <tr>
    <td align="left">
    <strong><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_SHIPPING_MODE_LBL'?>: </strong>
    <?php echo $details[2]; ?>
                </td>
    </tr>
Add:
Code: [Select]
               <!--Start delivery date time-->
                <tr>
    <td align="left">
    <?php $ps_order_change_html->html_change_delivery_date_time() ?>
                </td>
    </tr>
               <!--End delivery date time-->

File administrator\components\com_virtuemart\html\order.order_printdetails.php:
After (line188-189):
Code: [Select]
<td><?php echo $CURRENCY_DISPLAY->getFullValue($details[3], ''$db->f('order_currency')); ?></td>
</tr>
Add:
Code: [Select]
<!--Start delivery date time-->
<tr>
<td colspan="3"><br/><strong><?php echo $VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME'?>: </strong><?php echo $db->f("delivery_date_time"); ?></td>
</tr>
<!--End delivery date time-->

File components\com_virtuemart\themes\ja_larix\templates\order_emails\confirmation_email.tpl.php:
Replace (line 277):
Code: [Select]
<td><?php echo $shipping_info_details ?></td>With:
Code: [Select]
<td valign="top"><?php echo $shipping_info_details ?><br/><strong><?php echo $VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME'?>: </strong><?php echo $db->f("delivery_date_time"); ?></td><!--Print delivery date time -->
File administrator\components\com_virtuemart\classes\ps_order_change.php:
After end of function change_customer_note() (line 244-260):
Code: [Select]
$vmLogger->info( $VM_LANG->_( 'PHPSHOP_ORDER_PRINT_CUSTOMER_NOTE' ) . $VM_LANG->_( 'PHPSHOP_ORDER_EDIT_SOMETHING_HAS_CHANGED' ) ) ;
$this->recalc_order( $this->order_id ) ;
            }
add function change_delivery_date_time():
Code: [Select]
/**************************************************************************
* name: change_delivery_date_time
* created by: kaltokri modif by ZDJL505
* description: Change order delivery_date_time
* parameters: none
* returns: none
**************************************************************************/
function change_delivery_date_time() {
global $VM_LANG, $vmLogger ;

$db = new ps_DB( ) ;
$delivery_date_time = trim( vmGet( $_REQUEST, 'delivery_date_time' ) ) ;

// Update order
$q = "UPDATE #__{vm}_orders " ;
$q .= "SET delivery_date_time = '" . $delivery_date_time . "' " ;
$q .= "WHERE order_id = '" . $this->order_id . "'" ;
$db->query( $q ) ;
$db->next_record() ;
$this->reload_from_db = 1 ;

$vmLogger->info( $VM_LANG->_( 'PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME' ) . $VM_LANG->_( 'PHPSHOP_ORDER_EDIT_SOMETHING_HAS_CHANGED' ) ) ;
$this->recalc_order( $this->order_id ) ;
}
After (line 1080-1081):
Code: [Select]
elseif( vmGet( $_REQUEST, 'change_customer_note' ) != '' )
$ps_order_change->change_customer_note() ;
Add:
Code: [Select]
elseif( vmGet( $_REQUEST, 'change_delivery_date_time' ) != '' )
$ps_order_change->change_delivery_date_time() ;

File administrator\components\com_virtuemart\classes\ps_order_change_html.php:
After end of function html_change_customer_note() (line(120-137):
Code: [Select]
  <input type="hidden" name="order_id" value="<?php echo $this->order_id ?>" /> 
</form> <?php
  
}
Add:
Code: [Select]
/**************************************************************************
* name: html_change_delivery_date_time
* created by: ?, modified by kaltokrikaltokri modif by ZDJL505
* description: Prints formular to change delivery date and time
* parameters: none
* returns: none
**************************************************************************/

function html_change_delivery_date_time() {
    global $VM_LANG;
global $vendor_date_format;
JHTML::_('behavior.calendar');
   
$db = new ps_DB;
$q = "SELECT * FROM #__{vm}_orders WHERE order_id='".$this->order_id."'";
$db->query($q);
$db->next_record();
?>
  <form method="post" action="<?php echo $_SERVER['PHP_SELF'?>">
        <?php echo $VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME'?>:
  <input type="text" value="<?php $db->p("delivery_date_time"?>" size="50" name="delivery_date_time" id="delivery_date_time_input"/>
            <script type="text/javascript">
    Calendar.setup({
        inputField : "delivery_date_time_input",
        ifFormat : "<?php echo $vendor_date_format?>",
        showsTime : true,
timeFormat : "12",
singleClick : false,
dateStatusFunc :   function (date) {
                              var today = new Date();
  return (date.getDate() < today.getDate() ) ? true : false;
  }
});
</script>
    <input type="image" title="<?php echo $VM_LANG->_('PHPSHOP_UPDATE'?>"
    src="<?php echo VM_THEMEURL ?>images/edit_f2.gif" border="0"  alt="<?php echo $VM_LANG->_('PHPSHOP_UPDATE'?>" />
    <input type="hidden" value="1" name="change_delivery_date_time" />
    <input type="hidden" name="page" value="order.order_print" />
    <input type="hidden" name="option" value="com_virtuemart" />
    <input type="hidden" name="func" value="" />
    <input type="hidden" name="order_id" value="<?php echo $this->order_id ?>" /> 
  </form>
    <?php
  
}

File administrator\components\com_virtuemart\sql\sql.virtuemart.php:
After (line1073):
Code: [Select]
  `customer_note` text NOT NULL,Add:
Code: [Select]
  `delivery_date_time` varchar(40) NOT NULL,
File administrator\components\com_virtuemart\classes\export\ps_olsi.php:
After (line 371):
Code: [Select]
$OLWebOrder['OLWebOrder']['OrderHeader']['ProcessingOptions']['CarrierCode'] = $this->getCarrierCode($order[$i]['ship_method_id']);Add:
Code: [Select]
$OLWebOrder['OLWebOrder']['OrderHeader']['ProcessingOptions']['CarrierCode'] = $this->getCarrierCode($order[$i]['delivery_date_time']);
Regards,


[attachment cleanup by admin]
The spirit of sharing

quodran

  • Beginner
  • *
  • Posts: 1
Re: Add delivery date & time at checkout process
« Reply #1 on: March 25, 2009, 09:45:27 am »
Great job!
Just one problem though, if you have only one payment method, the date doesn't get to the final confirmation checkout page. Any idea how to fix this?

Thanks!

zdjl505

  • Beginner
  • *
  • Posts: 18
    • roncekembang
Re: Add delivery date & time at checkout process
« Reply #2 on: March 25, 2009, 18:48:07 pm »
Hi quodran,

Thanks for quality check. I already modify my 1st post to solve 2 problems:
1. The delivery date can't get to the final confirmation checkout page if there is only one payment method, and
2. Delivery date will blank If you go back to the previous checkout step. This is because checkout bar link can't store delivery date information.

Please apply modification for files:
administrator\components\com_virtuemart\classes\ps_checkout.php
components\com_virtuemart\themes\ja_larix\templates\checkout\get_shipping_method.tpl.php
components\com_virtuemart\themes\ja_larix\templates\checkout\checkout_bar.tpl.php
that already updated. The attached file in the 1st post already updated too.

Regards
 
The spirit of sharing

Jon Jackson

  • Jr. Member
  • **
  • Posts: 79
Re: Add delivery date & time at checkout process
« Reply #3 on: April 24, 2009, 07:14:29 am »
Fantastic piece of work... well done.

I need something similar, but I don't want the calendar, just 3 radio buttons.  which read "Morning", "Afternoon" and "Evening" - one to be required.

Any suggestions how to do that, please?

zdjl505

  • Beginner
  • *
  • Posts: 18
    • roncekembang
Re: Add delivery date & time at checkout process
« Reply #4 on: April 26, 2009, 17:27:21 pm »
Hi Jon,

Below is the modification that:
  • Replace calendar with 3 radio button for ‘Morning’, ‘Afternoon’ and ‘Evening’
  • At the beginning, there is no selected button. This can force customer to make their selection
  • Memorize last customer selection, when they step back in checkout process
  • The selected delivery time will be shown at order information, order information print & order confirmation email, also can be edited in order admin page
  • You can translate ‘Morning’, ‘Afternoon’ and ‘Evening’ to other language

After you implement above modification, add & replace some code below.  The modified files are:
administrator\components\com_virtuemart\languages\common\english.php
components\com_virtuemart\themes\ja_larix\templates\checkout\get_shipping_method.tpl.php
components\com_virtuemart\themes\ja_larix\templates\checkout\get_final_confirmation.tpl.php
components\com_virtuemart\themes\ja_larix\templates\pages\account.order_details.tpl.php
administrator\components\com_virtuemart\html\order.order_printdetails.php
components\com_virtuemart\themes\ja_larix\templates\order_emails\confirmation_email.tpl.php
administrator\components\com_virtuemart\classes\ps_order_change_html.php

File administrator\components\com_virtuemart\languages\common\english.php:
Add 3 following declarations. Add your own translation in language other than English.
Code: [Select]
'PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME1' => 'Morning',
'PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME2' => 'Afternoon',
'PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME3' => 'Evening',

File components\com_virtuemart\themes\ja_larix\templates\checkout\get_shipping_method.tpl.php:
Replace:
Code: [Select]
<input type="text" class="inputbox" size="40" name="delivery_date_time" id="delivery_date_time_input" value="<?php echo $delivery_date_time?>"/>
<script type="text/javascript">
    Calendar.setup({
        inputField : "delivery_date_time_input",
        ifFormat : "<?php echo $vendor_date_format?>",
        showsTime : true,
timeFormat : "12",
singleClick : false,
dateStatusFunc  :   function (date) {
                              var myDate = new Date();
  if (date.getTime() < myDate.setDate(myDate.getDate() - 1)) return true;
  }
});
</script>
<?php
With:
Code: [Select]
<br/>
<?php if ($delivery_date_time == "1") { ?>
<input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="1" checked/>
<?php } else {?>
<input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="1"/>
<?php }
echo 
$VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME1'?>
<br/>
<?php if ($delivery_date_time == "2") { ?>
<input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="2" checked/>
<?php } else {?>
<input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="2"/>
<?php }
echo 
$VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME2'?>
<br/>
<?php if ($delivery_date_time == "3") { ?>
<input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="3" checked/>
<?php } else {?>
<input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="3"/>
<?php }
echo 
$VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME3');

File components\com_virtuemart\themes\ja_larix\templates\checkout\get_final_confirmation.tpl.php:
Replace:
Code: [Select]
echo $delivery_date_time;With:
Code: [Select]
echo $VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME' . $delivery_date_time);
File components\com_virtuemart\themes\ja_larix\templates\pages\account.order_details.tpl.php:
Replace:
Code: [Select]
<td colspan="3"><br/><strong><?php echo $VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME'?>: </strong><?php echo $db->f("delivery_date_time"); ?></td>With:
Code: [Select]
<td colspan="3"><br/><strong><?php echo $VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME'?>: </strong><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME' $db->f("delivery_date_time")); ?></td>

File administrator\components\com_virtuemart\html\order.order_printdetails.php:
Replace:
Code: [Select]
<td colspan="3"><br/><strong><?php echo $VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME'?>: </strong><?php echo $db->f("delivery_date_time"); ?></td>With:
Code: [Select]
<td colspan="3"><br/><strong><?php echo $VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME'?>: </strong><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME' $db->f("delivery_date_time")); ?></td>

File components\com_virtuemart\themes\ja_larix\templates\order_emails\confirmation_email.tpl.php:
Replace:
Code: [Select]
<td valign="top"><?php echo $shipping_info_details ?><br/><strong><?php echo $VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME'?>: </strong><?php echo $db->f("delivery_date_time"); ?></td>
With:
Code: [Select]
<td valign="top"><?php echo $shipping_info_details ?><br/><strong><?php echo $VM_LANG->_('PHPSHOP_INFO_MSG_DELIVERY_DATE_TIME'?>: </strong><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME' $db->f("delivery_date_time")); ?></td>

File administrator\components\com_virtuemart\classes\ps_order_change_html.php:
Replace:
Code: [Select]
  <input type="text" value="<?php $db->p("delivery_date_time"?>" size="50" name="delivery_date_time" id="delivery_date_time_input"/>
            <script type="text/javascript">
    Calendar.setup({
        inputField : "delivery_date_time_input",
        ifFormat : "<?php echo $vendor_date_format?>",
        showsTime : true,
timeFormat : "12",
singleClick : false,
dateStatusFunc  :   function (date) {
                              var today = new Date();
  return (date.getDate() < today.getDate() ) ? true : false;
  }
});
</script>
With:
Code: [Select]
            <br/>
            <?php
$delivery_date_time $db->f('delivery_date_time'); 
if ($delivery_date_time == "1") { ?>

            <input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="1" checked/>
            <?php } else {?>
            <input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="1"/>
            <?php }
            echo 
$VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME1'?>
<br/>
            <?php if ($delivery_date_time == "2") { ?>
            <input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="2" checked/>
            <?php } else {?>
            <input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="2"/>
            <?php }
            echo 
$VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME2'?>
<br/>
            <?php if ($delivery_date_time == "3") { ?>
            <input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="3" checked/>
            <?php } else {?>
            <input type="radio" name="delivery_date_time" id="delivery_date_time_input" value="3"/>
            <?php }
            echo 
$VM_LANG->_('PHPSHOP_CHECKOUT_DELIVERY_DATE_TIME3');?>


Regards
The spirit of sharing

Soren Solhaug Madsen

  • Beginner
  • *
  • Posts: 3
Re: Add delivery date & time at checkout process
« Reply #5 on: May 16, 2009, 19:56:38 pm »
Wooh what a nice add-on.

but there are somethings i like to be abel to do also, hope someone can help me or point out where to changes the things.

1. changes time on calender to military time 00:00 - 24:00

2. lock the time on the calender to store opening hour. etc.
monday 09:00-17:00
tursday 08:00-17:00
wedensday 08:00-17:00
thursday 08:00-17:00
friday 08:00-18:00
saturday 08:00-12:00
sunday 09:00-13:00

3. I like a place to write the days that the store is closed. so you can't chooose the date for delivery.

Hope someone can help me.
Solhaug

larrysm

  • Beginner
  • *
  • Posts: 7
Re: Add delivery date & time at checkout process
« Reply #6 on: May 21, 2009, 20:32:14 pm »
Soren Solhaug Madsen ,
#1 is easy enough.
change the code to

Code: [Select]
timeFormat : "24",
Sorry, don't know yet about #2 and #3.


oceanbluemedia

  • Beginner
  • *
  • Posts: 5
Re: Add delivery date & time at checkout process
« Reply #7 on: May 28, 2009, 21:21:00 pm »
Hi there,

I've just installed this and I thought it was working until I clicked on confirm order - this error came up:

Critical: Adding the Order into the Database failed!

Please help - also I just want to be able to specify the date and not the time - how do I remove this?

Thanks so much.

oceanbluemedia

  • Beginner
  • *
  • Posts: 5
Re: Add delivery date & time at checkout process
« Reply #8 on: May 29, 2009, 00:23:22 am »
Me again - I've managed to fix the first problem - for some reason the field hadn't been created in the database table so I manually created it and it worked.

I'm still desperate to know how to not show the time and also if a user doesn't enter a time an error message comes up which I don't want as they don't have to enter a delivery date.  How do I change it not to be a required element.

Thanks  ???

pia

  • Beginner
  • *
  • Posts: 24
Re: Add delivery date & time at checkout process
« Reply #9 on: July 10, 2009, 09:52:39 am »
Hi zdjl505...

Thank you!

philw

  • Beginner
  • *
  • Posts: 2
Re: Add delivery date & time at checkout process
« Reply #10 on: July 14, 2009, 14:17:54 pm »
Hi zdj

This is a great addition to a project I'm building.  I've also built in an export orders report for the client where they can export orders according to a certain date or dates orders were received.

They now have also asked to export the orders according to the delivery date.  The delivery date however is a string not an integer like the order date field(cdate).

I also need to look at allowing the user to choose dates for Tue-Fri only as well.

Hoping you may have suggestions.

Thanks
Phil

juxtapeer

  • Beginner
  • *
  • Posts: 1
Re: Add delivery date & time at checkout process
« Reply #11 on: July 23, 2009, 19:13:24 pm »
Guys,
This may be the wrong place to ask this, so please redirect me to the right area.  Can I access another database from inside of the virtuemart checkout class?  I want to generate a random 9 digit number and add it to a database and possibly hold that number in a session to use in other pages of the site.  I keep getting connection errors, so I don't know where to start. Should I start with Joomla configs?  Thanks in advance!

seconddream

  • Beginner
  • *
  • Posts: 1
Re: Add delivery date & time at checkout process
« Reply #12 on: July 26, 2009, 13:49:58 pm »
I have looking for this for over 1 year, you are the best. Keep up the good work.  :D I'm sooooo happy  :D

boonchunt

  • Beginner
  • *
  • Posts: 17
Re: Add delivery date & time at checkout process
« Reply #13 on: August 06, 2009, 02:29:40 am »
I Encounter the same error while checking out.

I solve it by creating a delivery_date_time in the jos_vm_orders table via PHPAdmin (cPanel). Thanks God. I reinstalled with this many times, but same problem came out.

It was tested, and work on Joomla Version 1.5.10 & Virtuemart 1.1.3.



Me again - I've managed to fix the first problem - for some reason the field hadn't been created in the database table so I manually created it and it worked.

I'm still desperate to know how to not show the time and also if a user doesn't enter a time an error message comes up which I don't want as they don't have to enter a delivery date.  How do I change it not to be a required element.

Thanks  ???

freshy

  • Beginner
  • *
  • Posts: 5
Re: Add delivery date & time at checkout process
« Reply #14 on: August 06, 2009, 08:58:09 am »
This is probably stupidly easy, but is there any way of turning off the error checking as I would like to make this field optional?

Is it possible to remove the time from the calendar?