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

#   Display minimum quantity price on product page

##

- **[tjsan](/forum/user/4321-tjsan "View tjsan's Profile")**
- [![tjsan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4321-tjsan "View tjsan's Profile") Topic Author
- [ Offline](/forum/user/4321-tjsan)

Less More

- Posts: 11
- Thank you received: 0
-
-

15 years 1 week ago [\#30374](#30374) by [tjsan](/forum/user/4321-tjsan "View tjsan's Profile")  *[Display minimum quantity price on product page](/forum/4-how-to/30374-display-minimum-quantity-price-on-product-page#30374 "Hi,  I have a product with variants that have different unit prices. There is a minimum order quantity of 50 units. Is there an easy way to display the minimum order price on the product page so that it displays, for example, &quot;From £5.00 (Min order 50 units)&quot;. The displayed price would be unit price multiplied by minimum quantity.  I can see that this is possible by changing the code in the listing&#95;price view but the problem is that when the user selects a new variant, the javascript onChange() function replaces the displayed price with the unit price! Where can this be changed (or is there a better way?)")* was created by *[tjsan](/forum/user/4321-tjsan "View tjsan's Profile")*

Hi,

I have a product with variants that have different unit prices. There is a minimum order quantity of 50 units. Is there an easy way to display the minimum order price on the product page so that it displays, for example, "**From £5.00 (Min order 50 units)**". The displayed price would be unit price multiplied by minimum quantity.

I can see that this is possible by changing the code in the listing_price view but the problem is that when the user selects a new variant, the javascript onChange() function replaces the displayed price with the unit price! Where can this be changed (or is there a better way?)

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

15 years 1 week ago [\#30396](#30396) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Display minimum quantity price on product page](/forum/4-how-to/30374-display-minimum-quantity-price-on-product-page#30396 "Hi,  I have a product with variants that have different unit prices. There is a minimum order quantity of 50 units. Is there an easy way to display the minimum order price on the product page so that it displays, for example, &quot;From £5.00 (Min order 50 units)&quot;. The displayed price would be unit price multiplied by minimum quantity.  I can see that this is possible by changing the code in the listing&#95;price view but the problem is that when the user selects a new variant, the javascript onChange() function replaces the displayed price with the unit price! Where can this be changed (or is there a better way?)")*

Hi,

You should indeed do the modification in that listing_price view file. This file is used for both the default price and all the other variants prices so if you modify it properly you won't have that problem.

If you don't want that the price changes when the variant changes, you can just remove the block below in the "show" file of the product view:
&lt;div id="hikashop_product_price_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;
&lt;?php

if($this-&gt;params-&gt;get('show_price')){
$this-&gt;row =&amp; $variant;
$this-&gt;setLayout('listing_price');
echo $this-&gt;loadTemplate();
}
?&gt;
&lt;/div&gt;

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

- **[tjsan](/forum/user/4321-tjsan "View tjsan's Profile")**
- [![tjsan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4321-tjsan "View tjsan's Profile") Topic Author
- [ Offline](/forum/user/4321-tjsan)

Less More

- Posts: 11
- Thank you received: 0
-
-

15 years 1 week ago [\#30466](#30466) by [tjsan](/forum/user/4321-tjsan "View tjsan's Profile")  Replied by *[tjsan](/forum/user/4321-tjsan "View tjsan's Profile")* on topic *[Re: Display minimum quantity price on product page](/forum/4-how-to/30374-display-minimum-quantity-price-on-product-page#30466 "Hi,  I have a product with variants that have different unit prices. There is a minimum order quantity of 50 units. Is there an easy way to display the minimum order price on the product page so that it displays, for example, &quot;From £5.00 (Min order 50 units)&quot;. The displayed price would be unit price multiplied by minimum quantity.  I can see that this is possible by changing the code in the listing&#95;price view but the problem is that when the user selects a new variant, the javascript onChange() function replaces the displayed price with the unit price! Where can this be changed (or is there a better way?)")*

Thank you Nicholas.

However, I have encountered two problems.

First, although the minimum quantity is available on the default variant, it is always zero for subsequent variants. This means that when the user selects the second variant from the drop-down box, the price changes to zero (or you can use the max() function to at least get the unit price:
if($this-&gt;params-&gt;get('price_with_tax')){
echo $this-&gt;currencyHelper-&gt;format(max($price-&gt;price_value_with_tax,$price-&gt;price_value_with_tax*$price-&gt;price_min_quantity),$price-&gt;price_currency_id);
}

I even tried setting minimum order value on the variant but it is still zero in the view.

The second problem is that the mini-cart uses the same 'listing_price' code so price shown in the cart is multiplied again (because it thinks the unit price is (unit price x min quantity)).

John.

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

15 years 1 week ago [\#30481](#30481) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Display minimum quantity price on product page](/forum/4-how-to/30374-display-minimum-quantity-price-on-product-page#30481 "Hi,  I have a product with variants that have different unit prices. There is a minimum order quantity of 50 units. Is there an easy way to display the minimum order price on the product page so that it displays, for example, &quot;From £5.00 (Min order 50 units)&quot;. The displayed price would be unit price multiplied by minimum quantity.  I can see that this is possible by changing the code in the listing&#95;price view but the problem is that when the user selects a new variant, the javascript onChange() function replaces the displayed price with the unit price! Where can this be changed (or is there a better way?)")*

I'm not sure I understand the problem on your first point. Unit prices and minimum quantities setup in variants should be loaded for each variants.

fir your second point, that's indeed the case and you avoid that you could simply use such check:

if(JRequest::getVar('hikashop_front_end_main',0)){
//listings and product pages
}else{
//cart module
}

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

- **[tjsan](/forum/user/4321-tjsan "View tjsan's Profile")**
- [![tjsan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4321-tjsan "View tjsan's Profile") Topic Author
- [ Offline](/forum/user/4321-tjsan)

Less More

- Posts: 11
- Thank you received: 0
-
-

15 years 6 days ago [\#30617](#30617) by [tjsan](/forum/user/4321-tjsan "View tjsan's Profile")  Replied by *[tjsan](/forum/user/4321-tjsan "View tjsan's Profile")* on topic *[Re: Display minimum quantity price on product page](/forum/4-how-to/30374-display-minimum-quantity-price-on-product-page#30617 "Hi,  I have a product with variants that have different unit prices. There is a minimum order quantity of 50 units. Is there an easy way to display the minimum order price on the product page so that it displays, for example, &quot;From £5.00 (Min order 50 units)&quot;. The displayed price would be unit price multiplied by minimum quantity.  I can see that this is possible by changing the code in the listing&#95;price view but the problem is that when the user selects a new variant, the javascript onChange() function replaces the displayed price with the unit price! Where can this be changed (or is there a better way?)")*

Thanks again Nicolas. First problem was due to bad config on variant - sorry.

Second problem solved with your suggested code.

John.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMzc0LWRpc3BsYXktbWluaW11bS1xdWFudGl0eS1wcmljZS1vbi1wcm9kdWN0LXBhZ2U/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.068 seconds

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