Is there a way to get USPS Parcel Select Rates? that I could use as they are available in Stamps.com.
I'm not sure if this API will pull those rates. You can look in the web tools API documentation for Rate Request V4 and see if the XML can be modified to pull those rates.BionicBill wrote:Is there a way to get USPS Parcel Select Rates? that I could use as they are available in Stamps.com.
https://www.usps.com/business/web-tools ... c423593286
The extension works great for the most part. The only issue we are having is with ship station...in ship station it doesn't send the shipping method. We only use USPS. It doesn't produce any errors in the error logs. We are using OpenCart version 1.5.6.1
I'm not familiar with the Ship Station extension. This mod is not written to integrate with any other extensions, although custom integration can be done for a fee.olwm wrote:The extension works great for the most part. The only issue we are having is with ship station...in ship station it doesn't send the shipping method. We only use USPS. It doesn't produce any errors in the error logs. We are using OpenCart version 1.5.6.1
1. As soon as I add this VQMod, the entire store breaks with this error:
When I remove theAPI update XML from the VQMod folder, the site behaves normally again. I downloaded the appropriate version of the mod for 1.5.5.1. I did a search through all my other VQMods for the files modified in this mod and didn't find any that also modified usps.* or cart.tpl.
2. OpenCart log - attached (note: I changed the home directory to ~ in all instances in the log to mask the admin username and site, and trimmed to just today's log for size considerations.)
3. VQMod log wasn't recently updated, so I didn't see any pertinent logs to include
4. OpenCart 1.5.5.1
Would appreciate your help in resolving this.
Update: I found that this error was fixed in a later version of VQMod (I was on 2.3.2), and upgrading to the latest VQMod fixed this issue. However, now that I'm able to use the store after installing this USPS API update, I'm finding that I'm still getting the same error as before the modification when trying to calculate USPS shipping costs to Canada:
I've attached an updated OpenCart error log file. As far I can tell, the VQMod log has not been modified at all in the past couple of weeks.
Code: Select all
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ~/vqmod/vqmod.php on line 329
2. OpenCart log - attached (note: I changed the home directory to ~ in all instances in the log to mask the admin username and site, and trimmed to just today's log for size considerations.)
3. VQMod log wasn't recently updated, so I didn't see any pertinent logs to include
4. OpenCart 1.5.5.1
Would appreciate your help in resolving this.
Update: I found that this error was fixed in a later version of VQMod (I was on 2.3.2), and upgrading to the latest VQMod fixed this issue. However, now that I'm able to use the store after installing this USPS API update, I'm finding that I'm still getting the same error as before the modification when trying to calculate USPS shipping costs to Canada:
Code: Select all
Notice: Trying to get property of non-object in ~/catalog/model/shipping/usps.php on line 425
Notice: Trying to get property of non-object in ~/catalog/model/shipping/usps.php on line 428
Attachments
OpenCart Error Log
Check the VQMod error logs at /VQMod/logs, and make sure that there aren't any conflicts that are aborting the mod. With a custom template, sometimes a particular search isn't found.
If you need help interpreting something in the logs, post them here.
If you need help interpreting something in the logs, post them here.
Apparently my FTP client wasn't refreshing the logs directory, so I was missing the new log (attached).JeffroDH wrote:Check the VQMod error logs at /VQMod/logs, and make sure that there aren't any conflicts that are aborting the mod. With a custom template, sometimes a particular search isn't found.
If you need help interpreting something in the logs, post them here.
Not seeing any indication of conflicts. Definitely getting search not found errors, but no custom templates to blame. Shouldn't be any modifications to the USPS files, either.
Attachments
VQMod log
Quick fix, find the line in the xml file that contains the line in the log, and compare it to a similar line in your USPS file.
You'll copy the line out of the USPS.php file and replace the text within the relevant <search></search> Tag.
You'll copy the line out of the USPS.php file and replace the text within the relevant <search></search> Tag.
Here's what I'm seeing in the USPS.php vs. the XML:JeffroDH wrote:Quick fix, find the line in the xml file that contains the line in the log, and compare it to a similar line in your USPS file.
You'll copy the line out of the USPS.php file and replace the text within the relevant <search></search> Tag.
In the XML:
Code: Select all
<operation>
<search position="replace" offset="1"><![CDATA[$result = str_replace('<sup>&reg;</sup>', '', $result);]]></search>
<add><![CDATA[$result = str_replace('<sup>®</sup>', '®', $result);
$result = str_replace('<sup>™</sup>', '™', $result);
$result = str_replace(' 1-Day', '', $result);
$result = str_replace(' 2-Day', '', $result);]]></add>
</operation>
Code: Select all
// strip reg, trade and ** out 01-02-2011
$result = str_replace('<sup>®</sup>', '', $result);
$result = str_replace('<sup>™</sup>', '', $result);
$result = str_replace('**', '', $result);
$result = str_replace("\r\n", '', $result);
$result = str_replace('\"', '"', $result);
Any thoughts?
Commenting out that whole operation seems to have worked, and Canada shipping is no longer generating an error. That being said, am I losing anything by not having the two remaining added lines that were part of that add operation?JeffroDH wrote:It looks like your USPS file has been modified to include the changes already present in the VQMod. You can simply delete that operation. If there are no further problems, you should see it begin to work appropriately.
Code: Select all
$result = str_replace(' 1-Day', '', $result);
$result = str_replace(' 2-Day', '', $result);]]></add>
Now that there isn't an operation that VQMod can't execute (the failed search), the extension isn't aborted, and the changes necessary for the Canada error are implemented. This particular operation had nothing to do with the problem, but it was preventing the rest of the code from executing.
VQMod only searches for single lines, so choose a line in that section, and copy/paste it in between the innermost brackets in the search tag, if you want to remove those. You can also choose to remove/replace any other string in the response using the same function. Essentially, you're searching the USPS response string ($result) for a string (' 1-Day', e.g.), replacing it with another string (or in this case, with an empty string).
In plain english, one of these lines would read:
Make the variable $result equal to the result of the function: Find the string ' 1-Day' and replace it with an empty string (delete it) if it is found within the variable $result.
For more details on how it works, check out the documentation on PHP.net.
Those were designed to eliminate the USPS generated delivery time estimates from the returned responses, because I and many of my customers found them to be inaccurate and confusing to customers. You can either add them directly to the usps.php file (underneath the existing str_replace statements), or create an operation in the VQMod that does it.That being said, am I losing anything by not having the two remaining added lines that were part of that add operation?
Code: Select all
<operation>
<search position="after"><![CDATA[]]></search>
<add><![CDATA[$result = str_replace(' 1-Day', '', $result);
$result = str_replace(' 2-Day', '', $result);]]></add>
</operation>
In plain english, one of these lines would read:
Make the variable $result equal to the result of the function: Find the string ' 1-Day' and replace it with an empty string (delete it) if it is found within the variable $result.
Code: Select all
str_replace(search(needle), replace, subject(haystack))
Re:
If I want the 1-Day , 2- Day back do I just change the above code to this?
Code: Select all
$result = str_replace(' 1-Day', '', $result);
$result = str_replace(' 2-Day', '', $result);]]></add>
Code: Select all
]]></add>
Has this update been released? I'd like to make sure I'm up-to-date before the 17th, but the latest update is still showing as November 2015.JeffroDH wrote:There is an upcoming update that will affect USPS users on January 17th, 2016. More detailed information can be found in the original post in this thread.
It has not been released, but will be available no later than this afternoon. Most of the changes are simply cosmetic in any case. Nothing should break in the event that I'm not able to get it done today.airhead3 wrote:Has this update been released? I'd like to make sure I'm up-to-date before the 17th, but the latest update is still showing as November 2015.JeffroDH wrote:There is an upcoming update that will affect USPS users on January 17th, 2016. More detailed information can be found in the original post in this thread.
I'm wondering if there's an order of operations problem with the vqmod. I'm getting the search error seen in the attached log file for:
and looking in the usps.php there's only:
Looking into which searches are involving <CommercialFlag>Y</CommercialFlag>, I find:
...and finally, later in the file:
Which appears to be changing the <CommercialFlag>N</CommercialFlag> into <CommercialFlag>Y</CommercialFlag>.
So, if that replacement later in the file is putting the <CommercialFlag>Y</CommercialFlag> into the usps.php file, is that why the searches earlier in the file aren't finding it?
Code: Select all
<CommercialFlag>Y</CommercialFlag>
Code: Select all
<CommercialFlag>N</CommercialFlag>
Code: Select all
<search position="before"><![CDATA[$xml .= ' <CommercialFlag>Y</CommercialFlag>';]]></search>
<add><![CDATA[ $xml .= ' <OriginZip>' . substr($this->config->get('usps_postcode'), 0, 5) . '</OriginZip>';]]></add>
</operation>
Code: Select all
<operation>
<search position="after"><![CDATA[$xml .= ' <CommercialFlag>Y</CommercialFlag>';]]></search>
<add><![CDATA[
if((strlen($postcode)) >= "1"){
$xml .= ' <AcceptanceDateTime>'.date('c').'</AcceptanceDateTime>';
$xml .= ' <DestinationPostalCode>' . $postcode . '</DestinationPostalCode>';
}]]></add>
</operation>
Code: Select all
<operation>
<search position="replace"><![CDATA[$xml .= ' <CommercialFlag>N</CommercialFlag>';]]></search>
<add><![CDATA[$xml .= ' <CommercialFlag>Y</CommercialFlag>';]]></add>
</operation>
So, if that replacement later in the file is putting the <CommercialFlag>Y</CommercialFlag> into the usps.php file, is that why the searches earlier in the file aren't finding it?
Attachments
Hello,
I had previously had your 2013 API update and it was working properly on my website. I went ahead and downloaded your new Jan API update and made sure my USPS.php files were stock and removed the old XML file.
At the moment I do not have anything listed in the shipping options, just blank white spaces where the services should be.
Attached is my error.txt file
Thanks
I had previously had your 2013 API update and it was working properly on my website. I went ahead and downloaded your new Jan API update and made sure my USPS.php files were stock and removed the old XML file.
At the moment I do not have anything listed in the shipping options, just blank white spaces where the services should be.
Attached is my error.txt file
Thanks
Attachments
Who is online
Users browsing this forum: No registered users and 6 guests