Post by SRD » Fri Oct 19, 2012 8:26 pm

On this website, during checkout, step 4: delivery, I receive the following errors:
Notice: Undefined offset: 1 in /catalog/model/shipping/auspost.php on line 39
Notice: Undefined offset: 1 in /catalog/model/shipping/auspost.php on line 79
Lines 38,39;78,79 of auspost.php:

Code: Select all

				foreach ($parts as $part) {
					list($key, $value) = explode('=', $part);

				foreach ($parts as $part) {
					list($key, $value) = explode('=', $part);
Here is the full auspost.php

I am pretty sure this is the default AusPost postage provider which came with OpenCart.

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm

Post by Avvici » Sun Oct 21, 2012 6:36 am

Arrays are often serialized so that they can be stored in a database text field. If you change the data within a serialized array, without changing the character count, you will get the error above.
For example take this code:

Code: Select all

<?php
$thing = array('one','two');
echo serialize($thing);
?>
This will echo out the following: a:2:{i:0;s:3:”one”;i:1;s:3:”two”;}
Now… if you stored that in a database, you could then retrieve it later and unserialize() it to get your array back. wohoo!

In that serialized data, s:3:”one” means that the first element in the array is a string, and that it’s 3 characters long. Now.. if you manually changed “one” to “otherone” like this a:2:{i:0;s:3:”otherone”;i:1;s:3:”two”;} then when you ran it through unserialize() to retrieve your array, you would get the error were talking about.

Fix: To correct this you would need to update the string length also like so: a:2:{i:0;s:8:”otherone”;i:1;s:3:”two”;} because “otherone” is actually 8 characters long.

Point is, the string in the field is malformed;) It needs to replaced.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by SRD » Sun Oct 21, 2012 9:55 am

Hi avvici

Thank you for your insight. I understand the theory, but I am not a programmer, and I don't understand what needs to happen to fix the file.

The file is the default which came with OpenCart. I might raise a bug report...

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm

Post by Avvici » Sun Oct 21, 2012 11:35 am

No, it's not a bug. Yes you are using the default open cart but you have a custom shipping extension that is causing the error. Bug report won' t help. I don't mind looking at the code for you. Just PM me the control file.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by SRD » Sun Oct 21, 2012 12:06 pm

Thanks.

The control file is here.

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm

Post by SRD » Sun Oct 21, 2012 4:38 pm

Australia Post is not a custom shipping method; it came with the default installation of OpenCart.

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm

Post by Avvici » Mon Oct 22, 2012 2:27 am

That is the model. I need the controller.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by philbydevil » Mon Oct 22, 2012 12:53 pm

I would highly recommend ditching the default Australia Post extension and installing this one:
http://forum.opencart.com/viewtopic.php?f=119&t=5638

It has many more options than the default one...

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by SRD » Mon Oct 22, 2012 6:30 pm

I've PM'd you the controler avvici

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm

Post by SRD » Mon Oct 22, 2012 6:32 pm

Thanks philbydevil. I'm using OC 1.5.4, and the max version that extension is compatible with is 1.5.2...

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm

Post by philbydevil » Mon Oct 22, 2012 6:54 pm

I run 1.5.4.1 and it works fine. Read the last few pages of the thread as some people have reported issues with weights/dimensions/split shipping but I haven't had any problems.

Give it a try, it's got a lot more options...

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Mon Oct 22, 2012 7:03 pm

PS - I think the default and other extension have the same filenames so you might have to rename one set

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by SRD » Mon Oct 22, 2012 7:20 pm

Thanks. I've deleted the old AusPost, and uploaded the new one. I've enabled the Shipping module, and enabled some of the postage options, but in checkout, when I get to the step of selecting the shipping, I receive "Warning: No Shipping options are available. Please contact us for assistance!"

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm

Post by SRD » Mon Oct 22, 2012 7:25 pm

Here's the shipping screen, and the top of the AusPost screen:

Image

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm

Post by philbydevil » Mon Oct 22, 2012 7:53 pm

I think there's an extra "global" enable/disable towards the bottom

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by SRD » Mon Oct 22, 2012 8:03 pm

Yep, Status is set to Enabled.

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm

Post by philbydevil » Mon Oct 22, 2012 8:13 pm

Are the geo zones set up correctly?

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by SRD » Tue Oct 23, 2012 8:02 pm

Geo Zones is set to All Zones in the AusPost module settings.

Is there another location they should be set?

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm

Post by philbydevil » Tue Oct 23, 2012 8:18 pm

So Geo Zones should be set to All Zones if you want to use Australia Post to ship to all geo zones that you have set up.

But then double-check that the actual Geo Zones (System->Localization->Geo Zones) are set up correctly and include the country/countries you want to ship to.

So, I have two Geo Zones - Australia and International. Obviously, Australia just has Australia. International includes all of the other countries I sell to. Lets me choose different shipping/payment methods for the two zones.

And you did replace all of the Aus Post module files (both catalog and admin)?

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by SRD » Tue Oct 23, 2012 8:34 pm

So the 2 existing Geo zones were UK Shipping & UK VAT Zone.

I added a zone called Australia, and added the country Australia to this zone.

I still receive "Warning: No Shipping options are available. Please contact us for assistance!".

Yes, I replaced both catalog and admin files...

SRD
New member

Posts

Joined
Sun Sep 11, 2011 4:39 pm
Who is online

Users browsing this forum: No registered users and 64 guests