Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jun 2007
    Posts
    34
    Plugin Contributions
    0

    Default Adding "add to cart" button to featured products

    I am currently working on a client website (http://www.volumewireless.com/) and I attempted add an "add to cart" button to the featured products on the home page to no avail. The featured products on home page are driven by the featured products module.

    You can see that I have modified it slightly already but i cannot seem to get the add to cart code from the product page to work, have any of you attempted this before?

  2. #2
    Join Date
    Jun 2007
    Posts
    34
    Plugin Contributions
    0

    Default Re: Adding "add to cart" button to featured products

    nm I found a work around.

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

    Default Re: Adding "add to cart" button to featured products

    And what was it that worked? The info may help others.

  4. #4
    Join Date
    Jun 2007
    Posts
    34
    Plugin Contributions
    0

    Default Re: Adding "add to cart" button to featured products

    In the "includes/modules/featured_products.php" file around line 55 there is an array called 'text' within it I added:

    . '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . '<img src="my image link" />' . '</a>'

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

    Default Re: Adding "add to cart" button to featured products

    Thanks for sharing! That will undoubtedly make some people's lives a lot easier. Tweaking the code above for a particular installation is peanuts compared to figuring out where and what to change...
    Last edited by gjh42; 15 Aug 2007 at 05:26 PM.

  6. #6
    Join Date
    Nov 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Adding "add to cart" button to featured products

    Quote Originally Posted by Sheehan View Post
    In the "includes/modules/featured_products.php" file around line 55 there is an array called 'text' within it I added:

    . '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . '<img src="my image link" />' . '</a>'
    Thanks. This tipped help me as well!

  7. #7
    Join Date
    Dec 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Adding "add to cart" button to featured products

    Any chance you can be a little more specific on the location that this code should be entered.

    I found the array, but my limited PHP knowledge is keeping me from finding the spot to place it.

    Thanks for your help!

  8. #8
    Join Date
    Dec 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Adding "add to cart" button to featured products

    Got it,

    My array was on line 65 "text"

    I put it at the very end of the array before the final
    ) ;
    Also, remember to change the image source in the code.

    Thanks!

  9. #9
    Join Date
    Dec 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Adding "add to cart" button to featured products

    If anyone knows how to do it.

    I would like to put a quantity box and an "add to cart" button there instead of "buy now" to make that completely seemless.

    Anyone?

    www.studioanello.com

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

    Default Re: Adding "add to cart" button to featured products

    That is a considerable chunk of code, and could not just be dropped into the line as shown above. Look in /includes/templates/template_default/templates/tpl_product_info_display.php to find the section that builds the price/add. It incrementally puts together bits of code; you can probably transfer the section to a point above the "text" line, accumulating the output in a variable like
    $add_code .= ...
    and then insert
    . $add_code
    in the text output.

    A caution: the code in tpl_product_info_display.php may depend on some variables being loaded with current database query info, and may not work properly in another file. If that is the case, you will have to get that info from the database, which is a whole other subject.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Adding "Add to cart"-Button or product in a document-general
    By Dave1st in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Sep 2014, 01:35 PM
  2. Adding Qty Box to Cross Sell above "Add to Cart" button
    By bigstore in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 Mar 2012, 06:37 PM
  3. Replies: 26
    Last Post: 19 Feb 2010, 02:56 AM
  4. Replies: 12
    Last Post: 17 Jul 2009, 01:26 AM
  5. Help adding "Add to Cart Button"
    By ZuluRose in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 24 Oct 2006, 05:56 PM

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