Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jan 2010
    Posts
    2
    Plugin Contributions
    0

    Default how to change quantity box to dropdown menu?

    How can i change the quantity input box into a dropdown menu, I guess users will feel easier to click and select the quantity they want.

    In advance i appreciate ur help.

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: how to change quantity box to dropdown menu?

    This will require some substantial code editing and probably a new field in the database too - and I don't think it makes sense anyway. MOST of the time, people only ever want ONE item, and don't think that customers are so stupid as to not know how to key in a different value if that's necessary.
    20 years a Zencart User

  3. #3
    Join Date
    Jan 2010
    Posts
    2
    Plugin Contributions
    0

    Default Re: how to change quantity box to dropdown menu?

    You don't understand what people want. It doesn't require to create any additional fields in the database nor complex edition of codes. It requires only few lines of html.

    Why it requires additional fields in the database , ? i don't understand. Here i am changing the way customer choose their value, instead of typing customer will feel much much easier to click and select the quantity. this is not adding another value to it/

    find the text input box and replace with drop down menu. that's it. you got that stupid idiot ?

    this forum is getting spoiled by people like you. If you don't know the answer don't waste your time looser.

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: how to change quantity box to dropdown menu?

    May the fleas of a thousand camels infest your armpits.

    You cannot do this with HTML. Zencart works with PHP. The variables will need to be stored in the database and PHP code will need to be written to call those variables, parse them into the form, and write the result.

    You have (so far) just 2 posts. I have a few more than that...

    I think I have a little bit of a head start on you.
    20 years a Zencart User

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: how to change quantity box to dropdown menu?

    And as you are SO clever, have a go at this:

    PHP Code:
    <?php
    if (CUSTOMERS_APPROVAL == and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
      
    // do nothing
    } else {
    ?>
                <?php
        $display_qty 
    = (($flag_show_product_info_in_cart_qty == and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' PRODUCTS_ORDER_QTY_TEXT_IN_CART $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' '');
                if (
    $products_qty_box_status == or $products_quantity_order_max== 1) {
                  
    // hide the quantity box and default to 1
                  
    $the_button '<input type="hidden" name="cart_quantity" value="1" />' zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT);
                } 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);
                }
        
    $display_button zen_get_buy_now_button($_GET['products_id'], $the_button);
      
    ?>
      <?php if ($display_qty != '' or $display_button != '') { ?>
        <div id="cartAdd">
        <?php
          
    echo $display_qty;
          echo 
    $display_button;
                
    ?>
              </div>
      <?php // display qty and button ?>
    <?php 
    // CUSTOMERS_APPROVAL == 3 ?>
    ... because that is just ONE PART of the code you will need to edit...
    20 years a Zencart User

  6. #6
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: how to change quantity box to dropdown menu?

    And from the above, you will also see the complexities involved in dealing with product Minimum Quantity (set in the product add/edit screen - with the relevant value entered there most certainly being stored in the database), and how the "Add to Cart" displays subsequent values for an item that is ALREADY in the cart.

    This is indeed a complex issue and you should be thankful that the stupid idiot schoolboy has pointed that out to you.

  7. #7
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: how to change quantity box to dropdown menu?

    Quote Originally Posted by schoolboy View Post
    MOST of the time, people only ever want ONE item, ...
    That's way too broad a claim to make. It may apply to certain kinds of products but not at all to others.

    Quote Originally Posted by ginby View Post
    find the text input box and replace with drop down menu. that's it.
    Sounds like you know what to do. Why not go ahead and do it?

    Quote Originally Posted by ginby View Post
    ... don't waste your time looser.
    I believe the term you're looking for is "loser". Schoolboy may or may not be looser than most, but we have no way of knowing that.

    Rob

  8. #8
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: how to change quantity box to dropdown menu?

    In the company of attractive single women I think I can be a bit loose...

    ... but to admit also, it's situations like this that I can also be more of a loser
    20 years a Zencart User

  9. #9
    Join Date
    Jan 2010
    Posts
    3
    Plugin Contributions
    0

    Default How to add customized price and also update customized quantiy.

    Hi,
    Can anyone help me with this.... and very new to zencart and php.
    Basically, my requirement was: For a product, I have to calculate the price depending upon the values entered by the user and that price selected by the user should be become unit price.

    To achieve that, I created the attributes for the product(baseprice=$0.00). I collected the values entered in those attributes text field using javascript in the tpl_modules_attributes.php page. An ajax calculate button would post those values to the CalculationScript.php where i calculate the price of the product and display the price table(which displays prices and quantity and days of shipping accordingly).

    Upon the selection of one price and Addcart event, corresponding values of Unitprice, quantity, days of shipping should be reflected in the corresponding values of Shopping cart.

    I able to overwrite the Unit price..by manuplating final prcie but not quantity and totals.. can anybody please give me some suggestions... !!!how to modify the quantity? and days of Shipping..? Plz iam pretty much in the bad. shape.. !!!

    Thanx in advance.

 

 

Similar Threads

  1. v151 How Can I Populating a Dropdown menu box from a My SQL database.
    By subsystem in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 30 Nov 2012, 10:13 PM
  2. Re: how to change dropdown box color on product?
    By uri1223 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Aug 2011, 12:48 AM
  3. how to change dropdown box color on product?
    By uri1223 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 10 Aug 2011, 12:42 AM
  4. how to change the quantity box style?
    By silvai in forum General Questions
    Replies: 1
    Last Post: 4 Jul 2011, 01:41 PM
  5. Checking quantity of dropdown menu
    By threers in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 28 May 2011, 09:17 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