Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2012
    Posts
    8
    Plugin Contributions
    0

    Default Add to cart button jumps to product info page.

    hi,

    I have a couple of niggling problems on my cart (not live yet) that I cannot get to the bottom of, appreciate any guidance. I have tried various things to no avail.

    One isssue is the 'add to cart' button on the products page.

    Basically, I have added the admin option of an 'add to cart' button on each product in the category listing. So you select a category and all the products have an add to cart button next to the qty box.
    When the customer clicks on the button I want them to stay on that page. But what happens is they are directed to the 'product info page'.

    I tried the suggestion in the thread below. no joy..

    http://www.zen-cart.com/showthread.p...g-product-info


    Any help on this would be most welcome.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    66,834
    Plugin Contributions
    6

    Default Re: Add to cart button jumps to product info page.

    I tried the code change DrByte recommended and it works on v1.3.9h just fine ...

    To review, you are using these settings:

    1 Configuration ... My Store ... this is set to false
    Display Cart After Adding Product
    Display the shopping cart after adding a product (or return back to their origin)
    2 in Configuration ... Product Listing ... this setting is 2:
    Display Product Add to Cart Button (0=off; 1=on; 2=on with Qty Box per Product)
    Do you want to display the Add to Cart Button?

    NOTE: Turn OFF Display Multiple Products Qty Box Status to use Option 2 on with Qty Box per Product
    3 in Configuration ... Product Listing ... this setting is 0:

    Display Multiple Products Qty Box Status and Set Button Location
    Do you want to display Add Multiple Products Qty Box and Set Button Location?
    0= off
    1= Top
    2= Bottom
    3= Both
    4 make the changes DrByte posted in post #6 of:
    http://www.zen-cart.com/showthread.p...g-product-info

    to the file by copying:
    /includes/init_includes/init_cart_handler.php

    to the file:
    /includes/init_includes/overrides/init_cart_handler.php

    again, that directory name is exactly as you see it ...
    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: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Apr 2012
    Posts
    8
    Plugin Contributions
    0

    Default Re: Add to cart button jumps to product info page.

    Hi Ajeh

    Yes those are the settings I have.

    Display Cart After Adding Product false
    Display Product Add to Cart Button (0=off; 1=on; 2=on with Qty Box per Product) 2
    Display Multiple Products Qty Box Status and Set Button Location 0

    Change made as per DrBytes post to init_cart_handler_php and file copied to the 'overrides' folder.

    Still no joy i'm afraid.

    obviously something wrong on my part if you have checked it working, but can't think if I have done some change that has caused it?








    Quote Originally Posted by Ajeh View Post
    I tried the code change DrByte recommended and it works on v1.3.9h just fine ...

    To review, you are using these settings:

    1 Configuration ... My Store ... this is set to false


    2 in Configuration ... Product Listing ... this setting is 2:


    3 in Configuration ... Product Listing ... this setting is 0:


    4 make the changes DrByte posted in post #6 of:
    http://www.zen-cart.com/showthread.p...g-product-info

    to the file by copying:
    /includes/init_includes/init_cart_handler.php

    to the file:
    /includes/init_includes/overrides/init_cart_handler.php

    again, that directory name is exactly as you see it ...

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    66,834
    Plugin Contributions
    6

    Default Re: Add to cart button jumps to product info page.

    Save this code in the file:
    /includes/init_includes/overrides/init_cart_handler.php

    Code:
    <?php
    /**
     * initialise and handle cart actions
     * see {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
     *
     * @package initSystem
     * @copyright Copyright 2003-2010 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: init_cart_handler.php 17047 2010-07-29 06:00:38Z drbyte $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    }
    if (isset($_GET['action'])) {
      /**
       * redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
       */
      if ($session_started == false) {
        zen_redirect(zen_href_link(FILENAME_COOKIE_USAGE));
      }
    /*
      if (DISPLAY_CART == 'true') {
        $goto =  FILENAME_SHOPPING_CART;
        $parameters = array('action', 'cPath', 'products_id', 'pid', 'main_page');
      } else {
    */
    
      if ($current_page_base == FILENAME_DEFAULT) {
        $goto =  FILENAME_DEFAULT;
        $parameters = array('action', 'cPath', 'products_id', 'pid', 'main_page');
      } elseif (DISPLAY_CART == 'true') {
        $goto =  FILENAME_SHOPPING_CART;
        $parameters = array('action', 'cPath', 'products_id', 'pid', 'main_page');
      } else {
            $goto = $_GET['main_page'];
        if ($_GET['action'] == 'buy_now') {
          if (strpos($goto, 'reviews') > 5) {
            $parameters = array('action');
            $goto = FILENAME_PRODUCT_REVIEWS;
          } else {
            $parameters = array('action', 'products_id');
          }
        } else {
          $parameters = array('action', 'pid', 'main_page');
        }
      }
      /**
       * require file containing code to handle default cart actions
       */
      require(DIR_WS_INCLUDES . 'main_cart_actions.php');
    }
    and load it to your site ...

    Does it work?
    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: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #5
    Join Date
    Apr 2012
    Posts
    8
    Plugin Contributions
    0

    Default Re: Add to cart button jumps to product info page.

    No unfortunately not.

    I tried that file in all the init_includes 'overrides' folders i could find, incase that was the cause, but no joy?

    Could some other module be overriding it possibly?

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    66,834
    Plugin Contributions
    6

    Default Re: Add to cart button jumps to product info page.

    I am not sure what to tell you as it works fine for me when loaded to:
    /includes/init_includes/overrides/init_cart_handler.php
    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: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  7. #7
    Join Date
    Jul 2011
    Posts
    24
    Plugin Contributions
    0

    Default Re: Add to cart button jumps to product info page.

    Do you know if this is going to work in ZenCart version 1.5? I'm getting the same issue on this version. Once I click on Add to Cart, it redirects to product info page.

    Regards,

 

 

Similar Threads

  1. Add To Cart Button On Product Info Page
    By aishaatkraysis in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Aug 2010, 02:50 PM
  2. Add to Cart-button outside the product info-page?
    By kazie in forum General Questions
    Replies: 1
    Last Post: 23 Mar 2010, 10:20 AM
  3. Add to Cart button not showing on product info page with attributes
    By Harvard in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 11 Nov 2009, 10:04 PM
  4. Change Add to Cart button on Product Info page
    By Lobazniouk in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 10 Sep 2009, 10:41 PM
  5. Product Info page - moving the Add To Cart button to very top.
    By marknotgeorge in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 15 Oct 2008, 09:34 PM

Bookmarks

Posting Permissions

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