Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2006
    Posts
    14
    Plugin Contributions
    0

    Default Add To Cart Button instead of Details

    From the product listing how do you have an "Add to Cart" button show up instead of having to click on details first and then add to cart?

    Thanks,
    Tony

  2. #2
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,197
    Plugin Contributions
    0

    Default Re: Add To Cart Button instead of Details

    Tony,
    Do you have attributes attached to your product??

    Mark,

  3. #3
    Join Date
    Jun 2006
    Posts
    14
    Plugin Contributions
    0

    Default Re: Add To Cart Button instead of Details

    Herado, when you asked me about attaching attributes to my product do you mean if I had small, medium, or large attributes to my products? Is that a bad thing, cause with the double ?? you have me a bit worried. LOL!

    If you want to see what I'm talking about take a look here https://glo-techinc.com/store

    Thanks,
    Tony

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

    Default Re: Add To Cart Button instead of Details

    No, attributes (present or absent) are not bad - but if you do have any attributes for a product, you cannot have a buy now button on the listing page. This is because a choice needs to be made before a product with attributes can be bought, and the only place to choose attributes is the product info page.

    But... you have products without attributes which still have the Details button. Either you are set to always show that (I believe there is a switch for it, but can't remember where), or the template creator set it permanently in the code. The button has been customized, because it normally reads "...more info".

    There are settings that apply to the add to cart function on the Configuration > Product Listing page:
    Display Product Price/Add to Cart
    Display Product Add to Cart Button (0=off; 1=on; 2=on with Qty Box per Product)
    Display Multiple Products Qty Box Status and Set Button Location

    I don't use any of these so am not sure if one of them might fix your problem.
    On looking at them, I think "Add to Cart Button (0=off" will cause the more info or Details button to appear instead. Try setting that to 1 or 2.
    Last edited by gjh42; 24 Apr 2007 at 03:50 AM.

  5. #5
    Join Date
    Jun 2006
    Posts
    14
    Plugin Contributions
    0

    Default Re: Add To Cart Button instead of Details

    Hi Glenn I did not see your response until just today. The forum never sent me an email.

    I did happen to do go into the product listing part of the configuration and made display product price/add to cart set to 1. Still it's not showing, so that means I'm probably missing a chunk of code.

    Does anyone know what that chunk of code would be? OR on what page that chunk of code would be on?

    Thanks,
    Tony

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

    Default Re: Add To Cart Button instead of Details

    You don't have to depend on the forum e-mail... any time you want, you can click on Search > Advanced Search > enter your user name, and see all the threads you have posted in. Any thread with a bold title contains something you haven't read yet.

    I believe your template is hardcoded to show the details button. If the template maker followed the correct procedures for making a Zen Cart template, that will be in /includes/modules/glo_tech/product_listing.php. The relevant section looks like this in a stock install:
    PHP Code:
      case 'PRODUCT_LIST_PRICE':
            
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
            
    $lc_align 'right';
            
    $lc_text =  $lc_price;

            
    // more info in place of buy now
            
    $lc_button '';
            if (
    zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
              
    $lc_button '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 'cPath=' $_GET['cPath'] . '&' '') . 'products_id=' $listing->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            } else {
              if (
    PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
                if (
                    
    // not a hide qty box product
                    
    $listing->fields['products_qty_box_status'] != &&
                    
    // product type can be added to cart
                    
    zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
                    
    &&
                    
    // product is not call for price
                    
    $listing->fields['product_is_call'] == 0
                    
    &&
                    
    // product is in stock or customers may add it to cart anyway
                    
    ($listing->fields['products_quantity'] > || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
                  
    $how_many++;
                }
                
    // hide quantity box
                
    if ($listing->fields['products_qty_box_status'] == 0) {
                  
    $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $listing->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
                } else {
                  
    $lc_button TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART "<input type=\"text\" name=\"products_id[" $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
                }
              } else {
    // qty box with add to cart button
                
    if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
                  
    $lc_buttonzen_draw_form('cart_quantity'zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' $listing->fields['products_id']), 'post''enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' zen_draw_hidden_field('products_id'$listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT) . '</form>';
                } else {
                  
    $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $listing->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
                }
              }
            }
            
    $the_button $lc_button;
            
    $products_link '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 'cPath=' $_GET['cPath'] . '&' '') . 'products_id=' $listing->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            
    $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']);
            
    $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON '<br />' '') : '');

            break; 
    with the critical part for this problem being
    PHP Code:
     // more info in place of buy now
            
    $lc_button '';
            if (
    zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
              
    $lc_button '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 'cPath=' $_GET['cPath'] . '&' '') . 'products_id=' $listing->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            } else { 
    Find that file and open it in Notepad or a good TEXT editor (NOT a word processor). What does it look like?

    Note: I highly recommend downloading a specialized free file editing program like Notepad++ from Sourceforge.net. This will make life a lot easier when you look at files.

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

    Default Re: Add To Cart Button instead of Details

    PS - I'm so used to having my development copy on my pc that I sometimes forget this step: you will need to copy your site files/folders from the server to your home computer to work on them this way. Filezilla (also from Sourceforge) is a good ftp program for this. See Making a Local Copy of Your Web Site for directions - helpful for backing up & downloading even if you don't install a working local site.

 

 

Similar Threads

  1. v151 Add To Cart displaying alt text instead of add to cart button
    By AquaticAddiction in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 8 Feb 2014, 07:58 PM
  2. add a cart button instead of contact for price
    By cm27 in forum General Questions
    Replies: 2
    Last Post: 28 Nov 2011, 06:10 AM
  3. Instead of it saying Add to Cart can there be a buy now button instead?
    By tanyaleann in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Oct 2008, 07:59 PM
  4. Add to cart & details button !
    By asteriks in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 3 Oct 2008, 07:59 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