Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 64
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Conditional shipping option?

    To change the USPS shipping module to show for ALL of the Ship To US and filter on the FedEx conditions, change the IF to read:
    Code:
    if ($this->usps_countries == 'US' || preg_match('#Priority Mail International#i', $type_rebuilt) && $_SESSION['usps_first_class'] > 40) {
    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: v1.5.5]
    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!

  2. #12
    Join Date
    May 2010
    Location
    Texas
    Posts
    491
    Plugin Contributions
    0

    Default Re: Conditional shipping option?

    Quote Originally Posted by Ajeh View Post
    To change the USPS shipping module to show for ALL of the Ship To US and filter on the FedEx conditions, change the IF to read:
    Code:
    if ($this->usps_countries == 'US' || preg_match('#Priority Mail International#i', $type_rebuilt) && $_SESSION['usps_first_class'] > 40) {

    Ajeh,

    I replaced the if statement in usps.php with the statement above and the USPS First Class is never displayed and no error is displayed.

    Also, in the fedexwebservices.php, there is an extra } after the added code.

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

    Default Re: Conditional shipping option?

    I think I mis-understood you on what your were saying on Priority ...

    If you want USPS International First Class only when FedEx is > 40.00 and for Domestic to show all USPS that you have selected, then use:
    Code:
    if ($this->usps_countries == 'US' || (preg_match('#(first-class)#i', $type_rebuilt) && $_SESSION['usps_first_class'] > 40)) {
    I am not understanding what you are saying about the extra } in the FedEx code ...
    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: v1.5.5]
    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!

  4. #14
    Join Date
    May 2010
    Location
    Texas
    Posts
    491
    Plugin Contributions
    0

    Default Re: Conditional shipping option?

    It seems to be working now. Thanks for hanging on with me here.

    On the other issue:

    the message for USPS is:
    United States Postal Service (First-Class Package International Service™)

    How can I change this to:
    United States Postal Service (First-Class 7-20 days)

    Can a hyperlink be inserted into that text?
    I just want a fixed text string as shown. The USPS international estimation is never right, since once it leaves the US, it takes on a whole new schedule governed by the destination country

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

    Default Re: Conditional shipping option?

    If you have the days set to Custom, you can set your own number of days for it on the First Class ...
    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: v1.5.5]
    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!

  6. #16
    Join Date
    May 2010
    Location
    Texas
    Posts
    491
    Plugin Contributions
    0

    Default Re: Conditional shipping option?

    Quote Originally Posted by Ajeh View Post
    You could use the CUSTOM setting:


    and show the days by turning on the:


    Then, in the function parseIntlTransitTimeResults($Package, $service) you will see where the days can be customized ...
    Oddly enough it is already set to Custom and the "Display Transit time" is checked.
    I searched and found the function mentioned in the usps.php file. But it was not obvious how to customize it.

    Code:
    function parseIntlTransitTimeResults($Package, $service) {
        global $logfilename;
        if (MODULE_SHIPPING_USPS_DEBUG_MODE == 'Logs') {
          $fp = @fopen($logfilename, 'a');
        }
        if (isset($this->transittime[$service]) && $this->transittime[$service] == '' && preg_match('#(GXG|International)#i' , $service)) {
          $time = $Package['SvcCommitments'];
          $time = preg_replace('/Weeks$/', MODULE_SHIPPING_USPS_TEXT_WEEKS, $time);
          $time = preg_replace('/Days$/', MODULE_SHIPPING_USPS_TEXT_DAYS, $time);
          $time = preg_replace('/Day$/', MODULE_SHIPPING_USPS_TEXT_DAY, $time);
          $this->transittime[$service] = $time == '' ? '' : ' (' . $time . ')';
        }
        // do logging if the file was opened earlier by the config switch
        if ($fp) {
          fwrite($fp, date('M d Y G:i:s') . ' -- Transit Time (Intl)' . "\nService:                    " . $service . "\nSvcCommitments (from USPS): " . $Package['SvcCommitments'] . "\n" . '$time (calculated):         ' . $time . "\nTranslation:               " . $this->transittime[$service] . "\n\n");
          fclose($fp);
        }
      }
    What is odd, is that the Priority mail transit time is shown, but the first class is not shown.
    Last edited by split63; 4 Nov 2013 at 04:25 AM.

  7. #17
    Join Date
    May 2010
    Location
    Texas
    Posts
    491
    Plugin Contributions
    0

    Default Re: Conditional shipping option?

    Found this section. It does not seem to differentiate between Domestic and International.
    First Class International shows no estimate.

    Code:
          /********************* CUSTOM START:  IF YOU HAVE CUSTOM TRANSIT TIMES ENTER THEM HERE ***************/
          switch (TRUE) {
            case (preg_match('#Priority Mail Express#i', $service)):
                $time = '1 - 2 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
              break;
            case (preg_match('#Priority MailTM#i', $service)):
                $time = '2 - 3 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
              break;
            case (preg_match('#Standard PostRM#i', $service)):
                $time = '4 - 7 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
              break;
            case (preg_match('#First\-Class#i', $service)):
              $time = '2 - 5 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
              break;
            case (preg_match('#Media MailRM#i', $service)):
            default:
              $time = '';
          /********************* CUSTOM END:  IF YOU HAVE CUSTOM TRANSIT TIMES ENTER THEM HERE ***************/

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

    Default Re: Conditional shipping option?

    You might look for the International function for the displayed days:
    function parseIntlTransitTimeResults($Package, $service) {
    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: v1.5.5]
    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!

  9. #19
    Join Date
    May 2010
    Location
    Texas
    Posts
    491
    Plugin Contributions
    0

    Default Re: Conditional shipping option?

    I could be wrong, but maybe the problem is that there is no international equivalent of the custom replacement above.

    The closest thing I could find is this, and I'm at a loss to understand what this even does.

    Code:
        if (isset($this->transittime[$service]) && $this->transittime[$service] == '' && preg_match('#(GXG|International)#i' , $service)) {
          $time = $Package['SvcCommitments'];
          $time = preg_replace('/Weeks$/', MODULE_SHIPPING_USPS_TEXT_WEEKS, $time);
          $time = preg_replace('/Days$/', MODULE_SHIPPING_USPS_TEXT_DAYS, $time);
          $time = preg_replace('/Day$/', MODULE_SHIPPING_USPS_TEXT_DAY, $time);
          $this->transittime[$service] = $time == '' ? '' : ' (' . $time . ')';
        }

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

    Default Re: Conditional shipping option?

    And if you just add the text in RED what happens:
    Code:
          switch (TRUE) {
            /********************* CUSTOM START:  IF YOU HAVE CUSTOM TRANSIT TIMES ENTER THEM HERE ***************/
            case (preg_match('#Priority Mail Express#i', $service)):
              $time = '3 - 5 business ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
              break;
            case (preg_match('#Priority Mail#i', $service)):
              $time = '6 - 10 business ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
              break;
            case (preg_match('#Global Express Guaranteed#i', $service)):
              $time = '1 - 3 business ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
              break;
            case (preg_match('#USPS GXG.* Envelopes#i', $service)):
              $time = '1 - 3 business ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
              break;
            case (preg_match('#First\-Class#i', $service)):
              $time = 'Varies by destination 7-12 days'; // '' . MODULE_SHIPPING_USPS_TEXT_DAYS;
              break;
            default:
              $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: v1.5.5]
    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!

 

 
Page 2 of 7 FirstFirst 1234 ... LastLast

Similar Threads

  1. v139h conditional shipping modules
    By bigduffeye in forum Addon Shipping Modules
    Replies: 11
    Last Post: 12 Feb 2013, 05:49 PM
  2. v139h Free shipping option, disable one other shipping option
    By stylenote in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 21 Jul 2012, 09:56 PM
  3. conditional based attributes to calc shipping?
    By shewhorn in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 16 Feb 2010, 03:18 AM
  4. Shipping option only shows as free shipping - i want all options
    By RomanSon3625 in forum Addon Shipping Modules
    Replies: 8
    Last Post: 14 Nov 2007, 04:13 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