Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    7,003
    Plugin Contributions
    27

    Default Hide Available Shipping Methods table until Shipping Estimator runs

    Client offers other flat rates along with UPS and doesn't want the Available Shipping Methods table to display on the
    http: // yoursite(dot)com/index(dot)php? main_page=shopping_cart page until the shipping estimator rates are returned. Is this something easily achieved and does any one have a hint how to go about this??
    Last edited by DivaVocals; 2 Aug 2012 at 02:59 AM.
    My Site
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  2. #2
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    7,003
    Plugin Contributions
    27

    Default Re: Hide Available Shipping Methods table until Shipping Estimator runs

    Quote Originally Posted by DivaVocals View Post
    Client offers other flat rates along with UPS and doesn't want the Available Shipping Methods table to display on the
    http: // yoursite(dot)com/index(dot)php? main_page=shopping_cart page until the shipping estimator rates are returned. Is this something easily achieved and does any one have a hint how to go about this??
    Hate to bump this, but I am stumped here.. Anyone got any ideas???

    Here what the page looks like. Note that the Available Shipping Methods table displays.
    Attachment 11004


    After you enter the location and postal code information then the rest of the shipping rates display.
    Attachment 11005

    I want to know how NOT to display the entire Available Shipping Methods table until you enter the location and postal code information. This way all the available shipping methods are displayed together. (flat rates as well as UPS)
    My Site
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    1,939
    Plugin Contributions
    20

    Default Re: Hide Available Shipping Methods table until Shipping Estimator runs

    Give this a shot; it's a replacement for your /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_shipping_estimator.php. There are two areas that were changed, just look for the //-bof and //-eof comments.
    Code:
    <?php
    /**
     * Module Template - for shipping-estimator display
     *
     * @package templateSystem
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_modules_shipping_estimator.php 18695 2011-05-04 05:24:19Z drbyte $
     */
    ?>
    <div id="shippingEstimatorContent">
    <?php echo zen_draw_form('estimator', zen_href_link($show_in, '', $request_type), 'post'); ?>
    <?php echo zen_draw_hidden_field('scid', $selected_shipping['id']); ?>
    <?php echo zen_draw_hidden_field('action', 'submit'); ?>
    <?php
      if($_SESSION['cart']->count_contents()) {
        if ($_SESSION['customer_id']) {
    ?>
    <h2><?php echo CART_SHIPPING_OPTIONS; ?></h2>
    
    
    <?php if (!empty($totalsDisplay)) { ?>
    <div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
    <?php } ?>
    
    <?php
        // only display addresses if more than 1
          if ($addresses->RecordCount() > 1){
    ?>
    <label class="inputLabel" for="seAddressPulldown"><?php echo CART_SHIPPING_METHOD_ADDRESS; ?></label>
    <?php echo zen_draw_pull_down_menu('address_id', $addresses_array, $selected_address, 'onchange="return shipincart_submit();" id="seAddressPulldown"'); ?>
    <?php
          }
    ?>
    
    <div class="bold back" id="seShipTo"><?php echo CART_SHIPPING_METHOD_TO; ?></div>
    <address class="back"><?php echo zen_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br />'); ?></address>
    <br class="clearBoth" />
    <?php
        } else {
    ?>
    <h2><?php echo CART_SHIPPING_OPTIONS; ?></h2>
    <?php if (!empty($totalsDisplay)) { ?>
    <div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
    <?php } ?>
    <?php
          if($_SESSION['cart']->get_content_type() != 'virtual'){
    ?>
    
    <label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
    <?php echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" onchange="update_zone(this.form);"'); ?>
    <br class="clearBoth" />
    
    <label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE; ?></label>
    <?php echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $state_zone_id, 'id="stateZone"');?>
    <br class="clearBoth" id="stBreak" />
    <label class="inputLabel" for="state" id="stateLabel"><?php echo $state_field_label; ?></label>
    <?php echo zen_draw_input_field('state', $selectedState, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"') .'&nbsp;<span class="alert" id="stText">&nbsp;</span>'; ?>
    <br class="clearBoth" />
    
    <?php
            if(CART_SHIPPING_METHOD_ZIP_REQUIRED == "true"){
    ?>
    <label class="inputLabel"><?php echo ENTRY_POST_CODE; ?></label>
    <?php echo  zen_draw_input_field('zip_code', $zip_code, 'size="7"'); ?>
    <br class="clearBoth" />
    <?php
            }
    ?>
    <div class="buttonRow forward"><?php echo  zen_image_submit(BUTTON_IMAGE_UPDATE, BUTTON_UPDATE_ALT); ?></div>
    <br class="clearBoth" />
    <?php
          }
        }
        if($_SESSION['cart']->get_content_type() == 'virtual'){
    ?>
    <?php echo CART_SHIPPING_METHOD_FREE_TEXT .  ' ' . CART_SHIPPING_METHOD_ALL_DOWNLOADS; ?>
    <?php
        }elseif ($free_shipping==1) {
    ?>
    <?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)); ?>
    <?php
        }else{
    //-bof-No display until country/state/zip are entered (1 of 2)
          if ($selected_country == 0 || ($selectedState == '' && $state_zone_id == 0) || $zip_code == '') {
    	    if (!defined(TEXT_ENTER_ALL_VALUES)) define ('TEXT_ENTER_ALL_VALUES', 'Please select your country, state and zipcode so that we can can retrieve an accurate shipping estimate.');
    	    echo '<p>' . TEXT_ENTER_ALL_VALUES . '</p>';
    	  } else {
    //-eof-No display until country/state/zip are entered (1 of 2)
    ?>
    <table width="100%" border="1" cellpadding="2" cellspacing ="2">
    <?php if ($_SESSION['customer_id'] < 1 ){ ?>
        <tr>
          <td colspan="2" class="seDisplayedAddressLabel">
            <?php echo CART_SHIPPING_QUOTE_CRITERIA; ?><br />
            <?php echo '<span class="seDisplayedAddressInfo">' . zen_get_zone_name($selected_country, $state_zone_id, '') . ($selectedState != '' ? ' ' . $selectedState : '') . ' ' . $order->delivery['postcode'] . ' ' . zen_get_country_name($order->delivery['country_id']) . '</span>'; ?>
          </td>
        </tr>
    <?php } ?>
         <tr>
           <th scope="col" id="seProductsHeading"><?php echo CART_SHIPPING_METHOD_TEXT; ?></th>
           <th scope="col" id="seTotalHeading"><?php echo CART_SHIPPING_METHOD_RATES; ?></th>
         </tr>
    <?php
          for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
            if(sizeof($quotes[$i]['methods'])==1){
              // simple shipping method
              $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][0]['id'];
    ?>
         <tr class="<?php echo $extra; ?>">
    <?php
              if($quotes[$i]['error']){
    ?>
             <td colspan="2"><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['error']; ?>)</td>
           </tr>
    <?php
              }else{
                if($selected_shipping['id'] == $thisquoteid){
    ?>
             <td class="bold"><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['methods'][0]['title']; ?>)</td>
             <td class="cartTotalDisplay bold"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])); ?></td>
           </tr>
    <?php
                }else{
    ?>
              <td><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['methods'][0]['title']; ?>)</td>
              <td class="cartTotalDisplay"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])); ?></td>
           </tr>
    <?php
                }
              }
            } else {
              // shipping method with sub methods (multipickup)
              for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
                $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'];
    ?>
        <tr class="<?php echo $extra; ?>">
    <?php
                if($quotes[$i]['error']){
    ?>
             <td colspan="2"><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['error']; ?>)</td>
           </tr>
    <?php
                }else{
                  if($selected_shipping['id'] == $thisquoteid){
    ?>
             <td class="bold"><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['methods'][$j]['title']; ?>)</td>
             <td class="cartTotalDisplay bold"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])); ?></td>
           </tr>
    <?php
                  }else{
    ?>
            <td><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['methods'][$j]['title']; ?>)</td>
            <td class="cartTotalDisplay"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])); ?></td>
          </tr>
    <?php
                  }
                }
              }
            }
          }
    ?>
    </table>
    <?php
       }
    //-bof-No display until country/state/zip are entered (2 of 2)
       }
    //-eof-No display until country/state/zip are entered (2 of 2)
      }
    ?>
    </form>
    </div>

  4. #4
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    7,003
    Plugin Contributions
    27

    Default Re: Hide Available Shipping Methods table until Shipping Estimator runs

    You are awesome!!!! This worked perfectly!!! thank you thank you thank you!!!!!!!!!!!!

    Quote Originally Posted by lat9 View Post
    Give this a shot; it's a replacement for your /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_shipping_estimator.php. There are two areas that were changed, just look for the //-bof and //-eof comments.
    Code:
    <?php
    /**
     * Module Template - for shipping-estimator display
     *
     * @package templateSystem
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_modules_shipping_estimator.php 18695 2011-05-04 05:24:19Z drbyte $
     */
    ?>
    <div id="shippingEstimatorContent">
    <?php echo zen_draw_form('estimator', zen_href_link($show_in, '', $request_type), 'post'); ?>
    <?php echo zen_draw_hidden_field('scid', $selected_shipping['id']); ?>
    <?php echo zen_draw_hidden_field('action', 'submit'); ?>
    <?php
      if($_SESSION['cart']->count_contents()) {
        if ($_SESSION['customer_id']) {
    ?>
    <h2><?php echo CART_SHIPPING_OPTIONS; ?></h2>
    
    
    <?php if (!empty($totalsDisplay)) { ?>
    <div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
    <?php } ?>
    
    <?php
        // only display addresses if more than 1
          if ($addresses->RecordCount() > 1){
    ?>
    <label class="inputLabel" for="seAddressPulldown"><?php echo CART_SHIPPING_METHOD_ADDRESS; ?></label>
    <?php echo zen_draw_pull_down_menu('address_id', $addresses_array, $selected_address, 'onchange="return shipincart_submit();" id="seAddressPulldown"'); ?>
    <?php
          }
    ?>
    
    <div class="bold back" id="seShipTo"><?php echo CART_SHIPPING_METHOD_TO; ?></div>
    <address class="back"><?php echo zen_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br />'); ?></address>
    <br class="clearBoth" />
    <?php
        } else {
    ?>
    <h2><?php echo CART_SHIPPING_OPTIONS; ?></h2>
    <?php if (!empty($totalsDisplay)) { ?>
    <div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
    <?php } ?>
    <?php
          if($_SESSION['cart']->get_content_type() != 'virtual'){
    ?>
    
    <label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
    <?php echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" onchange="update_zone(this.form);"'); ?>
    <br class="clearBoth" />
    
    <label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE; ?></label>
    <?php echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $state_zone_id, 'id="stateZone"');?>
    <br class="clearBoth" id="stBreak" />
    <label class="inputLabel" for="state" id="stateLabel"><?php echo $state_field_label; ?></label>
    <?php echo zen_draw_input_field('state', $selectedState, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"') .'&nbsp;<span class="alert" id="stText">&nbsp;</span>'; ?>
    <br class="clearBoth" />
    
    <?php
            if(CART_SHIPPING_METHOD_ZIP_REQUIRED == "true"){
    ?>
    <label class="inputLabel"><?php echo ENTRY_POST_CODE; ?></label>
    <?php echo  zen_draw_input_field('zip_code', $zip_code, 'size="7"'); ?>
    <br class="clearBoth" />
    <?php
            }
    ?>
    <div class="buttonRow forward"><?php echo  zen_image_submit(BUTTON_IMAGE_UPDATE, BUTTON_UPDATE_ALT); ?></div>
    <br class="clearBoth" />
    <?php
          }
        }
        if($_SESSION['cart']->get_content_type() == 'virtual'){
    ?>
    <?php echo CART_SHIPPING_METHOD_FREE_TEXT .  ' ' . CART_SHIPPING_METHOD_ALL_DOWNLOADS; ?>
    <?php
        }elseif ($free_shipping==1) {
    ?>
    <?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)); ?>
    <?php
        }else{
    //-bof-No display until country/state/zip are entered (1 of 2)
          if ($selected_country == 0 || ($selectedState == '' && $state_zone_id == 0) || $zip_code == '') {
            if (!defined(TEXT_ENTER_ALL_VALUES)) define ('TEXT_ENTER_ALL_VALUES', 'Please select your country, state and zipcode so that we can can retrieve an accurate shipping estimate.');
            echo '<p>' . TEXT_ENTER_ALL_VALUES . '</p>';
          } else {
    //-eof-No display until country/state/zip are entered (1 of 2)
    ?>
    <table width="100%" border="1" cellpadding="2" cellspacing ="2">
    <?php if ($_SESSION['customer_id'] < 1 ){ ?>
        <tr>
          <td colspan="2" class="seDisplayedAddressLabel">
            <?php echo CART_SHIPPING_QUOTE_CRITERIA; ?><br />
            <?php echo '<span class="seDisplayedAddressInfo">' . zen_get_zone_name($selected_country, $state_zone_id, '') . ($selectedState != '' ? ' ' . $selectedState : '') . ' ' . $order->delivery['postcode'] . ' ' . zen_get_country_name($order->delivery['country_id']) . '</span>'; ?>
          </td>
        </tr>
    <?php } ?>
         <tr>
           <th scope="col" id="seProductsHeading"><?php echo CART_SHIPPING_METHOD_TEXT; ?></th>
           <th scope="col" id="seTotalHeading"><?php echo CART_SHIPPING_METHOD_RATES; ?></th>
         </tr>
    <?php
          for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
            if(sizeof($quotes[$i]['methods'])==1){
              // simple shipping method
              $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][0]['id'];
    ?>
         <tr class="<?php echo $extra; ?>">
    <?php
              if($quotes[$i]['error']){
    ?>
             <td colspan="2"><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['error']; ?>)</td>
           </tr>
    <?php
              }else{
                if($selected_shipping['id'] == $thisquoteid){
    ?>
             <td class="bold"><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['methods'][0]['title']; ?>)</td>
             <td class="cartTotalDisplay bold"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])); ?></td>
           </tr>
    <?php
                }else{
    ?>
              <td><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['methods'][0]['title']; ?>)</td>
              <td class="cartTotalDisplay"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])); ?></td>
           </tr>
    <?php
                }
              }
            } else {
              // shipping method with sub methods (multipickup)
              for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
                $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'];
    ?>
        <tr class="<?php echo $extra; ?>">
    <?php
                if($quotes[$i]['error']){
    ?>
             <td colspan="2"><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['error']; ?>)</td>
           </tr>
    <?php
                }else{
                  if($selected_shipping['id'] == $thisquoteid){
    ?>
             <td class="bold"><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['methods'][$j]['title']; ?>)</td>
             <td class="cartTotalDisplay bold"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])); ?></td>
           </tr>
    <?php
                  }else{
    ?>
            <td><?php echo $quotes[$i]['module']; ?>&nbsp;(<?php echo $quotes[$i]['methods'][$j]['title']; ?>)</td>
            <td class="cartTotalDisplay"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])); ?></td>
          </tr>
    <?php
                  }
                }
              }
            }
          }
    ?>
    </table>
    <?php
       }
    //-bof-No display until country/state/zip are entered (2 of 2)
       }
    //-eof-No display until country/state/zip are entered (2 of 2)
      }
    ?>
    </form>
    </div>
    My Site
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  5. #5
    Join Date
    Dec 2011
    Posts
    59
    Plugin Contributions
    0

    Default Re: Hide Available Shipping Methods table until Shipping Estimator runs

    Hi DivaVocals,

    Are you able to tell me how you inserted you extra bullet pointed list beneath the available shipping options please? I too, would like to be able to some further guidance to make our shipping costs clearer.

    Thanks

 

 

Similar Threads

  1. Available shipping methods text change
    By luvvvvvit in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 21 Dec 2009, 12:29 AM
  2. hide other shipping methods with free shipping
    By thenax in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 10 Nov 2009, 09:46 PM
  3. Hide the shipping estimator if only free shipping?
    By westcoastfavors in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 22 Dec 2007, 06:27 AM
  4. USPS - No shipping methods available
    By DeV0id in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 12 May 2007, 04:29 AM
  5. Shipping Estimator Sort Shipping Methods
    By sitehatchery in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 15 Apr 2007, 05:34 AM

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
  •