Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default options in shipping module quotes: where and how to output to screen?

    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?
    Last edited by gernot; 10 Nov 2019 at 12:13 PM.
    Zen Cart 1.5.6c modified to support Japanese language (postage module support work in progress). Upgraded incrementally each version from initial 1.5.5d.

  2. #2
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: options in shipping module quotes: where and how to output to screen?

    Still plugging away on this, having looked at other shipping modules, I could not find any treatment of 'option' parameters in quotes, so this does not seem to be a built-in functionality, although the logic appears sound.
    Zen Cart 1.5.6c modified to support Japanese language (postage module support work in progress). Upgraded incrementally each version from initial 1.5.5d.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: options in shipping module quotes: where and how to output to screen?

    The ups, usps and FedEx Shipping options all offer multiple shipping "methods" that could be used as an example for "internal" design. Typically these each show one bullet per configuration. So to offer multiple time slots, the single shipping name would be combined with the delivery time to give like: "thisMethod Morning (8 a.m. - 12 p.m.)". Further the option designation would be made such that it could be "disassembled" to identify what features had been selected.

    This additional effort is needed to help identify the cost and/or other features of consideration.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: options in shipping module quotes: where and how to output to screen?

    Hi mc12345678,
    Very interesting, thank you for the reply and the insight, I will have a look at one of those modules.
    Obviously I would like to try this myself, although I haven't any use for those modules, but since I am not sure right now how difficult it is to integrate one or more of them as a test in my current cart (and a brief online search did not turn up any screenshots), let me ask here for clarification and for others reading this thread:
    When you say each method is offered a a separate bullet, does that mean within the area of the shipping module in the selection screen, or similarly separated like different modules?
    Zen Cart 1.5.6c modified to support Japanese language (postage module support work in progress). Upgraded incrementally each version from initial 1.5.5d.

 

 

Similar Threads

  1. v139h USPS Shipping Module Quotes Stopped Working Today?
    By ts232 in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 3 Mar 2013, 10:05 PM
  2. Replies: 22
    Last Post: 26 Jul 2012, 11:35 PM
  3. Free Shipping Options module, how to exclude some categories?
    By tj1 in forum Built-in Shipping and Payment Modules
    Replies: 28
    Last Post: 5 Mar 2011, 04:51 AM
  4. How to show Free Shipping AND other shipping options?
    By LRS in forum Built-in Shipping and Payment Modules
    Replies: 12
    Last Post: 20 Jul 2010, 08:25 PM
  5. Removing data output by shipping module
    By jdw1979 in forum General Questions
    Replies: 2
    Last Post: 17 Feb 2010, 08:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR