Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jul 2006
    Location
    Holland
    Posts
    27
    Plugin Contributions
    0

    Default Simple add to cart button in Product info page

    Hi,

    I want to use an add to cart button in de product info on the right site of my product info page.
    This way customers can quickly add simple product to their main purchase.

    Right now i use this url:

    http://www.myshop.com/products_all.h...action=buy_now

    This works fine, but the problem is clicking on the link takes them to the all product listing page.
    I would like them to stay on the (main) product page.

    I know i should edit the init_cart_handler.php in /includes/init_includes/overrides/init_cart_handler.php

    Like mentioned by drbyte in this discussion

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

    Unfortunately i still can't get this to work.

    Is there anyway i can create a simple add now button in the product info page.

    Tnx Macbos

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Simple add to cart button in Product info page

    A link to your site would take guessing out og the mix
    Zencart by default displays an "add to cart" on the product info page as can be seen HERE
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2006
    Location
    Holland
    Posts
    27
    Plugin Contributions
    0

    Default Re: Simple add to cart button in Product info page

    Tnx for your reply

    Take look at

    http://www.deoutdoorwinkel.nl/backpa...ml?cPath=1_176

    At the bottom of the page customers can add a product by clicking on "toevoegen" (add to cart)
    After clicking the link takes them to te all product listing page.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Simple add to cart button in Product info page

    Clicking added tocart "Winkelwagen - [lees meer]"
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jul 2006
    Location
    Holland
    Posts
    27
    Plugin Contributions
    0

    Default Re: Simple add to cart button in Product info page

    Quote Originally Posted by kobra View Post
    Clicking added tocart "Winkelwagen - [lees meer]"
    What do you mean ?

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,366
    Plugin Contributions
    87

    Default Re: Simple add to cart button in Product info page

    It looks like you got it sorted out; clicking on the add-to-cart button on the product_info page returns you to that product_info page.

  7. #7
    Join Date
    Jul 2006
    Location
    Holland
    Posts
    27
    Plugin Contributions
    0

    Default Re: Simple add to cart button in Product info page

    Quote Originally Posted by lat9 View Post
    It looks like you got it sorted out; clicking on the add-to-cart button on the product_info page returns you to that product_info page.
    For the main product yes, but not the product under the product information.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,366
    Plugin Contributions
    87

    Default Re: Simple add to cart button in Product info page

    Ahh, I see now!

    The issue is that whatever code you're using to generate those "combo packs" is creating the "Buy Now" button as a hyperlink to the products_all page; that's why you wind up there after clicking the button.

    You could probably write some custom code in an override of init_cart_handler.php (i.e. /includes/init_includes/overrides/init_cart_handler.php) that recognizes that a buy_now request came to the products_all page from the product_info page and sets the $goto variable to indicate that a return should happen to product_info. The $goto variable is the one used by the shopping_cart class to determine where to return after performing the cart-related function.

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Simple add to cart button in Product info page

    The fun part is that the cart will have a record of the added product's id, but not the host product page. There is a snapshot() function that can be used to handle return navigation (used typically with the login function to get back to where you were) that might be able to be invoked.

  10. #10
    Join Date
    Jul 2006
    Location
    Holland
    Posts
    27
    Plugin Contributions
    0

    Default Re: Simple add to cart button in Product info page

    Quote Originally Posted by gjh42 View Post
    The fun part is that the cart will have a record of the added product's id, but not the host product page. There is a snapshot() function that can be used to handle return navigation (used typically with the login function to get back to where you were) that might be able to be invoked.
    Thank you both fore the help, i think show cart after adding a product is stil better then showing the all-product-listing page.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Need Help in adding a add to cart button on product info page
    By rmu065 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 9 Apr 2013, 01:50 AM
  2. v139h Add to cart button jumps to product info page.
    By onetrack in forum General Questions
    Replies: 6
    Last Post: 27 Jul 2012, 11:53 AM
  3. 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
  4. 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
  5. 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

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR