Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2008
    Posts
    149
    Plugin Contributions
    0

    Default modify USPS module display text on checkout pages?

    I'm sure there is a way to do this, but I'm trying to launch an updated site in less than 3 days and frankly need to focus my attention elsewhere. What I'm trying to do is have the text on the checkout_payment page for the Shipping option selected say "Shipping:" no matter what option is selected. As it is now, if they select In-Store Pickup it says "Walk In" and if they pick USPS Priority Mail it says "United States Parcel Service (Parcel Post (4-7 days)):" which is really messing up the look I'm trying to achieve. I only want to modify this page, and leave the checkout_shipping page as is (where it would display the full text, delivery time, etc.). Does anyone have any suggestions on how I can achieve this?

    Thanks in advance!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to modify USPS module display text on checkout pages?

    To change how this reads on the checkout_payment page only ... you can customize the code in:
    /includes/modules/order_total/ot_shipping.php

    with the code in RED:
    Code:
        function process() {
          global $order, $currencies;
    
    // bof: show different shipping title on checkout_payment
    if ($_GET['main_page'] == 'checkout_payment') {
            $this->output[] = array('title' => 'Shipping' . ':',
                                    'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
                                    'value' => $order->info['shipping_cost']);
    } else {
            $this->output[] = array('title' => $order->info['shipping_method'] . ':',
                                    'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
                                    'value' => $order->info['shipping_cost']);
    }
    // eof: show different shipping title on checkout_payment
        }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jan 2008
    Posts
    149
    Plugin Contributions
    0

    Default Re: How to modify USPS module display text on checkout pages?

    Thank you--this worked great!

    I found one more thing in the USPS module I have a question on: Is there a way to get rid of the ( ) around "Parcel Post" or "Priority Mail", etc? I only found the section with the ( ) around the transit time in modules/shipping/usps.php.

    Thanks again!



    Quote Originally Posted by Ajeh View Post
    To change how this reads on the checkout_payment page only ... you can customize the code in:
    /includes/modules/order_total/ot_shipping.php

    with the code in RED:
    Code:
        function process() {
          global $order, $currencies;
    
    // bof: show different shipping title on checkout_payment
    if ($_GET['main_page'] == 'checkout_payment') {
            $this->output[] = array('title' => 'Shipping' . ':',
                                    'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
                                    'value' => $order->info['shipping_cost']);
    } else {
            $this->output[] = array('title' => $order->info['shipping_method'] . ':',
                                    'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
                                    'value' => $order->info['shipping_cost']);
    }
    // eof: show different shipping title on checkout_payment
        }

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to modify USPS module display text on checkout pages?

    Look in the module:
    /includes/modules/shipping/usps.php

    and change the context of the two lines for:
    Code:
                if ($time != '') $transittime[$service] = ' (' . $time . ')';
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jan 2008
    Posts
    149
    Plugin Contributions
    0

    Default Re: How to modify USPS module display text on checkout pages?

    Thanks, but that's not quite what I was looking for. I had already found that piece to adjust the ( ) around the transit days. I want to get rid of the ( ) around the whole shipping method:

    Instead of "USPS (Parcel Post [4-7 days])"

    I want "USPS Parcel Post [4-7 days]"

    In the line of code you referenced, that's where I changed the ( ) to [ ], but it does not get rid of the ( ) around the bigger element.

    Any thoughts?

    Thanks again for your help.



    Quote Originally Posted by Ajeh View Post
    Look in the module:
    /includes/modules/shipping/usps.php

    and change the context of the two lines for:
    Code:
                if ($time != '') $transittime[$service] = ' (' . $time . ')';

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to modify USPS module display text on checkout pages?

    Look in the file:
    /includes/modules/checkout_shipping/header_php.php

    Code:
                  $_SESSION['shipping'] = array('id' => $_SESSION['shipping'],
                                    'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
                                    'cost' => $quote[0]['methods'][0]['cost']);
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to modify USPS module display text on checkout pages?

    Also, for the Shipping Estimator you will want to look at:
    /includes/templates/template_default/templates/tpl_modules_shipping_estimator.php

    and using your templates and overrides customize the code for:
    Code:
             <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>
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Jan 2008
    Posts
    149
    Plugin Contributions
    0

    Default Re: How to modify USPS module display text on checkout pages?

    Thank you once again for your help! I just have one last question I'm hoping you can help me with:

    I'm trying to make a conditional statement that will do one of two things...

    (a) If order weight is 0, make the shipping charge $5.00 and ignore the USPS rate quotes. Ideally, it would still display as USPS Priority Mail [2-3 days] as the existing USPS module does, but not pull the rates from the USPS site.

    (b) If what I've outlined in (a) can't be done, then is there a way to add a handling charge to First-Class Mail only? So, if you have a 0 weight order, offer First Class Mail at rate quote + $3.00 as well as Priority Mail at rate quote, with no handling charge?

    Thank you!!!

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to modify USPS module display text on checkout pages?

    You should be able to customize the code with:
    Code:
        // disable only when entire cart is free shipping
        if (zen_get_shipping_enabled($this->code)) {
          $this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);
        }
    
    // bof: turn off if weight is 0
    if (!IS_ADMIN_FLAG) {
      if ($_SESSION['cart']->weight == 0) {
        $this->enabled = false;
      }
    }
    // eof: turn off if weight is 0
    
        if ($this->enabled) {
    NOTE: ensure that in the Configuration ... Shipping/Packaging ... that the setting on:
    Order Free Shipping 0 Weight Status
    If there is no weight to the order, does the order have Free Shipping?
    0= no
    1= yes

    Note: When using Free Shipping, Enable the Free Shipping Module this will only show when shipping is free.
    is set to 0 for No ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Jan 2008
    Posts
    149
    Plugin Contributions
    0

    Default Re: How to modify USPS module display text on checkout pages?

    Worked great! I used the same code on the flat-rate shipping module with a few tweaks and got it to switch between the two modules depending on weight. Thank you! You're a lifesaver

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Text/image display question on attributes in the product info AND checkout pages
    By jeffmic in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 6 May 2010, 10:44 PM
  2. Replies: 2
    Last Post: 30 Sep 2009, 07:29 PM
  3. Q: How to add/modify text on various shopping cart pages...
    By mrmikal in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 31 Mar 2009, 01:32 AM
  4. How do I modify the text in a 'checkout email'?
    By Tectic in forum General Questions
    Replies: 3
    Last Post: 5 Jan 2009, 06:33 PM

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