Zen Cart Logo
Forums / General Questions / 'add to cart' without displaying product info

'add to cart' without displaying product info

Locked

Views: 3,189

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
23 Dec 2007, 8:38 AM
#1
johnv avatar

johnv

New Zenner

Join Date:
Oct 2007
Posts:
6
Plugin Contributions:
0

'add to cart' without displaying product info

Hi
I am showing individual 'add to cart' buttons in the product listing, and I allow multiples to be added. Now, if I click 'add to cart' zencart adds te items but then displays the product info page for that product. I would prefer to add to cart without having the product info page displayed, so users don't have to click out of the product info page just to get back to the product listing.

Is there an admin option that lets me add to cart without then displaying product info? If not what would php pages would I have to modify?

thanks
John.

23 Dec 2007, 10:55 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: 'add to cart' without displaying product info

Have you an URL where we can better see what you are describing?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Dec 2007, 9:02 PM
#3
johnv avatar

johnv

New Zenner

Join Date:
Oct 2007
Posts:
6
Plugin Contributions:
0

Re: 'add to cart' without displaying product info

Yes, the test site is
http://meatdirectonline.com.au/zendevel

I would like users to be able to add items to the cart, and stay on the product list page.

thanks
John

25 Dec 2007, 10:33 PM
#4
tshooters avatar

tshooters

Totally Zenned

Join Date:
Dec 2005
Posts:
1,037
Plugin Contributions:
2

Re: 'add to cart' without displaying product info

In Admin/Configuration/My Store, set Display Cart After Adding Product to false.

25 Dec 2007, 11:26 PM
#5
johnv avatar

johnv

New Zenner

Join Date:
Oct 2007
Posts:
6
Plugin Contributions:
0

Re: 'add to cart' without displaying product info

Hi Tshooters
It is already set to false. I would like to suppress the display of product info that follows after I press 'add to cart', so I don't have to press the 'back' button to see the product list again.

thanks
John

26 Dec 2007, 5:16 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: 'add to cart' without displaying product info

  1. Copy /includes/init_includes/init_cart_handler.php
    to /includes/init_includes/overrides/init_cart_handler.php
    (yes, "overrides/" is literal ... it means "overrides/", not a template name)

  2. Edit the new file (in the overrides folder)
    and replace this:if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid', 'main_page'); } else {with this:```
    if [B]($current_page_base == FILENAME_DEFAULT) {
    $goto = FILENAME_DEFAULT;
    $parameters = array('action', 'cPath', 'products_id', 'pid', 'main_page');
    } elseif [/B]
    (DISPLAY_CART == 'true') {
    $goto = FILENAME_SHOPPING_CART;
    $parameters = array('action', 'cPath', 'products_id', 'pid', 'main_page');
    } else {




On second thought, even this shouldn't be necessary, as the core code already does it.

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

10 Jan 2008, 6:42 AM
#7
juicevb10 avatar

juicevb10

New Zenner

Join Date:
Nov 2007
Posts:
30
Plugin Contributions:
0

Re: 'add to cart' without displaying product info

I tried this at cacaocouture.com/store and can't get it to work.

Do I need to delete the non-override version?

12 Jan 2008, 7:47 AM
#8
juicevb10 avatar

juicevb10

New Zenner

Join Date:
Nov 2007
Posts:
30
Plugin Contributions:
0

Re: 'add to cart' without displaying product info

This seems to make sense to me, so I don't know why it still goes to the listing when I try it.
Did this work for anyone?
Not work?

13 Jan 2008, 8:15 PM
#9
juicevb10 avatar

juicevb10

New Zenner

Join Date:
Nov 2007
Posts:
30
Plugin Contributions:
0

Re: 'add to cart' without displaying product info

OK, so it does work, but not for the category listings. At least not while using the grid layout plugin.

What would I have to change to get it to return to the category listing instead of going to the product info page?

19 Jan 2008, 3:42 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: 'add to cart' without displaying product info

juicevb10:

This seems to make sense to me, so I don't know why it still goes to the listing when I try it.
Did this work for anyone?
Not work?

Nope... not working for me either.
I did the over-ride as per Dr Byte's suggestion, then removed the original INIT file. I set the "Display Cart after Adding Product" to "false".

20 years a Zencart User