Hi all,
ZC1.5.6c, PHP 7.3.10, responsive classic template.
I have some shipping modules which in addition to giving a quote of 'cost' also have an 'option' for time of delivery.
However, this does not actually work, i.e., no such selection appears on the Step1 of the checkout procedure.
In future I expect I would like to offer something like 'refrigerated delivery' also as an option rather than creating a new module.
In any case, I don't find any use of any quote 'option' either in
includes/modules/<OVERRIDE>/shipping_estimator.php
or in
includes/modules/pages/checkout_shipping/header_php.php
or in
includes/templates/<OVERRIDE based on responsive_classic>/templates/tpl_checkout_shipping_default.php
which files are where I suspect use of such an 'option' would be explicitly required to be placed (judging by following the logic of the gift wrap module).
Here is an example, from the Japanese nittsu.php, yamato.php and sagawaex.php shipping module files (from 1.5.1 Japanese Zen Cart).
I chose sagawaex.php for this example.
Declaration in the quote function:
PHP Code:
// class methods
function quote() {
global $shipping_weight, $shipping_num_boxes;
global $order;
global $a_sagawaex_time;
global $cart;
global $db;
and then in the quote function the call to the time specification function to display a drop-down menu:
PHP Code:
if (!isset($tmpQuote['error'])) {
// 配送時刻指定
$timespec = $this->get_timespec();
$tmpQuote['option'] = TEXT_TIME_SPECIFY
. zen_draw_pull_down_menu('sagawaex_timespec', $a_sagawaex_time, $timespec);
$tmpQuote['timespec'] = $timespec;
}
which function is defined as:
PHP Code:
function get_timespec() {
global $a_sagawaex_time;
global $shipping;
$selected = $a_sagawaex_time[0]['id'];
if ( isset($_POST['sagawaex_timespec']) ) {
$selected = $_POST['sagawaex_timespec'];
} elseif ( is_array($shipping) ) { // see checkout_shipping.php
list($module, $method) = explode('_', $shipping['id']);
if ($module == $this->code) {
$selected = $shipping['timespec'];
}
}
return $selected;
}
In the English language file, the time array is defined as:
PHP Code:
$GLOBALS['a_sagawaex_time']=array(
array('id'=>'None specified', 'text'=>'None'),
array('id'=>'Before noon', 'text'=>'Morning (8 a.m. - 12 a.m.)'),
array('id'=>'12 to 15','text'=>'12 a.m. - 3 p.m.'),
array('id'=>'15 to 18','text'=>'3 p.m. - 6 p.m.'),
array('id'=>'18 to 21','text'=>'6 p.m. - 9 p.m.'),
);
Would it be necessary to explicitly add 'option' output in the shipping_estimator.php, checkout_shipping/header_php.php, and tpl_checkout_shipping_default.php files, or is there already machinery in place to use options, which I am missing?
Bookmarks