Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jun 2009
    Posts
    42
    Plugin Contributions
    0

    Default Adding Information to Shipping Methods Lines

    I'm trying to add info after the USPS and UPS shipping methods names and estimated delivery length.

    Currently I have lines that look like:

    United States Postal Service (Priority Mail International (6 - 10 business days))

    What I want to have them say is something like this:

    United States Postal Service (Priority Mail International (6 - 10 business days)) - TRACKING NUMBER INCLUDED

    I just want to set it somewhere in the code to add info about including/not including a tracking number on the different shipping methods when the customers see them on the shipping_estimator box (shopping cart page) and the shipping method selection page (Step 1 of 3 - Delivery Information).

    Any help would be appreciated, thanks.

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Adding Information to Shipping Methods Lines

    https://www.zen-cart.com/tutorials/index.php?article=38
    https://www.zen-cart.com/tutorials/index.php?article=39


    Search for part of those strings to see where they're defined, and add your text to the define value.

  3. #3
    Join Date
    Jun 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Adding Information to Shipping Methods Lines

    I should have mentioned that I've already searched for the text using the Developers Toolkit but it appears to be reading multiple defined text and combining them into one line making it more difficult to find. Still can't figure it out.

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Adding Information to Shipping Methods Lines

    That can be a problem, which is why I usually search for the smallest part of the string that seems to be likely to be unique. I used the DTK to search for priority mail, and it looks like all that is defined in includes/modules/shipping/usps.php.

  5. #5
    Join Date
    Jun 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Adding Information to Shipping Methods Lines

    Yes I know where the usps.php file is and have looked over it a ton but cannot find any mention of the days it takes to ship the order (meaning the specific lines that add both the shipping option name and the days it's going to take, like 1-3 days for GXG).

    I've looked at the page source for the pre-shopping cart on my site and haven't found anything usable, I've looked throughout the usps.php file, and I think the problem is that it gets the numbers directly from USPS... which is why I need someone with more knowledge of how the shipping options are pulled and then displayed to figure out how to just add some extra text.

    Any ideas?

  6. #6
    Join Date
    Apr 2009
    Posts
    36
    Plugin Contributions
    0

    Default Re: Adding Information to Shipping Methods Lines

    Quote Originally Posted by PeauProductions View Post
    Yes I know where the usps.php file is and have looked over it a ton but cannot find any mention of the days it takes to ship the order (meaning the specific lines that add both the shipping option name and the days it's going to take, like 1-3 days for GXG).

    I've looked at the page source for the pre-shopping cart on my site and haven't found anything usable, I've looked throughout the usps.php file, and I think the problem is that it gets the numbers directly from USPS... which is why I need someone with more knowledge of how the shipping options are pulled and then displayed to figure out how to just add some extra text.

    Any ideas?
    You are correct. This information does, indeed come from USPS (length of time for delivery) If you are seeking to add text after each line (Example: first class mail - can't easily tack on a tracking number, although you can do so when shipping via paypal, go figure!) , then I would say you would want to set up a language define (Suggest pick one of the language files related to shipping) and define your own language for it, and then in the code where the calculated shipping results are printed out (I forget where) , you can probably work in your defined language string into it somewhere..

    I believe the usps.php and ups.php both parse the returned xml data and populate the results into an array , so if you go to where this is done, and test for whatever case you wish, .. example
    Code:
    if(strpos($shipping_option,'First Class') !== false){echo MY_SHIP_DEFINE_NO_TRACKING;}else{echo MY_SHIP_DEFINE_TRACKING_PROVIDED;}
    or something like that, and if you need to know how to put in a language define, as mentioned, find a suitable language file, edit it and go to the bottom of the defines, and add:
    Code:
    define('MY_SHIP_DEFINE_NO_TRACKING','No Tracking provided');
    define('MY_SHIP_DEFINE_TRACKING_PROVIDED','Tracking Provided');
    Language defines such as that are recommended, since it makes it much easier to edit later on, and if you decide to remove them, no need to remove the code- instead, simply set the values to blank.

    Of course, the above is all from the top of my head, and not taken from the code- it is more "pseudo-code" to show the basic idea... I can't point you to what files or where in the files to make your edits, but to my knowledge, the above would probably be pretty close to the solution you may need.

  7. #7
    Join Date
    Jun 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Adding Information to Shipping Methods Lines

    Thanks for the help flatlanderoutfitters

    I've added the defines in the usps language file, but the main problem is finding where the results are populated in order to stick the echo in.

    If you know where I'd appreciate it. Getting closer to my goal I hope

  8. #8
    Join Date
    Apr 2009
    Posts
    36
    Plugin Contributions
    0

    Default Re: Adding Information to Shipping Methods Lines

    Quote Originally Posted by PeauProductions View Post
    Thanks for the help flatlanderoutfitters

    I've added the defines in the usps language file, but the main problem is finding where the results are populated in order to stick the echo in.

    If you know where I'd appreciate it. Getting closer to my goal I hope
    Found it.

    includes/modules/shipping/usps.php

    Around about line 553 or so (my file is modified, so line numbers may be a bit off)

    Code:
    if ($transit) {
    switch ($service) {
    case 'EXPRESS": $time = ///////line continues
     $time = $tregs[1];
    if($time =='' || $time == 'No Data') {
    $time = '1 - 2 '. MODULE_SHIPPING_USPS_TEXT_DAYS;
    }
    else { $time = 'Tomorrow by '.$time; 
    }
    //NOTE here is where we might add the added text 
    $time .= MY_EXTRA_TEXT_STRING; 
    break;
    That should be the start of where you need to set that stuff up , and just append your text define to the end of $time; for each case, just before the break; statement , I think that might do what you are looking to get, and you dont even need to do a test for what types, since it is already worked in to the switch () section

    hope that helps :)

  9. #9
    Join Date
    Jun 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Adding Information to Shipping Methods Lines

    Ok got it. So I see the lines for the EXPRESS, PRIORITY, PARCEL and FIRST CLASS, but I need it for international shipping options not so much domestic. I don't see the options for things like Express Mail International anywhere in the file.

    I've looked for the "MODULE_SHIPPING_USPS_TEXT_DAYS" but it's only used in the usps.php file. This section of code seems to simply change the amount of time for the shipping method, whereas I simply want to find out where to add text to the end of the array... I have a feeling if we add it here on the time, I'll get something like this:

    United States Postal Service (Priority Mail International (6 - 10 TRACKING NUMBER INCLUDED business days))

    instead of

    United States Postal Service (Priority Mail International (6 - 10 business days)) - TRACKING NUMBER INCLUDED

  10. #10
    Join Date
    Apr 2009
    Posts
    36
    Plugin Contributions
    0

    Default Re: Adding Information to Shipping Methods Lines

    Quote Originally Posted by PeauProductions View Post
    Ok got it. So I see the lines for the EXPRESS, PRIORITY, PARCEL and FIRST CLASS, but I need it for international shipping options not so much domestic. I don't see the options for things like Express Mail International anywhere in the file.

    I've looked for the "MODULE_SHIPPING_USPS_TEXT_DAYS" but it's only used in the usps.php file. This section of code seems to simply change the amount of time for the shipping method, whereas I simply want to find out where to add text to the end of the array... I have a feeling if we add it here on the time, I'll get something like this:

    United States Postal Service (Priority Mail International (6 - 10 TRACKING NUMBER INCLUDED business days))

    instead of

    United States Postal Service (Priority Mail International (6 - 10 business days)) - TRACKING NUMBER INCLUDED
    That's quite possible.. like I said, I have no real idea.. I'd take time to figure it out, but don't have time to do that.. Honestly, I don't see much point in adding that tracking is included, as these days, it almost invariably is provided.. As an alternative, you could simply note at the bottom (or the top) of the shipping quote section that tracking numbers are always provided where it is possible to do so. (which is what I would do, myself.. why make your server do more work than it has to, when a simple language define echoed out in a strategic location can cover all the bases, instead?)

    but I think somewhere within one of those files, you would probably find what you need.. but I'm not familiar enough with it to find that info quickly (I happened across the above code I located due to the fact that I'm trying to figure out a best method for an issue in my own store.., in between preparing my business location for a grand opening ceremony with local CofC, populating more products to my E-Store, and taking care of other business issues.. self-employment is an 80-hours a week job for really lousy wages!)

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Adding blank lines between listings
    By danaclaire in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 3 Sep 2011, 03:37 PM
  2. Adding to Enabled Shipping Methods
    By Shelia in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 6 Sep 2007, 12:21 AM
  3. Adding Additional Description to Shipping Methods
    By esugrue in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 8 Jun 2007, 04:30 AM
  4. Adding separation lines in category box?
    By serendipities in forum Basic Configuration
    Replies: 2
    Last Post: 11 Jul 2006, 09:56 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