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.
Bookmarks