Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2009
    Posts
    36
    Plugin Contributions
    0

    Default Adding a more info button alongside buy now button

    Hey everyone, I am having a tough time figuring out how to implement a "more info" button with the "buy now" button on the product listing page.

    The site is very simple; no attributes on any products so we would like the customer to be able to go to the product details page with a button. Currently it does this by clicking the product image, but having a button is a little more intuitive.

    I have been scanning the product_listing.php page around line 138 but I'm not really understanding this portion of the code.

    Can anyone give me a hint about how this can be done?

    Thanks,

    JW

  2. #2
    Join Date
    Apr 2009
    Location
    In a traffic jam
    Posts
    1,982
    Plugin Contributions
    1

    Default Re: Adding a more info button alongside buy now button

    product_listing is the right place. It is modified by lots of mods but it looks like you are using the default version so I'll use those line numers:


    On line 115 find:

    Code:
              $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
    This is a simple 'more info' link. It is assigned to the variable $lc_button here. Do not do anything yet as this is just to show you what the code for a 'more info' link looks like.

    If you just want the more info link to appear below the buy now or add to cart regardless of whether you are using cart quantities or not go to line 148:

    Code:
            $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
    This is (some of) where the final variable $lc_text (that is stored in an array and then output to the table in a different file) is created if we are in a price table cell.

    Then, just to see how it works add this(scroll left - the changes are in red):

    Code:
            $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']). '<br />'.'New Text Here' ;
    Now instead of the 'New Text Here' put in the code from line 115 (the bit after the equals sign) to get:

    Code:
            $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']). '<br />'.'<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>' ;
    There you go...

  3. #3
    Join Date
    Jun 2009
    Posts
    36
    Plugin Contributions
    0

    Default [Solved] Re: Adding a more info button alongside buy now button

    Righto, that worked perfectly thanks!

    JW

  4. #4
    Join Date
    Feb 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: Adding a more info button alongside buy now button

    Hi Niccol,

    If you're still watching. Can you tell me how to pull off the same thing in 'product all listing'?

    Wim

  5. #5
    Join Date
    Apr 2009
    Location
    In a traffic jam
    Posts
    1,982
    Plugin Contributions
    1

    Default Re: Adding a more info button alongside buy now button

    In tpl_modules_products_all_listing about line 84, replace the existing code with:
    Code:
          if (PRODUCT_ALL_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($products_all->fields['products_id']) == 'Y') {
            if (zen_has_product_attributes($products_all->fields['products_id'])) {
              $link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
            } else {
    //          $link= '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>';
              if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0 && $products_all->fields['products_qty_box_status'] != 0) {
    //            $how_many++;
                $link = TEXT_PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $products_all->fields['products_id'] . "]\" value=\"0\" size=\"4\" />".'<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
              } else {
                $link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>&nbsp;'.'<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';;
              }
            }
    I think that should do it. If you need more precise instructions let me know. Basically replace everything between '// more info in place of buy now' and ' $the_button = $link;'

  6. #6
    Join Date
    Feb 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: Adding a more info button alongside buy now button

    Thats it.

    Thanks!

 

 

Similar Threads

  1. Adding more than one button "add to cart" on product info page....
    By Celebrimbor in forum General Questions
    Replies: 14
    Last Post: 4 Feb 2010, 05:41 PM
  2. Adding a Download button instead of "...more info"
    By koooch in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 27 Apr 2009, 03:37 AM
  3. adding additional info hotlink or button??
    By highlander2 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 11 Mar 2009, 05:18 PM
  4. more info button
    By dscott1966 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Aug 2008, 11:35 PM
  5. more info button
    By NthMotion in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 8 Jul 2008, 09:11 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
  •