Can anyone tell me what has changed for the shipping modules? The current Canada Post Module is for 1.3.1 and I am hoping I can simply change a few things to get it to work with 1.4. I uploaded the files and it shows up but when you click install it still says disabled and when you hit edit it goes to a blank page.
Hopefully someone can help me with this.
I currently use OSC and was in the process of buidling a new OSC store but stumbled upon OpenCart and want to make the switch but my store is in Canada and I only use Canada Post for shipping.
Hopefully someone can help me with this.
I currently use OSC and was in the process of buidling a new OSC store but stumbled upon OpenCart and want to make the switch but my store is in Canada and I only use Canada Post for shipping.
Thanks, just uploaded the files but I am getting the following errors when I try to save info into the admin side of the module.
Code: Select all
Notice: Undefined index: canadapost_language in /home/trplscom/public_html/tougetuning/opencarttest/admin/controller/shipping/canadapost.php on line 222
Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at /home/trplscom/public_html/tougetuning/opencarttest/admin/index.php:59) in /home/trplscom/public_html/tougetuning/opencarttest/system/engine/controller.php on line 22
Removed all the files and then re-installed and still get the same error. I am no good with code so I am not sure what I am looking for. All I could find was that this sometimes happens when the words don't match exactly like "Canadapost_language" instead of "canadapost_language".
Here is what line 222 is
Here is what line 222 is
Code: Select all
221 //Set a default language immediately after install
222 if($this->request->post['canadapost_language'] == "") {
223 $this->request->post['canadapost_language'] = "en";
224 }
The error is an extremely simple one that means the variable isn't just equal to "", it isn't set at all. One way to fix line 222 is this:
Code: Select all
if(!isset($this->request->post['canadapost_language']) || $this->request->post['canadapost_language'] == "") {
I had to make some changes to get this to work properly, because it wasn't converting units (so if I had a product that weighed 90 grams, I got an error message "Error connecting to Canada Post" because it told CPC that my item weighed 90 kg, which is too heavy).
Changes to catalog/model/shipping/canadapost.php, around line 121:
Same file, around line 150 - need better error messages:
I know I really should properly parse the XML, but this was a quick and dirty fix to help me with the really ambiguous and misleading message "Error connecting to Canada Post" (it was actually connecting just fine).
Changes to admin/view/template/shipping/canadapost.tpl: There was a short open tag on line 220 causing some minor formatting issues. I changed it to "<?php"
Changes to catalog/model/shipping/canadapost.php, around line 121:
Code: Select all
$strXML .= " <weight>" . $this->weight->convert($result['weight'], $result['weight_class'], 'kg') . "</weight>\n";
$strXML .= " <length>" . $this->length->convert($result['length'], $result['length_class'], 'cm') . "</length>\n";
$strXML .= " <width>" . $this->length->convert($result['width'], $result['length_class'], 'cm') . "</width>\n";
$strXML .= " <height>" . $this->length->convert($result['height'], $result['length_class'], 'cm') . "</height>\n";
Code: Select all
} else{
preg_match( '~<error>.*<statusMessage>\s*(.*)\s*</statusMessage>.*</error>~s' , $resultXML, $matches);
$error_details = isset($matches[1]) ? ': '.$matches[1] : '';
$return_error = $this->language->get('text_returnerror').$error_details;
}
Changes to admin/view/template/shipping/canadapost.tpl: There was a short open tag on line 220 causing some minor formatting issues. I changed it to "<?php"
now updated to 1.7 for OpenCart 1.4.8 and 1.4.8b
http://www.opencart.com/index.php?route ... sion_id=78
http://www.opencart.com/index.php?route ... sion_id=78
VotreEspace Services Internet (Français)
VotreEspace Services Internet (english)
Hi, I'm having the same problem.
After clicking "continue" at the end of step 1 after entering personal details and address, at the top of the page of step 2, it says as follows...
Warning: fsockopen() [function.fsockopen]: unable to connect to sellonline.canadapost.ca:30000 (Connection timed out) in /home/*****/public_html/store/catalog/model/shipping/canadapost.php on line 185
Further down right below where it says "Canada Post" (under Shipping Method) it displays the following message in red text.
"Error connecting to Canada Post"
Now, most of my products are around 175 grams and dimensions are in cm, so I thought it was a matter of converting measurements. So, I tried what was previously suggested and replaced the following 4 lines of code in canadapost.php.
$strXML .= " <weight>" . $this->weight->convert($result['weight'], $result['weight_class'], 'kg') . "</weight>\n";
$strXML .= " <length>" . $this->length->convert($result['length'], $result['length_class'], 'cm') . "</length>\n";
$strXML .= " <width>" . $this->length->convert($result['width'], $result['length_class'], 'cm') . "</width>\n";
$strXML .= " <height>" . $this->length->convert($result['height'], $result['length_class'], 'cm') . "</height>\n";
Unfortunately, I'm still getting the exact same result. I should mention that I have registered for a sellonline account with Canada Post and my extension is configured with my Canada Post Merchant ID I received from them. Everything in my Canada Post sell online profile are default settings, I haven't changed/modified anything.
The following are my Canada Post Extension settings.
Status: Enabled
Canada Post Server: sellonline.canadapost.ca
Canada Post Port: 30000
Canada Post Merchant ID: MY_MERCHANT_ID
Origin Postal Code: MY_POSTAL_CODE
Handling Cost: 0.00
Turn Around Time (Hours): 0
Use Original Packaging For All Products: No
Tax Class: None
Geo Zone: All Zones
Sort Order: BLANK
Please help... Thanks.
After clicking "continue" at the end of step 1 after entering personal details and address, at the top of the page of step 2, it says as follows...
Warning: fsockopen() [function.fsockopen]: unable to connect to sellonline.canadapost.ca:30000 (Connection timed out) in /home/*****/public_html/store/catalog/model/shipping/canadapost.php on line 185
Further down right below where it says "Canada Post" (under Shipping Method) it displays the following message in red text.
"Error connecting to Canada Post"
Now, most of my products are around 175 grams and dimensions are in cm, so I thought it was a matter of converting measurements. So, I tried what was previously suggested and replaced the following 4 lines of code in canadapost.php.
$strXML .= " <weight>" . $this->weight->convert($result['weight'], $result['weight_class'], 'kg') . "</weight>\n";
$strXML .= " <length>" . $this->length->convert($result['length'], $result['length_class'], 'cm') . "</length>\n";
$strXML .= " <width>" . $this->length->convert($result['width'], $result['length_class'], 'cm') . "</width>\n";
$strXML .= " <height>" . $this->length->convert($result['height'], $result['length_class'], 'cm') . "</height>\n";
Unfortunately, I'm still getting the exact same result. I should mention that I have registered for a sellonline account with Canada Post and my extension is configured with my Canada Post Merchant ID I received from them. Everything in my Canada Post sell online profile are default settings, I haven't changed/modified anything.
The following are my Canada Post Extension settings.
Status: Enabled
Canada Post Server: sellonline.canadapost.ca
Canada Post Port: 30000
Canada Post Merchant ID: MY_MERCHANT_ID
Origin Postal Code: MY_POSTAL_CODE
Handling Cost: 0.00
Turn Around Time (Hours): 0
Use Original Packaging For All Products: No
Tax Class: None
Geo Zone: All Zones
Sort Order: BLANK
Please help... Thanks.

Hi Qphoria, thanks for the reply. I posted this issue and what you said about fsock on a forum of my webhost, and they said as follows.
"fsock isn't disabled, but opening arbitrary outgoing (and incoming) ports is... so in effect, you can't really use fsock.
The reason we disable it is because a lot of people write exploits using scripts that attack other servers' daemons running on arbitrary ports. "
If you know of any other way around this, please tell me. If not, I guess my only option is to change the module to use curl like you said. How sure are you that changing it to use curl will work? Do you forsee any other problems with this? Is there anything I should check with my webhost about before pursuing this?
If I have to do this, the other problem is I'm not familiar with curl, so I won't be able to do this myself. Can you point me somewhere or offer any advice on this situation?
Thanks again.
"fsock isn't disabled, but opening arbitrary outgoing (and incoming) ports is... so in effect, you can't really use fsock.
The reason we disable it is because a lot of people write exploits using scripts that attack other servers' daemons running on arbitrary ports. "
If you know of any other way around this, please tell me. If not, I guess my only option is to change the module to use curl like you said. How sure are you that changing it to use curl will work? Do you forsee any other problems with this? Is there anything I should check with my webhost about before pursuing this?
If I have to do this, the other problem is I'm not familiar with curl, so I won't be able to do this myself. Can you point me somewhere or offer any advice on this situation?
Thanks again.
Did anyone get this to work am still trying to to and keep getting the fsock error if someone was successful converting over to curl can you please let me know.
thanks
thanks
Thanks Qphoria, that goes to show you get more support on a paid service !! (lol at the fact that i maintain the free one, when I can!)
VotreEspace Services Internet (Français)
VotreEspace Services Internet (english)
Who is online
Users browsing this forum: No registered users and 5 guests