Zen Cart Logo
Forums / Addon Shipping Modules / USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

Views: 6,084

Results 1 to 11 of 11
30 Oct 2014, 11:16 PM
#1
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

This is an USPS September 7, 2014 K6 update, currently for the Test Server Only ...

On November 2, 2014 USPS will be updating their Production Server for bugs currently on the Production Server. These updates should be working on the Test Server right now.

Please test this USPS September 7, 2014 K6 shipping module.

**NOTE: until the changes are live on the Production Server, some features may only work on the Test Server, such as First-Class Large Envelope.
**

31 Oct 2014, 9:45 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

No issues found, just a reminder that the readme.txt file for the K6 version still refers to the dates associated with the K5 version (September 7, 2014) in two places.

31 Oct 2014, 10:28 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

I had left that as:

  • USPS RateV4 Intl RateV2 - September 7, 2014 Version K6

As this is for the changes on September 7, but includes additions for a few other things including the change for the POODLE curl issue ...

I will debate that :)

5 Nov 2014, 11:59 PM
#4
kehrli avatar

kehrli

Zen Follower

Join Date:
Aug 2007
Location:
Cannon Beach, OR
Posts:
180
Plugin Contributions:
0

Re: USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

Works great. Got a minor issue and I can't find the code to fix it. Database is storing the shipping method in the orders table with "@reg;" and/or "@trade;". When this gets to Shipworks which I use for shipping, it prints out literally.

I used to always modify this line from the previous versions of the module:

$title = str_replace(array('RM', 'TM', '**'), array('®', '™', ''), $type_rebuilt);

and change it to

$title = str_replace(array('RM', 'TM', '**'), array('', '', ''), $type_rebuilt);

That worked great. But the latest version did away with that line of code, and now I don't know where to get my hands on the string that is going into the database as shipping_method.

Is there an easy way to get these symbols stripped?

Thanks.

6 Nov 2014, 12:07 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

Does the line on 564:

        $title = str_replace(array('RM', 'TM', '**'), array('®', '™', ''), $type_rebuilt);

do anything for you? :lookaroun

6 Nov 2014, 2:52 AM
#6
kehrli avatar

kehrli

Zen Follower

Join Date:
Aug 2007
Location:
Cannon Beach, OR
Posts:
180
Plugin Contributions:
0

Re: USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

No. I already changed that line. In previous versions changing this line handled the problem. But in this version, it isn't changing the variable that gets saved to the database. The special characters are still being saved to the orders table in the shipping_method field. I haven't been able to find out where shipping_method is getting it's string. Maybe in another module.

6 Nov 2014, 4:48 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

And if you add the code in **RED **around line 635:

$show_hiddenCost = '';

[B]$title = str_replace(array('RM', 'TM', '**'), array('', '', ''), $type_rebuilt);

[/B]          $methods[] = array('id' => $type_rebuilt,
6 Nov 2014, 11:16 AM
#8
kehrli avatar

kehrli

Zen Follower

Join Date:
Aug 2007
Location:
Cannon Beach, OR
Posts:
180
Plugin Contributions:
0

Re: USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

Yes, I have that exact line, exactly like that (the part in red).

However, the lines nearby that line are different in my file. Here's what I have:

       // COST        
      // clean out invalid characters        
      $cost = preg_replace('/[^0-9.]/', '',  $cost);
      //echo 'USPS $cost: ' . $cost . ' $handling: ' . $handling . ' $hiddenCost: ' . $hiddenCost . ' $shipping_num_boxes: ' . $shipping_num_boxes . ' $usps_handling_fee: ' . $usps_handling_fee . '<br>';        
      // add handling for shipping method costs for extra services applied        
      $cost = ($cost + $handling + $hiddenCost) * $shipping_num_boxes;        
      // add handling fee per Box or per Order        
      $cost += (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box') ? $usps_handling_fee * $shipping_num_boxes : $usps_handling_fee;
      
      // set the output title display name back to correct format        
      $title = str_replace(array('RM', 'TM', '**'), array('', '', ''), $type_rebuilt);
      //echo 'USPS title: ' . $title . '<br />';
      
      // process customization of transit times in quotes        
      if (in_array('Display transit time', explode(', ', MODULE_SHIPPING_USPS_OPTIONS))) {
        if ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY || 
             $this->usps_countries == 'US') {            
                if ($this->transitTimeCalculationMode != 'OLD') 
                   $this->parseDomesticTransitTimeResults($Package, $type_rebuilt);         
              } 
             else {            
             $this->parseIntlTransitTimeResults($Package, $type_rebuilt);          
         }        
      }

However, note the formatting isn't quite the same as the original. My mod includes the changes for 2 Nov 14. But the surrounding text is different from yours. Am I missing something.

6 Nov 2014, 1:40 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

That is not where I am suggesting you add that line, look at this piece of original code around line 633:

// switch comment marks to show $hiddenCost: from quote title
//$show_hiddenCost =  ' $hiddenCost: ' . $hiddenCost;
$show_hiddenCost = '';
          $methods[] = array('id' => $type_rebuilt,
                             'title' => $title . $show_hiddenCost,
                             'cost' => $cost,
                             'insurance' => $usps_insurance_charge,
                            );

Change that code to include the new line in RED:

// switch comment marks to show $hiddenCost: from quote title
//$show_hiddenCost =  ' $hiddenCost: ' . $hiddenCost;
$show_hiddenCost = '';

[B]        $title = str_replace(array('RM', 'TM', '**'), array('', '', ''), $type_rebuilt);
[/B]
          $methods[] = array('id' => $type_rebuilt,
                             'title' => $title . $show_hiddenCost,
                             'cost' => $cost,
                             'insurance' => $usps_insurance_charge,
                            );
6 Nov 2014, 10:05 PM
#10
kehrli avatar

kehrli

Zen Follower

Join Date:
Aug 2007
Location:
Cannon Beach, OR
Posts:
180
Plugin Contributions:
0

Re: USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

Ok. The light shines now. Thanks. That did it.

I had to think. I must not have been zenned yet.

7 Nov 2014, 3:06 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS RateV4 Intl RateV2 September 7, 2014 K6 for Test Server Only - November 2, 2014

Thanks for the update that this is now working for you ... :smile: