Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Help me track down where to find this in the code please: <div id="otshipping">

    Step 2 of checkout it shows "Your Total" and presents the subtotal, shipping, total, etc. I am trying to customize this area but I can't for the life of me find where it is!

    Its a <div> with id="otshipping". I've extensively searched the files and I can't find what is generating this. Help appreciated.

  2. #2
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Help me track down where to find this in the code please: <div id="otshipping">

    Text shown to visitors in the Order Total listings come from the Order Total modules. In the case of the "shipping" (ot_shipping) order total module, the text will come from the shipping module (configured title and customer selected method).

    The HTML structure is generated by the theme's template file "tpl_modules_order_totals.php".

    What exactly are you trying to change?
    Last edited by lhungil; 16 Oct 2015 at 11:50 PM.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  3. #3
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Help me track down where to find this in the code please: <div id="otshipping">

    Exactly what I'm trying to change is the display of the name of the shipping method with something more generic, such as simply "Shipping: "

    So right now it looks like this:

    Code:
    Sub-Total: €78.63
    Flat Rate (Best Way): €9.16
    Total: €87.80
    I want that to show:

    Code:
    Sub-Total: €78.63
    Shipping: €9.16
    Total: €87.80

  4. #4
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Help me track down where to find this in the code please: <div id="otshipping">

    I should mention that I don't want to mess with the titles for the module itself, because I still want it to display the same in the back end and recorded the same way to the database. I just want to change how it is displayed to the user during checkout.

  5. #5
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Help me track down where to find this in the code please: <div id="otshipping">

    Probably a better way, but I altered tpl_modules_order_totals.php like so:

    Code:
    <?php 
    
    /**
     * Displays order-totals modules' output
     */
      for ($i=0; $i<$size; $i++) { ?>
    <div id="<?php echo str_replace('_', '', $GLOBALS[$class]->code); ?>">
        <div class="totalBox larger forward"><?php echo $GLOBALS[$class]->output[$i]['text']; ?></div>
        <?php if ( strpos( $GLOBALS[$class]->output[$i]['title'], '(' )){ ?>
          <div class="lineTitle larger forward"><?php echo TEXT_SHIPPING_SUBTITLE; ?></div>
        <?php } else { ?>
        <div class="lineTitle larger forward"><?php echo $GLOBALS[$class]->output[$i]['title']; ?></div>
        <?php } ?>
    </div>
    <br class="clearBoth" />
    <?php } ?>
    Since the shipping line always (I think) has a parenthesis in it, I just check for that and output my defined text instead. It works, but I'm concerned if there is ever a case where my parenthesis test doesn't hold. Small concern though.

    Thanks for pointing me in the direction. If you have a better solution, I'm all ears.

  6. #6
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Help me track down where to find this in the code please: <div id="otshipping">

    Create a new file in the currently selected theme's template folder named
    "/includes/templates/<theme_name>/templates/tpl_modules_order_totals.php"

    Try the following contents for the file:
    Code:
    <?php
    /**
     * Module Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 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_order_totals.php 2993 2006-02-08 07:14:52Z birdbrain $
     */
     ?>
    <?php
    /**
     * Displays order-totals modules' output
     */
      for ($i=0; $i<$size; $i++) { ?>
    <div id="<?php echo str_replace('_', '', $GLOBALS[$class]->code); ?>">
        <div class="totalBox larger forward"><?php echo $GLOBALS[$class]->output[$i]['text']; ?></div>
        <div class="lineTitle larger forward"><?php
        	if($GLOBALS[$class]->code === 'ot_shipping') {
        		echo MODULE_ORDER_TOTAL_SHIPPING_TITLE . ':';
        	}
        	else {
        		echo $GLOBALS[$class]->output[$i]['title'];
        	}
        ?></div>
    </div>
    <br class="clearBoth" />
    <?php } ?>
    Only major downside I can think of off the top of my head would be if the site ever offers different shipping options on a per product basis (such as one item via UPS another in the order via USPS, etc), it may not be clear to the customer how things are being shipped (and they would see multiple shipping lines prefixed by "Shipping:").

    Could do the check earlier (outside the loop and add the values for shipping together)... But then, very few Zen Cart shipping modules exist at this time with support for the above (so probably not needed in your store).

    NOTE: Gotta love cross posting. Was typing the above when you posted your example
    Last edited by lhungil; 17 Oct 2015 at 12:12 AM.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  7. #7
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Help me track down where to find this in the code please: <div id="otshipping">

    Same general idea, but yours is more generic. I'll use that, thanks!

  8. #8
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Help me track down where to find this in the code please: <div id="otshipping">

    Clarification about the downside listed above. Should read something closer to: if the site offers different shipping carriers (or options) on a per product basis (such as one item via UPS and another item via USPS, etc) and allows mixed shipping carriers in the same order.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  9. #9
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Help me track down where to find this in the code please: <div id="otshipping">

    Quote Originally Posted by lhungil View Post
    Clarification about the downside listed above. Should read something closer to: if the site offers different shipping carriers (or options) on a per product basis (such as one item via UPS and another item via USPS, etc) and allows mixed shipping carriers in the same order.
    Thanks for that. If I were offering such shipping, I probably wouldn't want it generic. The only reason I want to change it is to save realestate on a small mobile screen. I'm trying to trim down unnecessary wording.

 

 

Similar Threads

  1. where can I find out the "discount count down by the time"
    By soso838 in forum General Questions
    Replies: 5
    Last Post: 18 Apr 2018, 11:52 PM
  2. v151 Where is the code for the product listing sort "up" and "down' arrow?
    By rcrosier in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 30 Jan 2013, 06:38 PM
  3. <div class="legalcopyright"> where the frick is it?
    By Rickwilliams in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 23 Jul 2009, 08:34 AM
  4. Comment / Disable "Min: 0 Units: 0" Where is this code located?
    By edwardtilbury in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 28 Mar 2009, 07:44 PM
  5. where can setting the middle "DIV" display ?
    By greenlight in forum General Questions
    Replies: 0
    Last Post: 10 Oct 2008, 06:36 AM

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