Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,741
    Plugin Contributions
    22

    Default Re: Product Quantity dropdown

    Quote Originally Posted by StoreOwner View Post
    bumpity
    OK, the bumpity made me laugh so I decided to jump in and tell you what to do.

    Edit your includes/modules/YOUR_TEMPLATE/product_listing.php and find (around) line 88:
    Code:
    for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
          $lc_align = '';
    Add after:
    Code:
    // BOF dropdown 1/2
    	  $optvalues = '';
    	  for ($i = 1; $i < 16; $i++) {
    		$optvalues .= '<option value="' . ((zen_get_buy_now_qty($_GET['products_id'])) * $i) . '">'. ((zen_get_buy_now_qty($_GET['products_id'])) * $i) .'</option>';	
    	  }
    	  // EOF dropdown 1/2
    Next, find:
    Code:
    if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
                  $lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], 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_CART, BUTTON_IN_CART_ALT) . '</form>';
                }
    and replace with:
    Code:
    if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
                  // BOF dropdown 2/2
    			  //$lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], 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_CART, BUTTON_IN_CART_ALT) . '</form>';
    			  $lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<select name="cart_quantity">'. $optvalues .'</select>' . (zen_get_products_quantity_order_min((int)$_GET['products_id']) || zen_get_products_quantity_order_units((int)$_GET['products_id']) ? zen_get_products_quantity_min_units_display((int)$_GET['products_id']) : '')  . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
    			  // EOF dropdown 2/2
                }
    And last - go to admin->Configuration->Product Listing and set:
    Display Product Add to Cart Button: 2
    Display Multiple Products Qty Box Status and Set Button Location: 0

    This should do the trick, although I haven't really tested it so make sure it works for ALL cases.

    Regards,
    Leonard

  2. #12
    Join Date
    Jun 2014
    Location
    United States
    Posts
    59
    Plugin Contributions
    0

    Default Re: Product Quantity dropdown

    Quote Originally Posted by balihr View Post
    OK, the bumpity made me laugh so I decided to jump in and tell you what to do.

    Edit your includes/modules/YOUR_TEMPLATE/product_listing.php and find (around) line 88:
    Code:
    for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
          $lc_align = '';
    Add after:
    Code:
    // BOF dropdown 1/2
    	  $optvalues = '';
    	  for ($i = 1; $i < 16; $i++) {
    		$optvalues .= '<option value="' . ((zen_get_buy_now_qty($_GET['products_id'])) * $i) . '">'. ((zen_get_buy_now_qty($_GET['products_id'])) * $i) .'</option>';	
    	  }
    	  // EOF dropdown 1/2
    Next, find:
    Code:
    if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
                  $lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], 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_CART, BUTTON_IN_CART_ALT) . '</form>';
                }
    and replace with:
    Code:
    if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
                  // BOF dropdown 2/2
    			  //$lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], 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_CART, BUTTON_IN_CART_ALT) . '</form>';
    			  $lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<select name="cart_quantity">'. $optvalues .'</select>' . (zen_get_products_quantity_order_min((int)$_GET['products_id']) || zen_get_products_quantity_order_units((int)$_GET['products_id']) ? zen_get_products_quantity_min_units_display((int)$_GET['products_id']) : '')  . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
    			  // EOF dropdown 2/2
                }
    And last - go to admin->Configuration->Product Listing and set:
    Display Product Add to Cart Button: 2
    Display Multiple Products Qty Box Status and Set Button Location: 0

    This should do the trick, although I haven't really tested it so make sure it works for ALL cases.

    Regards,
    Leonard
    you are a genius thanks!!!
    Anyway I can make it so you can get more than 15 in quantity - any larger = scroll?

    if not either way this should work tyvm!

    also products with only 1 quantity it still shows 15
    Last edited by StoreOwner; 13 Jun 2014 at 12:20 AM.

  3. #13
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,741
    Plugin Contributions
    22

    Default Re: Product Quantity dropdown

    Quote Originally Posted by StoreOwner View Post
    you are a genius thanks!!!
    Anyway I can make it so you can get more than 15 in quantity - any larger = scroll?
    Sure - you can take it up to a trillion if you want. Notice the first change ($i<16) - change it to whatever max value you want. However, AFAIK, you can't control how many rows to display before scrollbar appears. Well, at least not without some javascript (or jQuery).

    Quote Originally Posted by StoreOwner View Post
    also products with only 1 quantity it still shows 15
    Yeah... Well, here's a new version:
    Code:
    // BOF dropdown 1/2
    	  $optvalues = '';
    	  $stock_check = $listing->fields['products_quantity'];
    	  $stock_menu = $stock_check < 15 ? $stock_check : 15;
    	  for ($i = 1; $i <= $stock_menu; $i++) {
    		$optvalues .= '<option value="' . ((zen_get_buy_now_qty($_GET['products_id'])) * $i) . '">'. ((zen_get_buy_now_qty($_GET['products_id'])) * $i) .'</option>';	
    	  }
    	  // EOF dropdown 1/2
    Enjoy!

    Regards,
    Leonard

  4. #14
    Join Date
    Jun 2014
    Location
    United States
    Posts
    59
    Plugin Contributions
    0

    Default Re: Product Quantity dropdown

    <3

    ur the best!

    scroll working too! wow took u 2 secs

  5. #15
    Join Date
    Jun 2014
    Location
    United States
    Posts
    59
    Plugin Contributions
    0

    Default Re: Product Quantity dropdown

    do you know how i can make it be right above the add to cart button?

    Right now its on the left side of it and a little bit lower

  6. #16
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,741
    Plugin Contributions
    22

    Default Re: Product Quantity dropdown

    Quote Originally Posted by StoreOwner View Post
    do you know how i can make it be right above the add to cart button?
    It's probably inheriting some styling from your CSS - by default (clean 1.5.1 install), it IS centered above the button. You could try something like this in your stylesheet.css:
    Code:
    .productListing-data select {
    	display: block;
    	margin:0.1em auto;
    }

  7. #17
    Join Date
    Jun 2014
    Location
    United States
    Posts
    59
    Plugin Contributions
    0

    Default Re: Product Quantity dropdown

    worked :)

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. 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
  2. quantity dropdown to blank box - add to cart
    By CheapStairParts in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 25 Jul 2012, 02:39 PM
  3. Checking quantity of dropdown menu
    By threers in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 28 May 2011, 09:17 PM
  4. Dropdown quantity
    By scottb in forum General Questions
    Replies: 14
    Last Post: 31 Mar 2011, 07:56 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