Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2009
    Posts
    90
    Plugin Contributions
    0

    Default HTML for Add to cart button

    Bascially i use firebug to design and make changes in the browser for all my CSS before i actually go forth and do it. Now today i went through and decided thru and added a new add to cart button. So i fired up the browser i turned on firebug to check to see what div its in and the styling of hat element.

    Here is my problem: I cant find where this piece of code is located:

    HTML Code:
    <div id="cartAdd">
    Add to Cart:
    <input type="text" size="4" maxlength="6" value="1" name="cart_quantity">
    <br>
    <br>
    <input type="hidden" value="139" name="products_id">
    <input type="image" title=" Add to Cart " alt="Add to Cart" src="includes/templates/template_default/buttons/english/button_in_cart.gif">
    </div>
    This is located in HTML and not the PHP files it seems. But i cant find where the actually HTML is stored. Reasoning behind this is i want to take out the two breaks and i want to change the location of the button as the button i have is not a gif.

    Please help its driving me nuts. Ive searched her on the forum and even gone as far as using the developer tools built into the car and haven't found them.

  2. #2
    Join Date
    Jan 2008
    Posts
    67
    Plugin Contributions
    0

    Default Re: HTML for Add to cart button

    the HTML for button creation is located in the html_output.php file in the includes/functions/ folder. It pulls some info from the tpl_product_display.php template page and together with the function creates the button. If you simply need to change the button image from .gif to say .png or .jpg that can be done easily in the includes/languages/english/button_names.php file where you find your DEFINES. You just change the button name from 'button_add_to_cart.gif' to 'button_add_to_cart.png'. That might be what your looking for.

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

    Default Re: HTML for Add to cart button

    The add to cart is built from lots of pieces, some of which may not be present in any particular product (like quantity limits). But the code inserts the <br /> for each of these pieces regardless of whether it is needed, so you can end up with excess spaces.

    You can go through the button-building code in product_listing.php or tpl_product_info_display.php and eliminate the <br />, but the simpler way would be with CSS, like this:

    #cartAdd input+br, #cartAdd input+br+br {display: none;}

    Other variations on this can be used where needed.

  4. #4
    Join Date
    Oct 2009
    Posts
    90
    Plugin Contributions
    0

    Default Re: HTML for Add to cart button

    Awesome thank you both, helped me out very much with both responses.

 

 

Similar Threads

  1. v150 Add to cart button for virtual products
    By lilly06 in forum General Questions
    Replies: 8
    Last Post: 9 Dec 2012, 12:33 PM
  2. Add to cart button for new products?
    By toxee in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 10 Mar 2011, 02:27 PM
  3. Image button for Add to Cart only
    By Danielle in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 15 Jul 2010, 06:56 PM
  4. Need help for Add To Cart button!
    By ttmb33 in forum Customization from the Admin
    Replies: 2
    Last Post: 16 Mar 2010, 05:03 PM
  5. Edit 'Add to Cart' Button HTML
    By DiZZ in forum General Questions
    Replies: 5
    Last Post: 21 May 2008, 08:48 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