[Skip to main content](#vessel-content)

#   « show select » doesn't respect existing quantity

##

- **[Flooder](/forum/user/23280-flooder "View Flooder's Profile")**
- [![Flooder's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar23280.png)](/forum/user/23280-flooder "View Flooder's Profile") Topic Author
- [ Offline](/forum/user/23280-flooder)

Less More

- Posts: 263
- Thank you received: 11
-
-

12 years 4 months ago [\#164066](#164066) by [Flooder](/forum/user/23280-flooder "View Flooder's Profile")  *[« show select » doesn't respect existing quantity](/forum/3-bug-report/869703-show-select-doesnt-respect-existing-quantity#164066 "Hello there,  When we choose « Show select » for a product in the field « Quantity layout on product page », the dropbox on the product page doesn't respect existing price quantity.  I have this prices in my product (for example): 5000 for 100 $ 20000 for 200 $ 100000 for 300 $  But on the product page, we see 5000, 10000, 15000, etc. in the dropbox...  Thanks  Hikashop 2.3.2 Joomla 3.3.0 HikaMarket Multivendor: 1.4.1")* was created by *[Flooder](/forum/user/23280-flooder "View Flooder's Profile")*

Hello there,

When we choose « Show select » for a product in the field « Quantity layout on product page », the dropbox on the product page doesn't respect existing price quantity.

[ ![hf67c72d.png](/forum/attachment/18447) ](/forum/attachment/18447 "hf67c72d.png")

I have this prices in my product (for example):
5000 for 100 $
20000 for 200 $
100000 for 300 $

But on the product page, we see 5000, 10000, 15000, etc. in the dropbox...
[ ![hb7b81f8.png](/forum/attachment/18448) ](/forum/attachment/18448 "hb7b81f8.png")

Thanks

Hikashop 2.3.2
Joomla 3.3.0
HikaMarket Multivendor: 1.4.1

- [ ![hf67c72d.png](/forum/attachment/18447) ](/forum/attachment/18447 "hf67c72d.png") [ ](/forum/attachment/18447?download=1 "hf67c72d.png")
- [ ![hb7b81f8.png](/forum/attachment/18448) ](/forum/attachment/18448 "hb7b81f8.png") [ ](/forum/attachment/18448?download=1 "hb7b81f8.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84Njk3MDMtc2hvdy1zZWxlY3QtZG9lc250LXJlc3BlY3QtZXhpc3RpbmctcXVhbnRpdHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4080
-
- [](http://obsi.dev)
-

12 years 4 months ago [\#164068](#164068) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[« show select » doesn't respect existing quantity](/forum/3-bug-report/869703-show-select-doesnt-respect-existing-quantity#164068 "Hello there,  When we choose « Show select » for a product in the field « Quantity layout on product page », the dropbox on the product page doesn't respect existing price quantity.  I have this prices in my product (for example): 5000 for 100 $ 20000 for 200 $ 100000 for 300 $  But on the product page, we see 5000, 10000, 15000, etc. in the dropbox...  Thanks  Hikashop 2.3.2 Joomla 3.3.0 HikaMarket Multivendor: 1.4.1")*

Hi,

The "show selected" does not work like you tough.

It uses the "min per order" and "max per order" values to fill the drop down box.
It does not use the prices of the quantity.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84Njk3MDMtc2hvdy1zZWxlY3QtZG9lc250LXJlc3BlY3QtZXhpc3RpbmctcXVhbnRpdHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Flooder](/forum/user/23280-flooder "View Flooder's Profile")**
- [![Flooder's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar23280.png)](/forum/user/23280-flooder "View Flooder's Profile") Topic Author
- [ Offline](/forum/user/23280-flooder)

Less More

- Posts: 263
- Thank you received: 11
-
-

12 years 4 months ago [\#164131](#164131) by [Flooder](/forum/user/23280-flooder "View Flooder's Profile")  Replied by *[Flooder](/forum/user/23280-flooder "View Flooder's Profile")* on topic *[« show select » doesn't respect existing quantity](/forum/3-bug-report/869703-show-select-doesnt-respect-existing-quantity#164131 "Hello there,  When we choose « Show select » for a product in the field « Quantity layout on product page », the dropbox on the product page doesn't respect existing price quantity.  I have this prices in my product (for example): 5000 for 100 $ 20000 for 200 $ 100000 for 300 $  But on the product page, we see 5000, 10000, 15000, etc. in the dropbox...  Thanks  Hikashop 2.3.2 Joomla 3.3.0 HikaMarket Multivendor: 1.4.1")*

Here is my code to solve this problem. I would need it.

In the show_quantity.php, change this : Code:

case 'show_select': if($min_quantity == 0) $min_quantity = 1; if($max_quantity == 0) $max_quantity = (int)$min_quantity * 15; ?&gt; &lt;div class="hikashop_product_quantity_div hikashop_product_quantity_input_div_select"&gt; &lt;select id="hikashop_product_quantity_select_&lt;?php echo $i; ?&gt;" onchange="var id = this.id.replace('select','field'); document.getElementById(id).value = this.value;"&gt; &lt;?php for($j = $min_quantity; $j &lt;= $max_quantity; $j += $min_quantity){ echo '&lt;option value="'.$j.'"&gt;'.$j.'&lt;/option&gt;'; } ?&gt; &lt;/select&gt; &lt;input id="hikashop_product_quantity_field_&lt;?php echo $i; ?&gt;" type="hidden" value="&lt;?php echo JRequest::getInt('quantity',$min_quantity); ?&gt;" class="hikashop_product_quantity_field" name="quantity" onchange="hikashopCheckQuantityChange('hikashop_product_quantity_field_&lt;?php echo $i; ?&gt;',&lt;?php echo $max_quantity; ?&gt;,&lt;?php echo $min_quantity; ?&gt;);" /&gt; &lt;/div&gt; &lt;div class="hikashop_product_quantity_div hikashop_product_quantity_add_to_cart_div hikashop_product_quantity_add_to_cart_div_select"&gt; &lt;?php echo $html; ?&gt; &lt;/div&gt; &lt;?php dumpMessage('show_select'); break;

For this : Code:

case 'show_select': //if($min_quantity == 0) // $min_quantity = 1; //if($max_quantity == 0) // $max_quantity = (int)$min_quantity * 15; //dump($this,'this'); $db = JFactory::getDBO(); $zone = hikashop_getZone(); $currency = hikashop_getCurrency(); $product_id = hikashop_getCID(); $query= 'SELECT * FROM '.hikashop_table('product').' WHERE product_id='.$product_id; $db-&gt;setQuery($query); $productRows = $db-&gt;loadObjectList(); $class = hikashop_get('class.currency'); $class-&gt;getListingPrices($productRows, $zone, $currency ); $first = true; $tableauMinQuantity = array(); foreach ($productRows[0]-&gt;prices as $price) { $min = $price-&gt;price_min_quantity; if ($min == 0) $min = 1; if (!in_array($min, $tableauMinQuantity)) $tableauMinQuantity[] = $min; } asort($tableauMinQuantity); dump($tableauMinQuantity); ?&gt; &lt;div class="hikashop_product_quantity_div hikashop_product_quantity_input_div_select"&gt; &lt;select id="hikashop_product_quantity_select_&lt;?php echo $i; ?&gt;" onchange="var id = this.id.replace('select','field'); document.getElementById(id).value = this.value;"&gt; &lt;?php //for($j = $min_quantity; $j &lt;= $max_quantity; $j += $min_quantity){ // echo '&lt;option value="'.$j.'"&gt;'.$j.'&lt;/option&gt;'; //} foreach ($tableauMinQuantity as $num) { echo '&lt;option value="' . (string)$num . '"&gt;' . (string)$num . '&lt;/option&gt;'; } ?&gt; &lt;/select&gt; &lt;input id="hikashop_product_quantity_field_&lt;?php echo $i; ?&gt;" type="hidden" value="&lt;?php echo JRequest::getInt('quantity',$min_quantity); ?&gt;" class="hikashop_product_quantity_field" name="quantity" onchange="hikashopCheckQuantityChange('hikashop_product_quantity_field_&lt;?php echo $i; ?&gt;',&lt;?php echo $max_quantity; ?&gt;,&lt;?php echo $min_quantity; ?&gt;);" /&gt; &lt;/div&gt; &lt;div class="hikashop_product_quantity_div hikashop_product_quantity_add_to_cart_div hikashop_product_quantity_add_to_cart_div_select"&gt; &lt;?php echo $html; ?&gt; &lt;/div&gt; &lt;?php dumpMessage('show_select'); break;

Here is a screenshot :

[ ![he41def8.png](/forum/attachment/18458) ](/forum/attachment/18458 "he41def8.png")

It is great! ah ah ah

- [ ![he41def8.png](/forum/attachment/18458) ](/forum/attachment/18458 "he41def8.png") [ ](/forum/attachment/18458?download=1 "he41def8.png")

The following user(s) said Thank You: [Jerome](/forum/user/80-jerome "View Jerome's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84Njk3MDMtc2hvdy1zZWxlY3QtZG9lc250LXJlc3BlY3QtZXhpc3RpbmctcXVhbnRpdHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4080
-
- [](http://obsi.dev)
-

12 years 4 months ago [\#164133](#164133) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[« show select » doesn't respect existing quantity](/forum/3-bug-report/869703-show-select-doesnt-respect-existing-quantity#164133 "Hello there,  When we choose « Show select » for a product in the field « Quantity layout on product page », the dropbox on the product page doesn't respect existing price quantity.  I have this prices in my product (for example): 5000 for 100 $ 20000 for 200 $ 100000 for 300 $  But on the product page, we see 5000, 10000, 15000, etc. in the dropbox...  Thanks  Hikashop 2.3.2 Joomla 3.3.0 HikaMarket Multivendor: 1.4.1")*

Hi,

That's the power of view override. You can create your own logical/features in your views ![:)](/media/kunena/emoticons/3.png ":)")
I'll talk with the rest of the team about your quantity selector. Maybe we can add or share this new "quantity selection".

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84Njk3MDMtc2hvdy1zZWxlY3QtZG9lc250LXJlc3BlY3QtZXhpc3RpbmctcXVhbnRpdHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Flooder](/forum/user/23280-flooder "View Flooder's Profile")**
- [![Flooder's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar23280.png)](/forum/user/23280-flooder "View Flooder's Profile") Topic Author
- [ Offline](/forum/user/23280-flooder)

Less More

- Posts: 263
- Thank you received: 11
-
-

12 years 4 months ago [\#164188](#164188) by [Flooder](/forum/user/23280-flooder "View Flooder's Profile")  Replied by *[Flooder](/forum/user/23280-flooder "View Flooder's Profile")* on topic *[« show select » doesn't respect existing quantity](/forum/3-bug-report/869703-show-select-doesnt-respect-existing-quantity#164188 "Hello there,  When we choose « Show select » for a product in the field « Quantity layout on product page », the dropbox on the product page doesn't respect existing price quantity.  I have this prices in my product (for example): 5000 for 100 $ 20000 for 200 $ 100000 for 300 $  But on the product page, we see 5000, 10000, 15000, etc. in the dropbox...  Thanks  Hikashop 2.3.2 Joomla 3.3.0 HikaMarket Multivendor: 1.4.1")*

Great! I like when you use my code!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84Njk3MDMtc2hvdy1zZWxlY3QtZG9lc250LXJlc3BlY3QtZXhpc3RpbmctcXVhbnRpdHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.120 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
