Forums / General Questions / Stay on Product listing when adding to cart

Stay on Product listing when adding to cart

Locked

Views: 2,563

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
30 Jul 2007, 12:30 PM
#1
longstockings avatar

longstockings

Zen Follower

Join Date:
Jul 2004
Posts:
198
Plugin Contributions:
0

Stay on Product listing when adding to cart

I need a hack in order to keep the customer on the product listing page when they add a product to their cart.
I'm showing add to cart buttons with quantity boxes and my admin settings are all correct yet on 1 shop this works fine and a newer cart it doesn't.

I've tried copying files from the one that works to the one that does not but to no avail.

Everytime I click add to cart I get redirected to the product info page for that product. These are not my shops and I have only recently taken them over so I don't really know what has been hacked at already.

What do I change on the product_listing.php module in order for it to keep customers on this page even when adding a product to their cart ?

The site uses the column display mod but behaves the smae way whether turned on or off.

Thanks

UK based Zen Cart Web Designer here https://www.handcoded.co.uk

30 Jul 2007, 3:14 PM
#2
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Re: Stay on Product listing when adding to cart

You don't need a hack, you just need to turn it on.

Go to Admin>configuration>Display Cart After Adding Product> Set this to false

hope that helps

18 Jan 2008, 12:18 AM
#3
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Stay on Product listing when adding to cart

I know this is an old post, however, I am also interested in this and would prefer to have the categorypage reload after adding an item to the cart. If you add to cart from the "All Products" page, it redirects back to the All Products page. I am hoping someone can tell me how to have the product listing page redirect back to the category (product listing) and page they added the item to the cart from.
Any info is greatly appreciated and if I didn't search well enough and this has been answered, I apologize.
Marg

19 Jan 2008, 2:19 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Stay on Product listing when adding to cart

Me too, MARG...

Anyone out there know how to do this... ?

I also need to keep my customers on the product listing page currently being visited.

20 years a Zencart User

19 Jan 2008, 4:12 PM
#5
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Stay on Product listing when adding to cart

Schoolboy - Which version of the cart are you using? I have it working for 1.3.7 and 1.3.8a with show cart after add to cart turned off.

These are a few variables in there like with and without quantity attributes "more info" line.
Let me know and I'll write what I changed
Marg

28 Jan 2008, 4:23 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Stay on Product listing when adding to cart

Marg:

Schoolboy - Which version of the cart are you using? I have it working for 1.3.7 and 1.3.8a with show cart after add to cart turned off.

These are a few variables in there like with and without quantity attributes "more info" line.
Let me know and I'll write what I changed
Marg

I'm using 1.3.7 and 1.3.8 (for different shops).

20 years a Zencart User

28 Jan 2008, 4:37 PM
#7
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Stay on Product listing when adding to cart

On 1.3.8
I have the add to cart button showing so the line I changed is:
$lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
(Line 140)
I changed it to:
$lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';

The change is changing the zen_get_info_page($listing->fields['products_id'] - this tells the cart to go to the product page. I changed it ot tell it to go to the mainpage with the parameter, which is product_listing etc.
Let me know if this works for you..
Marg

28 Jan 2008, 5:33 PM
#8
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Stay on Product listing when adding to cart

Sorry Marg

What php file are you referring to?

20 years a Zencart User

28 Jan 2008, 6:06 PM
#9
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Stay on Product listing when adding to cart

Jeez...
I hate when I do that!! includes/modules/product_listing.php OR includes/modules/YOUR_TEMPLATE/product_listing.php
Sorry...
Marg

28 Jan 2008, 6:47 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Stay on Product listing when adding to cart

I applied the change, but it does not keep me on the listing page - I now go to the main (home) page after adding to cart...

See it here

20 years a Zencart User