Results 1 to 10 of 17

Hybrid View

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

    Default Re: quantity text box/ input field

    I have long been annoyed by that button mismatch too, so I just fixed it on my own site. Here it is:

    In tpl_product_info_display.php find this
    PHP Code:
     } else {
                  
    // show the quantity box  
        
    $the_button PRODUCTS_ORDER_QTY_TEXT '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT);
                } 
    and edit it with
    <span id="cartAddButton">
    and
    . '</span>'
    to get this
    PHP Code:
     } else {
                  
    // show the quantity box  gjh42 4/13/06 - chg box layout to horiz.
        
    $the_button PRODUCTS_ORDER_QTY_TEXT '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" />' zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<span id="cartAddButton">' zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT) . '</span>';
                } 
    In your stylesheet find #cartAdd and below it add this
    PHP Code:
    #cartAddButton {
        
    positionrelative;
        
    top1em;
        } 
    Last edited by gjh42; 7 May 2007 at 09:20 PM.

  2. #2
    Join Date
    Apr 2007
    Posts
    69
    Plugin Contributions
    0

    Default Re: quantity text box/ input field

    AMAZING. works beautifully.

    thanks for all your help, again

  3. #3
    Join Date
    May 2010
    Location
    Cyberspace
    Posts
    376
    Plugin Contributions
    0

    Default Re: quantity text box/ input field

    Hi!

    I was thrilled to seet his solution! I tried it right away (with ZenCart 1.39e) but when I copied your (gjh42) code into 'tpl_product_info_display.php' the product information page disappeared I'd really appreciate to have the fix for cartadd you posted
    on this page!!

    Please help me!

    Thanks!

    Regards
    Jacob

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

    Default Re: quantity text box/ input field

    We need to see your site to be sure of the correct fix for you. Also, post the actual section of code from your file to be sure it is correctly applied.

  5. #5
    Join Date
    Jun 2010
    Location
    Manchester, UK
    Posts
    27
    Plugin Contributions
    0

    Default Re: quantity text box/ input field

    I am having a similar problem, I would like the add to cart button and the qty box on the same line with space between them and aligned neatly so they don't look mismatched. I did what you said and managed to get them on the same line but they are still misaligned. Here is a link to the page in question http://www.lovetolust.com/test/zen/i...roducts_id=181

    Would greatly appreciate some help with this.

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

    Default Re: quantity text box/ input field

    You didn't do what I said in the stylesheet. adding a margin all around the button is not going to do anything useful. You need to push or pull it down:
    Code:
    #cartAddButton {
        position: relative;
        margin: 0.1em;
        bottom: -0.5em;
    	}

  7. #7
    Join Date
    Jun 2010
    Location
    Manchester, UK
    Posts
    27
    Plugin Contributions
    0

    Default Re: quantity text box/ input field

    Sorry I did initially put in the CSS
    position: relative;
    top: 1em;

    But since that didn't seem to align the button and box I fiddled around, obviously I don't really know what I am doing so I kept making changes and saving the css file to see what effect it was having, I have been banging my head against the wall with this for about 4 hours :-/.

 

 

Similar Threads

  1. Make input field on collectinfo also display the field text as hyperlink
    By jpietrowiak in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 15 Dec 2012, 05:06 AM
  2. v139h adding text input fileld overwrites existing field
    By newbutold in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Dec 2012, 01:42 AM
  3. v139h Altering Quantity field from text input to dropdown on a per-product basis?
    By jgold723 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 31 Aug 2012, 08:06 AM
  4. Convert Text Input Field to Image?
    By ramblas in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 Jun 2010, 02:01 PM
  5. Text field input areas
    By Stormshade in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 10 Apr 2009, 02:52 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