Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Empty Cart leads to 'New Products' page

Empty Cart leads to 'New Products' page

Locked

Started by subb on 24 Jun 2008, 9:25 PM · Views: 1,639

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
24 Jun 2008, 9:25 PM
#1
subb avatar

subb

New Zenner

Join Date:
Oct 2006
Posts:
26
Plugin Contributions:
0

Post #1 by subb

Hi

I am trying to change the destination that the browser is sent when you empty your cart fully.

Currently if i do that i am sent to a page displaying 'Your Shopping Cart is empty.' and 'New Products For June'

The URL looks like this:

index.php?main_page=shopping_cart&product_id=2

What i would like to do is be forwarded to the front page, but upon looking at tpl_shopping_cart_default.php i have no idea what to edit.

Anyone with some insight would be much apreciated!

Thanks in advance

25 Jun 2008, 4:09 AM
#2
drbyte avatar

drbyte

Sensei

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

Post #2 by drbyte

So, if the customer clicks on the shopping cart link, and the cart is empty, you don't want to tell them that their cart is empty? Instead you just want them to jump directly to the home page without any explanation of why? ... so they can keep clicking on the link and wondering why they're not seeing the shopping cart?

If you don't think that's going to confuse your shoppers then just add this to the end of /includes/modules/pages/shopping_cart/header_php.php to point them to the home page:```
if ($flagHasCartContents == false) {
zen_redirect(zen_href_link(FILENAME_DEFAULT));
}

.
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.

25 Jun 2008, 10:58 AM
#3
subb avatar

subb

New Zenner

Join Date:
Oct 2006
Posts:
26
Plugin Contributions:
0

Post #3 by subb

Thanks for the explanation Dr Byte!

Thing is, you are absolutely correct about confusing customers, but is there any way to customise the 'Your Shopping Cart is empty' page?

If I could add some more detail to that page, along with an image, say, and a meta refresh command it would make much more sense to use it...

Any ideas?

Thanks again!

25 Jun 2008, 6:27 PM
#4
drbyte avatar

drbyte

Sensei

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

Post #4 by drbyte

You can customize the wording of the "your cart is empty" text simply by editing that text in your language files.
https://www.zen-cart.com/tutorials/index.php?article=38
https://www.zen-cart.com/tutorials/index.php?article=39

As to adding a meta refresh, you could try this trick:

  • create a new file: /includes/modules/pages/shopping_cart/jscript_redirect_empty_cart.php
  • put this in the file:```
<?php if ($flagHasCartContents == false) { ?> <meta http-equiv="refresh" content="6;URL=<?php echo zen_href_link(FILENAME_DEFAULT); ?>"> <?php } ?> ```

.
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.

25 Jun 2008, 8:08 PM
#5
website_rob avatar

website_rob

Inactive

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

Post #5 by website_rob

You also might be interesting in the following.

Admin > Index Listing

Show New Products on Main Page - Errors and Missing Products Page
Show Featured Products on Main Page - Errors and Missing Products Page
Show Special Products on Main Page - Errors and Missing Products Page
Show Upcoming Products on Main Page - Errors and Missing Products Page

Set all of the above to '0' or whichever ones you do not want to show below "Shopping Cart is Empty" msg.

The learning is in the doing.

Potent Products

26 Jun 2008, 12:03 AM
#6
drbyte avatar

drbyte

Sensei

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

Post #6 by drbyte

Website Rob:

You also might be interesting in the following.

Admin > Index Listing

Show New Products on Main Page - Errors and Missing Products Page
Show Featured Products on Main Page - Errors and Missing Products Page
Show Special Products on Main Page - Errors and Missing Products Page
Show Upcoming Products on Main Page - Errors and Missing Products Page

Set all of the above to '0' or whichever ones you do not want to show below "Shopping Cart is Empty" msg.

Actually, those specific switches only apply to the "Index" page (hence the title "Index Listing").
There are similar switches in Admin->Configuration->Stock which affect the Shopping Cart page.

.
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.

26 Jun 2008, 1:26 AM
#7
subb avatar

subb

New Zenner

Join Date:
Oct 2006
Posts:
26
Plugin Contributions:
0

Post #7 by subb

Absolutely brilliant DrByte.

THANK YOU