Results 1 to 8 of 8
  1. #1
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Adding a buy now button to products in listing that have options

    Hi

    All of my products have options so in category listing you dont see any buy now buttons.

    I think its confusing to some customers as they have to click on the product name (link) to get to the page where they can add to cart (after choosing the compulsory options)

    Id like to have a small buy now button next to the product name in category listing.

    How could i do this?

    Thanks

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

    Default Re: Adding a buy now button to products in listing that have options

    The short answer is "you can't".
    If as you say the attributes are compulsory, there is no way the products can technically be added to cart until selections have been made. Maybe what you need is to rework the "more info" link into a buy now button that will take the customer to the product info page wherre the attributes can be selected. Then they will still need to click "add to cart". If you are not getting the more info link, adding the price display to the listing may help.

  3. #3
    Join Date
    May 2012
    Posts
    42
    Plugin Contributions
    0

    Default Re: Adding a buy now button to products in listing that have options

    do you mean you want to replace the 'more info... ' text link with a buy now button as if the product had no attributes, except clicking the buy now button would direct you to the product page rather than putting the product into the cart?

    if so..

    go to includes/modules/product_listing.php an 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>';
    and change that line to:
    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']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
    then save that file to includes/modules/YOUR_TEMPLATE/product_listing.php <-- what ever YOUR_TEMPLATE name happens to be

  4. #4
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Re: Adding a buy now button to products in listing that have options

    awesome thanks

  5. #5
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Re: Adding a buy now button to products in listing that have options

    Thanks - but the product_listing.php isnt being called at all for some reason. Ive tried renaming the file and also the file by same name in my templates folder. The site still works.

    Im using fast easy checkout by numinix but still i think the product listing file should be getting called

  6. #6
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Re: Adding a buy now button to products in listing that have options

    sorry seems my /cpanel was resolving to my old server and changes werent appearing.

    I got it to work.. but actually id like to have a custom button in there. How can i make a custom button for it?

    eg so button reads - "Buy/Info" instead of Add To Cart which it does with above example

    Thank you

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

    Default Re: Adding a buy now button to products in listing that have options

    Use an image editing/creation program like Photoshop to make the graphics you want. I'm sure there are plenty of other cheaper programs you could use. Then save the new file with the same name as the old one replacing it) and it will just show up. If you want to use a new filename you will have to edit the PHP file where it is set for the function.

  8. #8
    Join Date
    Sep 2010
    Posts
    48
    Plugin Contributions
    1

    Default Re: Adding a buy now button to products in listing that have options

    just to go a little further
    in file: modules/YOUR_TEMPLATE/product_listing.php
    instead of
    changing
    Code:
    ...MORE_INFO_TEXT...
    (see crazysarah post #3 Code.1)

    to
    Code:
    ...zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"')...
    (see crazysarah post #3 Code.2)

    change
    Code:
    ...MORE_INFO_TEXT...
    to
    Code:
    ...zen_image_button(BUTTON_IMAGE_MOREINFOTEXT, BUTTON_MOREINFOTEXT_ALT, 'class="listingBuyNowButton"')...
    then
    in file: languages/english/YOUR_TEMPLATE/button_names.php
    add:
    Code:
    define('BUTTON_MOREINFOTEXT_ALT', '&nbsp;&nbsp;Options&nbsp;&nbsp;');
    define('BUTTON_IMAGE_MOREINFOTEXT', 'button_options.gif');
    if you want to create a different css style/colour button you can also change
    Code:
    “listingBuyNowButton”
    to
    Code:
    “listingOptionsButton”
    then
    create a button called 'button_options.gif' (in the same style as your ‘Add to cart’ button) and save in
    /templates/YOUR_TEMPLATE/buttons/english/

    now you’re setup to use either the image or the css buttons

    obviously you can use any word/phrase that best describes the button you want.
    i think ‘Options’ is a little more descript than ‘Add to cart’ in this instance

 

 

Similar Threads

  1. Display Buy Now button on product listing
    By SethF in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 27 Oct 2011, 07:48 AM
  2. Adding a more info button alongside buy now button
    By jwburnside in forum General Questions
    Replies: 5
    Last Post: 6 Nov 2010, 01:36 PM
  3. Adding Buy Now Button
    By mw4kids in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Mar 2009, 06:53 PM
  4. Product Listing Buy Now Button
    By Mon3 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 27 Nov 2008, 01:19 PM
  5. All products listing: can I have a buy now and a qty box?
    By twiddletails in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 20 Nov 2008, 05:15 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