Product Name Error - AA internal problem occurred
Product Name Error
'AA internal problem occurred. Please contact the Sell Online Customer service Desk at mailto:/[email protected]'
Product names can not be passed to Canada Post with markup ' or , special characters.
Quick fix - Method to drop apostrophe's.
replace line 162
$this->_addItem($products_array[$i]['quantity'], $products_array[$i]['final_price'], $products_array[$i]['weight'], $products_array[$i]['length'], $products_array[$i]['width'], $products_array[$i]['height'], $this->_xmlentities($products_array[$i]['model'] . "/" . $products_array[$i]['name']), $products_array[$i]['ready_to_ship'], $products_array[$i]['dim_type'], $products_array[$i]['weight_type']);
with this:
$twi_cleanPname = $products_array[$i]['name']; // Twitch fix Canada Post error 'AA internal problem occurred...'
$twi_cleanPname = preg_replace('/�*39;|\'/', '', $twi_cleanPname); // clean out apostrophe's
$this->_addItem($products_array[$i]['quantity'], $products_array[$i]['final_price'], $products_array[$i]['weight'], $products_array[$i]['length'], $products_array[$i]['width'], $products_array[$i]['height'], $this->_xmlentities($products_array[$i]['model'] . "/" . $twi_cleanPname /* $products_array[$i]['name'] */), $products_array[$i]['ready_to_ship'], $products_array[$i]['dim_type'], $products_array[$i]['weight_type']);
The Canada Post server will now interpret the data correctly and pass the rate quotes properly again :)
Redoc Note:
One could amend the _xmlentities or create a new function to clean other characters out in future versions.
Re: Product Name Error - AA internal problem occurred
LOL I just came here to report the same bug @Twitch reported above. In my case, the name had the symbol for inches (") in it, and that broke Canada Post. Same temporary work around - just remove.
Re: Product Name Error - AA internal problem occurred
I have a number of products with & and % in them, is there a workaround for those?
Tried playing with the code fix provided by Twitch but didn't work.
Any help is appeciated.
Re: Product Name Error - AA internal problem occurred
Quote:
Originally Posted by
Jugglez
I have a number of products with & and % in them, is there a workaround for those?
Tried playing with the code fix provided by Twitch but didn't work.
Any help is appeciated.
Please post Zen, PHP and SQL versions from your Admin > Tools > Server Version Info.
Re: Product Name Error - AA internal problem occurred
Quote:
Originally Posted by
twitchtoo
Please post Zen, PHP and SQL versions from your Admin > Tools > Server Version Info.
MySQL 5.7.29
PHP Version: 5.6.40
Zencart 1.5.3 (patched a couple years ago)
Canada Post special character error fix #2
If this...:
// $twi_cleanPname = preg_replace('/�*39;|\'/', '', $twi_cleanPname); // clean out apostrophe's
is replaced with this:
// $twi_cleanPname = preg_replace('/�*39;|\'/', '', $twi_cleanPname); // clean out apostrophe's
$twi_cleanPname = preg_replace('/[^A-Za-z0-9- ]/', '', $twi_cleanPname); // Remove any character that isn't A-Z, a-z, 0-9 including hyphen but not a whitespace
and it works... I could use a coffee ;)
https://twitchtoo.com/images/zen_for...rcent_fix2.JPG
Re: Canada Post special character error fix #2
Quote:
Originally Posted by
twitchtoo
If this...:
// $twi_cleanPname = preg_replace('/�*39;|\'/', '', $twi_cleanPname); // clean out apostrophe's
is replaced with this:
// $twi_cleanPname = preg_replace('/�*39;|\'/', '', $twi_cleanPname); // clean out apostrophe's
$twi_cleanPname = preg_replace('/[^A-Za-z0-9- ]/', '', $twi_cleanPname); // Remove any character that isn't A-Z, a-z, 0-9 including hyphen but not a whitespace
and it works... I could use a coffee ;)
Thanks ! Works like a charm now!
Donated to your coffee fund!
Canada Post Module for 1.56c
Canada Post Module is available for 1.56c and will be submitted to the forum shortly.
https://twitchtoo.com/images/zen_for...alled_156c.JPG
If my work has helped you today in any way - I appreciate your donations!
Re: Canada Post Module for 1.56c
Checking in - do you have an ETA on submitting the Canada Post updates?
Re: Canada Post Module for 1.56c
Looks like Monday June 15.
To clarify this update continues on the previous Canada Post SellOnline system.
Funding has not been established to code for their newer API tools at this time.
Re: Canada Post Module for 1.56c
What kind of funding is needed to create the new mod, since the old system is going to be retired.
Re: Canada Post Module for 1.56c
Quote:
Originally Posted by
thebeadyeye
What kind of funding is needed to create the new mod, since the old system is going to be retired.
Quote:
Originally Posted by
twitchtoo
Looks like Monday June 15.
To clarify this update continues on the previous Canada Post SellOnline system.
Funding has not been established to code for their newer API tools at this time.
thebeadyeye - This module took over a week to rework and test on no less than 3 hosts, 2 - 1.56c test sites and 4 - 1.56c live production sites. It was derived from a working 1.55f version (1 year of successful production use). And... took nearly a week to compile for two separate production releases - the public Zen Cart forum and the unreleased Twitch Base6 core.
I have submitted the public version 1.6.5 for review today! If anyone would like to donate to the cause to discuss funding the new API please email me directly or click the donate button on my homepage :bigups:
Re: Canada Post Module for 1.56c
Quote:
Originally Posted by
twitchtoo
thebeadyeye It was derived from a working 1.55f version (1 year of successful production use).
Where is the 1.5.5f version? I was waiting for the new version based on what is on the zen cart site, thinking it would be for 1.5.5 and up. If there is a version somewhere else, please tell me.
Re: Canada Post Module for 1.56c
Quote:
Originally Posted by
delia
Where is the 1.5.5f version? I was waiting for the new version based on what is on the zen cart site, thinking it would be for 1.5.5 and up. If there is a version somewhere else, please tell me.
The 1.55f version didn't get released publicly due to a lack of time and funding. Also the only reason the current 1.56c version isn't backwards compatible is because it ships installed into stock 1.56c files - the overall changes are minimal with this type of shipping module...
Option 1:
Copy all new live site and admin files directly into the same folder locations in 1.55f. The new files will work with 1.55f directly.
File compare core overwrite files:
classes/shopping_cart.php
includes/languages/YOUR_TEMPLATE/english.php
admin/includes/modules/all files within
Move only the Canada Post tracer changes. If you can't see them, it's easy to file compare a stock 1.56c file with those in this package to find what I've changed - then paste those changes into the same locations in the 1.55f files.
Option 2:
Email me directly for the unreleased 1.55f package... which is identical to option 1 only it's all done for you :)
(Donations appreciated)
Option 3:
Hire a fellow like me to install it or I can upgrade the site to 1.56c before the next php updates get rolled out:
https://www.php.net/supported-versions.php
:cheers:
Re: Canada Post Module for 1.56c
Quote:
Originally Posted by
twitchtoo
The 1.55f version didn't get released publicly due to a lack of time and funding. Also the only reason the current 1.56c version isn't backwards compatible is because it ships installed into stock 1.56c files - the overall changes are minimal with this type of shipping module...
Option 1:
Copy all
new live site and admin files directly into the same folder locations in 1.55f.
The new files will work with 1.55f directly.
File compare core overwrite files:
classes/shopping_cart.php
includes/languages/YOUR_TEMPLATE/english.php
admin/includes/modules/all files within
Move only the Canada Post tracer changes. If you can't see them, it's easy to file compare a stock 1.56c file with those in this package to find what I've changed - then paste those changes into the same locations in the 1.55f files.
Option 2:
Email me directly for the unreleased 1.55f package... which is identical to option 1 only it's all done for you :)
(Donations appreciated)
Option 3:
Hire a fellow like me to install it
or I can upgrade the site to 1.56c before the next php updates get rolled out:
https://www.php.net/supported-versions.php
:cheers:
Thanks, if my client decides to install a new version, I'll check back with you. What he has works now as far as I know.
Re: Canada Post Module for 1.56c
Hi, I am using ZC 1.5.5 and was running Canada post 1.6. out of nowhere it is no longer able to get quotes. error "internal" which when I dug deeper says unable to reach sever and I only see that when I change from $errno>0 to $errno>=0
PHP Code:
function _sendToHost($data)
{
$url = 'https://' . (MODULE_SHIPPING_CANADAPOST_CPCID == 'CPC_DEMO_XML' ? 'qa-' : '') . 'sellonline.canadapost.ca/sellonline/Rating';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
// curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Zen Cart merchant at ' . urlencode(HTTPS_SERVER));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
$errno = curl_errno($ch);
curl_close($ch);
if ($errno > 0) {
$response = '<?xml version="1.0" ?><eparcel><error><statusMessage>' . MODULE_SHIPPING_CANADAPOST_COMM_ERROR . ($errno != 0 ? '<br /><strong>' . $errno . ' ' . $error . '</strong>' : '') . '</statusMessage></error></eparcel>';
}
return $response;
}
I tried the updated version too 1.6.1 and still getting the same error.
I did try curl from terminal of that server "curl https://sellonline.canadapost.ca/sellonline/Rating" and I get method not allowed which is normal since I used et method.
Is anyone else experiencing this? not sure how to fix it.
Re: Canada Post Module for 1.56c
OK, I have done more digging and I seem to be getting error
Code:
0 ]> -50000 An internal problem occurred. Please contact the Sell Online Customer service Desk at mailto:/[email protected]
Will be checking with Canada Post
Re: Canada Post Module for 1.56c
Riomaha, Due to popular demand I have a public release available:
Twitch Canada Post Shipping Module - Sell Online Public Release
20a for 1.55f
August 9.2020
In Zen terms that's version 1.64 for Zen Cart 1.55f.
Email me and I can send you the module .zip and install instructions.
Re: Canada Post Module for 1.56c
Quote:
Originally Posted by
riomaha
OK, I have done more digging and I seem to be getting error
Code:
0 ]> -50000 An internal problem occurred. Please contact the Sell Online Customer service Desk at mailto:/[email protected]
Will be checking with Canada Post
I hope this helps others. If you wish to troubleshoot your Canada Post module. Trying using this test page to test your CPC_ code. Only change the CPC code on the page and submit it. If you are able to get rates, then your code is working. In my case, my CPC code isn't working.
Also if you want to ensure your module is working fine, Change the CPC code on your site to CPC_DEMO_XML and check your site. If you are getting rates, then your module is working.
Rio
Re: Canada Post Module for 1.56c
I'm presently upgrading my site to v1.5.7c. Is there any kind of news on any Canada Post shipping estimate plugin that is being worked on?