Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Upgrading Your Zen Cart / Upgrading to 1.5.x / upgrading to 1.5.4 and can't place product in cart

upgrading to 1.5.4 and can't place product in cart

Started by earmsby on 25 Jun 2015, 3:46 PM · Views: 4,591

Results 21 to 39 of 39
15 May 2017, 3:45 PM
#21
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Post #21 by earmsby

Website Rob:

So you have a URL using: www.mydomain.com/zc_store_upgrade/
Created a new blank database: estore_upgrd
Did a clean install of v1.5.5e db: estore_upgrd and installed the test database - no problems

Created a second new blank database: estore_upgrd2
Restored a back up made in step 6 into estore_upgrd2

Where did the database come from that you Imported? Is it your live site database or the test database?

The database that I restored into estore_upgrd2 was a copy of the live database. After I did that, I ran the database upgrade and there were no reported problems with that.

I did another experiment. I switched the database back to estore_upgrd (the clean install data). Then I changed the session directory to "/cache." When I did that the values gets changed somehow by the admin page to "complete/physical/pathto/store/cache" and is the same as the value I tried above in working with estore_upgrd2 (the upgraded, restored copy of the live db). I was testing whether the default database with this value would also fail to add to cart which might indicate a problem with the cache folder itself. But, I was able to add a product to the cart using the cache folder and the default data from the clean install so it doesn't seem that the cache folder is the cause of the problem.

I'm starting to think I should use the default database to move forward with the upgrade and then see if I can import the tables for products, customers, and orders in place of the default data from the clean install. I'm getting pretty desperate to move ahead on the upgrade and the hosting company is bugging me to get it finished so they can upgrade the php on the server.

Ellie Armsby

15 May 2017, 8:05 PM
#22
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Post #22 by website_rob

I would suggest that if you are going to upgrade then upgrade to the newest version.

Setup your test dir. (and password protect it to keep out prying eyes) and use the default database. If everything works fine then you know Zen Cart is installed correctly. If you then delete the test database, Import the live database, run the upgrade procedure and run into problems, you know the problem is with the live database and will just have to troubleshoot until corrected.

The learning is in the doing.

Potent Products

16 May 2017, 1:52 PM
#23
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #23 by carlwhat

ellie,

in:

includes/classes/shopping_cart.php

on around line 74, change the variable to TRUE as such:

 var $display_debug_messages = TRUE;

the try adding to the cart and lets see if any new messages come up. perhaps that would give a clue as to what is not working.

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

18 May 2017, 3:17 PM
#24
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Post #24 by earmsby

Website Rob:

I would suggest that if you are going to upgrade then upgrade to the newest version.

Setup your test dir. (and password protect it to keep out prying eyes) and use the default database. If everything works fine then you know Zen Cart is installed correctly. If you then delete the test database, Import the live database, run the upgrade procedure and run into problems, you know the problem is with the live database and will just have to troubleshoot until corrected.

Yes, that's exactly what I have done. The problem is with the "live" database (in quotes because it is a copy of the live store database).

Ellie Armsby

18 May 2017, 3:21 PM
#25
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Post #25 by earmsby

carlwhat:

ellie,

in:

includes/classes/shopping_cart.php

on around line 74, change the variable to TRUE as such:

var $display_debug_messages = TRUE;

> 
> the try adding to the cart and lets see if any new messages come up. perhaps that would give a clue as to what is not working.
> 
> best.

Ok, I tried that but no error messages are displayed either on the page or in the logs folder. I'll keep digging into it.

Ellie Armsby

18 May 2017, 3:33 PM
#26
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Post #26 by website_rob

earmsby:

Yes, that's exactly what I have done. The problem is with the "live" database (in quotes because it is a copy of the live store database).

Then I suggest you install the Report All Errors module. All files are new and you can turn it ON/OFF at will. Creates large error files in the "/logs" but should help to track down the problem. Another method is disable other modules you've installed, one by one to see if any changes. Start with whichever one affects Pricing or Shopping Cart or Checkout.

The learning is in the doing.

Potent Products

18 May 2017, 3:37 PM
#27
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #27 by carlwhat

Website Rob:

Then I suggest you install the Report All Errors module. All files are new and you can turn it ON/OFF at will. Creates large error files in the "/logs" but should help to track down the problem. Another method is disable other modules you've installed, one by one to see if any changes. Start with whichever one affects Pricing or Shopping Cart or Checkout.

i do not suggest this. i think the problem is with a setting and not with an error.... going down the wrong path in my opinion.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

18 May 2017, 3:43 PM
#28
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #28 by carlwhat

earmsby:

Ok, I tried that but no error messages are displayed either on the page or in the logs folder. I'll keep digging into it.

this is wrong. messages ARE getting displayed. see:

Attachment 17062

you are getting to line 1869 of:

includes/classes/shopping_cart.php

and then nothing is getting added...

you need to follow the logic from there.

on line 1954 is where the actual add to the cart happens.... you can add some logic right before there to see what the numbers are.

you are CLOSE!

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

18 May 2017, 3:52 PM
#29
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Post #29 by earmsby

I was just about to post that by adding error_log messages at various points in the shopping_cart class I've figured out that the quantity is getting adjusted to zero when adding. So I think it's not a session issue at all as originally thought. My next hunch is that there's a setting that is not allowing add to cart if the stock level is zero. This would explain why adding worked for the demo products but not the real products (which are always zero stock because the client does use this functionality).

Ellie Armsby

18 May 2017, 3:53 PM
#30
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Post #30 by website_rob

carlwhat:

this is wrong. messages ARE getting displayed. see:

Attachment 17062

you are getting to line 1869 of:

includes/classes/shopping_cart.php

and then nothing is getting added...

you need to follow the logic from there.

on line 1954 is where the actual add to the cart happens.... you can add some logic right before there to see what the numbers are.

you are CLOSE!

I don't recall seeing a link to the "test" site. Perhaps you have access others don't and thus, have more information to go on?

The learning is in the doing.

Potent Products

18 May 2017, 3:54 PM
#31
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Post #31 by earmsby

carlwhat:

this is wrong. messages ARE getting displayed. see:

Attachment 17062

How weird. I don't see that at all. What browser are you using?

Ellie Armsby

18 May 2017, 3:55 PM
#32
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #32 by carlwhat

add some stock for an item and see what happens...

it looks like this value is probably wrong:

STOCK_ALLOW_CHECKOUT

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

18 May 2017, 3:55 PM
#33
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #33 by carlwhat

earmsby:

How weird. I don't see that at all. What browser are you using?

chrome.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

18 May 2017, 3:58 PM
#34
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Post #34 by earmsby

carlwhat:

chrome.

Even weirder then. Me too. Oh well!

Ellie Armsby

18 May 2017, 3:59 PM
#35
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Post #35 by earmsby

carlwhat:

add some stock for an item and see what happens...

it looks like this value is probably wrong:

STOCK_ALLOW_CHECKOUT

Yup, that's exactly what I was going to try next. :)

Ellie Armsby

18 May 2017, 4:02 PM
#36
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #36 by carlwhat

earmsby:

Even weirder then. Me too. Oh well!

chrome Version 58.0.3029.110 (64-bit)

i would open the developer tools and see if you are getting any errors in the console. you could have a css issue or something else.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

18 May 2017, 4:06 PM
#37
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Post #37 by earmsby

earmsby:

Yup, that's exactly what I was going to try next. :)

HALLELUJAH! That was in fact the issue. I added 10 to the units in stock for a product and then tried putting it in the cart and it worked! Now to track down that value in the store config and change it (and take out all my error_log statements!)

Ellie Armsby

18 May 2017, 4:27 PM
#38
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Post #38 by earmsby

So, I found the value to change in Config > Stock. I changed "Allow Checkout" from false to true. In the live store which is on v.1.5.1 having the value equal to false works with check stock level and subtract level also equal to false. Perhaps in version 1.5.5e these are separated out or handled differently so that the value for "Allow Checkout" needs to be true even if the other two are false.

In any case, I'm now able to add to the cart and proceed with the rest of the upgrade process. I know that when I refresh the database before going live with the new version, I will need to change this value again as it will be overwritten by the value in the 1.5.1 live store.

The only weird thing now is that something I changed in the process of figuring out the solution to this issue has prevented anything from showing up in the who's online page in admin. It was working early this morning before I did a few things to try to pinpoint the cart problem, so hopefully I can back track and see what I did wrong.

Ellie Armsby

18 May 2017, 4:29 PM
#39
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Post #39 by earmsby

earmsby:

The only weird thing now is that something I changed in the process of figuring out the solution to this issue has prevented anything from showing up in the who's online page in admin. It was working early this morning before I did a few things to try to pinpoint the cart problem, so hopefully I can back track and see what I did wrong.

Doh! Of course, I'm the admin and the who's online page was excluding admin IPs. :blush: (as it does by default until I click to change that)

Ellie Armsby