Post by SuperJuice » Sat Aug 15, 2009 11:46 am

I have just found I am able to re-produce the following bug in OpenCart v1.3.2. Appears to be an issue shipping when there is no available shipping method for the geo-zone of a user? -edit- I just found this also happens when I have Flat Rate and Free set to 'All Zones'.

How to re-create (can probably be re-created more easily, this is how I found the error):

1. Install a fresh copy of OpenCart v.1.3.2
2. Create a valid user account with a valid address (made the Address in Australia)
3. Make sure you are logged out and there is nothing in your cart
4. Add something to your cart when you are browsing (I used Laptop -> Macbook from the example)
5. Click 'Checkout'
6. Fill in the 'Returning Customer' box with the valid user account created in step 2. and click 'login'

Instead of being taken to the Shipping page you are taken to the Payment page and the following errors are displayed:
Notice: Undefined index: shipping_address_id in <basedir>/catalog/controller/checkout/payment.php on line 35
Warning: fopen(<basedir>/system/logs/error.txt) [function.fopen]: failed to open stream: Permission denied in <basedir>/system/library/logger.php on line 12

Warning: fwrite(): supplied argument is not a valid stream resource in <basedir>/system/library/logger.php on line 14

Warning: fclose(): supplied argument is not a valid stream resource in <basedir>/system/library/logger.php on line 16
The first one is the error I am concerned about. The subsequent errors should probably be addressed by checking a blank error.txt is created in the installer, and confirm it is writable at installation time?

Active Member

Posts

Joined
Thu Aug 13, 2009 12:06 pm

Post by SuperJuice » Sat Aug 15, 2009 6:44 pm

Ok.

I can only replicate this when selecting 'MacBook' (Product 16). If I select the Apple Cinema Display 30" (Product 15) the checkout process works fine.

Something must be wrong with the 'MacBook' product that causes the checkout to break.. very odd ???

Can someone else replicate it using the steps above?

-edit -

I FOUND IT!

If you follow the above steps with any product that has "Requires Shipping:" set to "No" it will cause the cart to break. Because it is trying to skip the postage step, the address isn't being initialised correctly for the payment step.

Active Member

Posts

Joined
Thu Aug 13, 2009 12:06 pm

Post by Daniel » Sat Aug 15, 2009 7:13 pm

i'ml fix this.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by Daniel » Sat Aug 15, 2009 7:15 pm

super juice you need to delete your error.log and let the system create a new one with the correct permissions.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by SuperJuice » Sat Aug 15, 2009 7:17 pm

Can you remove the error.log from the package so it is created on the first error generated by the cart, and won't have the problems of being unzipped with incorrect perms?
Last edited by SuperJuice on Sat Aug 15, 2009 7:21 pm, edited 1 time in total.

Active Member

Posts

Joined
Thu Aug 13, 2009 12:06 pm

Post by Daniel » Sat Aug 15, 2009 7:18 pm

ok i just uploaded another version with the fix in.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by SuperJuice » Sat Aug 15, 2009 7:26 pm

Thanks.

Also need to think of a way to protect error.txt (be it .htaccess.. or perhaps have a table in the DB, and only dump to file as a last resort when you can't get to the DB?)

Someone could potentially go to <opencarturl>/system/logs/error.txt and have quite detailed information revealed to them.

Active Member

Posts

Joined
Thu Aug 13, 2009 12:06 pm

Post by wal_j » Sat Aug 15, 2009 7:30 pm

Daniel,

You say you have just uploaded a fix for this. Would it not be better, if the Version Number is not changing, to start a Patch download page that only incorporates the changed files.

This way, we, the users, dont have to do a full reinstall of OpenCart, or search out what you have changed in the package?

Just a suggestion !!
Alex

New member

Posts

Joined
Tue May 12, 2009 11:51 pm

Post by SuperJuice » Sat Aug 15, 2009 7:40 pm

wal_j wrote:Daniel,

You say you have just uploaded a fix for this. Would it not be better, if the Version Number is not changing, to start a Patch download page that only incorporates the changed files.

This way, we, the users, dont have to do a full reinstall of OpenCart, or search out what you have changed in the package?

Just a suggestion !!
Alex
Would have to agree. I've called this version 1.3.2.1 on my dev box.

As far as I am aware the only changes were the above bug, and error.txt was removed from the zip. But I have no idea what other changes Daniel may have done in his build before zipping it.

I just deployed it on my dev box and it all worked correctly, thanks for that Daniel.

Completely understand your concern wal_j and would like to see a changelog included in each release if possible too just so I know if it is going to impact any modules i'm writng etc.

I just found a bug in the installer too, which I will post in it's own thread.

Active Member

Posts

Joined
Thu Aug 13, 2009 12:06 pm

Post by Daniel » Sat Aug 15, 2009 7:49 pm

your right. I could do with a alert mail system to let people know when a minor update is released.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by SuperJuice » Sat Aug 15, 2009 7:50 pm

wal_j

Think this password fix also went into this update:
http://forum.opencart.com/viewtopic.php ... 6&start=15

Active Member

Posts

Joined
Thu Aug 13, 2009 12:06 pm

Post by eka7a » Sun Aug 23, 2009 12:32 pm

Notice: Undefined index: shipping_address_id in C:\wamp\www\opencart\catalog\controller\checkout\payment.php on line 35

catalog/controller/checkout/payment.php --- 35 line

Find:

Code: Select all

$this->session->data['payment_address_id'] = $this->session->data['shipping_address_id'];
Replace:

Code: Select all

$this->session->data['payment_address_id'] = $this->session->data['shipping_address_id'] = 0;
Daniel, I hope that is true ::)

SSL Certificates


User avatar
Active Member

Posts

Joined
Sun Apr 12, 2009 12:59 am
Location - Türkiye

Post by dani » Sat Sep 19, 2009 12:00 am

eka7a wrote:Notice: Undefined index: shipping_address_id in C:\wamp\www\opencart\catalog\controller\checkout\payment.php on line 35

catalog/controller/checkout/payment.php --- 35 line

Find:

Code: Select all

$this->session->data['payment_address_id'] = $this->session->data['shipping_address_id'];
Replace:

Code: Select all

$this->session->data['payment_address_id'] = $this->session->data['shipping_address_id'] = 0;
Daniel, I hope that is true ::)
I think It's better this:

catalog/controller/checkout/payment.php --> Add about line 33

Code: Select all

if (!isset($this->session->data['shipping_address_id'])) {
			$this->session->data['shipping_address_id'] = 0;
		}

Newbie

Posts

Joined
Thu Sep 17, 2009 7:10 pm
Who is online

Users browsing this forum: No registered users and 10 guests