So I am back to trying to fix the Canada Post shipping module since the developer of it hasn't bothered.
I have come up with a desired fix, but I know it's not a correct way to fix it.
Being my coding skills suck, I am looking for a little help with it from anyone.
So the problem with it is that when there is no Postal Code at checkout, I kicks out an error:
So my temporary fix is to change the following:
to
I think the proper way to fix this is to have:
I think I am in the right direction, but thinking the issue is probably with the {} brackets.
So can someone help me out with the correct way to correct the above line?
Thanks for any help.
I have come up with a desired fix, but I know it's not a correct way to fix it.
Being my coding skills suck, I am looking for a little help with it from anyone.
So the problem with it is that when there is no Postal Code at checkout, I kicks out an error:
Error Server: /rs/ship/price: cvc-simple-type 1: element {http://www.canadapost.ca/ws/ship/rate-v2}postal-code of type {http://www.canadapost.ca/ws/ship/rate-v2}postalcodetype may not be empty
So my temporary fix is to change the following:
$ErrorDesc = $dom->getElementsByTagName('description')->item(0)->nodeValue;
to
$ErrorDesc = "Postal Code Required";
I think the proper way to fix this is to have:
$ErrorDesc = $dom->getElementsByTagName('description')->item(0)->nodeValue;
if ($ErrorDesc = "/rs/ship/price: cvc-simple-type 1: element {http://www.canadapost.ca/ws/ship/rate-v2}postal-code of type {http://www.canadapost.ca/ws/ship/rate-v2}postalcodetype may not be empty") {
$ErrorDesc = "Postal Code Required";
I think I am in the right direction, but thinking the issue is probably with the {} brackets.
So can someone help me out with the correct way to correct the above line?
Thanks for any help.
In Development
Share this post:
Accepted Answer
NVM. I figured it out. Misplaced a bracket.
$ErrorDesc = $dom->getElementsByTagName('description')->item(0)->nodeValue;
if ($ErrorDesc == '/rs/ship/price: cvc-simple-type 1: element {http://www.canadapost.ca/ws/ship/rate-v2}postal-code of type {http://www.canadapost.ca/ws/ship/rate-v2}postalcodetype may not be empty') {
$ErrorDesc = 'Postal Code Required';
}
Your Reply
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »