Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2004
    Posts
    246
    Plugin Contributions
    0

    Default 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 www.handcoded.co.uk

  2. #2
    Join Date
    Apr 2007
    Posts
    182
    Plugin Contributions
    0

    Default 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

  3. #3
    Join Date
    Mar 2004
    Posts
    688
    Plugin Contributions
    0

    Default 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

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default 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.
    Last edited by schoolboy; 19 Jan 2008 at 03:22 PM. Reason: more text added
    20 years a Zencart User

  5. #5
    Join Date
    Mar 2004
    Posts
    688
    Plugin Contributions
    0

    Default 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

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Stay on Product listing when adding to cart

    Quote Originally Posted by Marg View Post
    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

  7. #7
    Join Date
    Mar 2004
    Posts
    688
    Plugin Contributions
    0

    Default 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

  8. #8
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Stay on Product listing when adding to cart

    Sorry Marg

    What php file are you referring to?
    20 years a Zencart User

  9. #9
    Join Date
    Mar 2004
    Posts
    688
    Plugin Contributions
    0

    Default 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

  10. #10
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default 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

 

 

Similar Threads

  1. v154 Problems when adding to cart from product listing page
    By TinaS in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 22 Jan 2015, 01:37 AM
  2. Replies: 16
    Last Post: 13 Jan 2013, 06:10 PM
  3. Replies: 23
    Last Post: 4 Apr 2011, 07:49 PM
  4. Shopping cart empty when adding product to cart?
    By juanitas in forum Installing on a Linux/Unix Server
    Replies: 0
    Last Post: 13 Aug 2009, 11:22 PM
  5. Add product to cart and stay in product listing
    By brettw in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 20 Apr 2008, 11:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg