Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auspost shipping estimate error #88

Closed
patrickgalbraith opened this issue Aug 21, 2012 · 2 comments
Closed

Auspost shipping estimate error #88

patrickgalbraith opened this issue Aug 21, 2012 · 2 comments

Comments

@patrickgalbraith
Copy link

I am occasionally getting this error when estimating shipping for Auspost:
Notice: Undefined offset: 1 in /catalog/model/shipping/auspost.php on line 79

The reason this is happening is that the response from Austpost sometimes contains an extra line break at the end. Which means that when list($key, $value) = explode('=', $part); is called on line 79 it fails since $part is empty.

To fix this I changed $parts = explode("\n", $response); to $parts = explode("\n", trim($response)); on line 36 and 76.

@opencart
Copy link
Collaborator

ok added to the next release. thx.

@bamzero
Copy link

bamzero commented Oct 1, 2012

Just a small follow up issue, on those same two lines we should really be exploding on "\r\n" otherwise all but the last parts end up with a \r still in them.

Not a huge issue but it breaks the html and causes a space if we want to add text to the results without spaces
(i.e. I have mine adding 1 day to the results so it shows 1-2 days rather than just the 1 day returned by auspost, but the newline will cause a space after the 1.)

savage4pro pushed a commit to savage4pro/opencart that referenced this issue Dec 7, 2015
догоняем оригинал
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants