Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Bug Reports / checking out with 0 items in cart error

checking out with 0 items in cart error

Started by ebaobao on 6 Aug 2011, 10:14 PM · Views: 1,105

Results 1 to 5 of 5
6 Aug 2011, 10:14 PM
#1
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

checking out with 0 items in cart error

beta v1.5
I like to make my site with a view cart and checkout link constantly at the header whether user has any items or not in their cart or whether they are login or not. Currently when a user not login clicks on checkout if there are 0 items in cart it gives this message:

"Whoops! Your session has expired.
If you were placing an order, please login and your shopping cart will be restored. You may then go back to the checkout and complete your final purchases.

If you had completed an order and wish to review it, or had a download and wish to retrieve it, please go to your My Account page to view your order."

Now I know there is no checkout or view cart link displayed unless user has added an item to their cart. I have modify tpl_header.php to display those links regardless(in my opinion more user friendly). It should display the same message as when you click view cart with 0 items "Your Shopping Cart is empty" instead.

6 Aug 2011, 10:20 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: checking out with 0 items in cart error

I'm trying to duplicate the problem in my copy of 1.5.0beta.

When I am not logged in, and I have no items in my cart and go to https://www.mysite.com/index.php?main_page=shopping_cart it simply says "Your Shopping Cart is empty."

This is with a fresh clean install, no customizations.
What do I have to do to make mine work like yours?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Aug 2011, 10:42 PM
#3
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: checking out with 0 items in cart error

hi dr byte,
i don't know if this makes a difference, but i put this in tpl_header.php

<a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>

I just made a copy and moved it out of the session cart condition so that it would always display. Let me know if you still dont get the error. So far its a fresh install with one upgrade v072911 where i just replaced files. haven't played with anything besides stylesheet.css mainly

I just noticed that it says CHECKOUT_SHIPPING could that be it?
<a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>

6 Aug 2011, 10:52 PM
#4
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: checking out with 0 items in cart error

hi dr. byte,
what you did was view cart. i'm talking about checkout.

6 Aug 2011, 10:59 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: checking out with 0 items in cart error

ebaobao:

hi dr. byte,
what you did was view cart. i'm talking about checkout.
Hmmm ... Yes, I see.

Interestingly, the code that handles that hasn't changed since v1.3.8. What you're describing is not new to v1.5 -- it's been like that for years.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.