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

#   Show product price by different units!

##

- **[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: 86575
- Thank you received: 14318
-
-

9 years 5 months ago [\#270248](#270248) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Show product price by different units!](/forum/26-product-category-display/878159-show-product-price-by-different-units?start=20#270248 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 2.5.28 -- Browser(s) name and version -- : Mozilla  Hi, We are now testing Hikashop and some other Online shop solutions, for now we are in conflict with Hikashop setting up prices. We have successfully export items from home made shop and import to Hikashop, create categories etc.  Now, we have problems how to adjust to show product price with different units. Only what we can see now is &quot;Per unit&quot; - all products price is per unit.  What we need? For example we have Kiwi (10 sort), Tomato (5 sort) and Lemon (3 sort) we are selling  - Kiwi one by one - so price will be 1 Kiwi is 1$ (there is no opportunity to buy 1kg Kiwi, only price per quantity - one Kiwi is 30 grams one is 40 etc - so weight is not important here, only quantity)  - Tomato - per KG (so type how many kg and multiple with price - one by one is not important)  - Lemon - per box (so 1 box contains 5 Lemons and some boxes are 1 kg some 1,2 kg etc, but buyer can type just how many boxes of Lemon he want)  There is around 800 items in Hikashop, so is there oportunity to export all items and in Excel create in .csv file one column and set article X kg, aricle Y unit, article Z box etc  If it is possible, please write down how to make this in details.  Thank you")*

Hi,

You can't restrict custom fields to products and to categories are the same time. If you do. This means that the custom field will only display for the products selected if they are in these categories. So it not logical for you to do that since then you can simply select the products you want.
So in your case, you want to remove the selected products to only have categories selected in your custom field and it should work like you want.

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

- **[Formidog](/forum/user/33871-formidog "View Formidog's Profile")**
- [![Formidog's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar33871.jpg)](/forum/user/33871-formidog "View Formidog's Profile")
- [ Offline](/forum/user/33871-formidog)

Less More

- Posts: 117
- Thank you received: 6
-
-
-
-

6 years 8 months ago -  6 years 8 months ago [\#316691](#316691) by [Formidog](/forum/user/33871-formidog "View Formidog's Profile")  Replied by *[Formidog](/forum/user/33871-formidog "View Formidog's Profile")* on topic *[Show product price by different units!](/forum/26-product-category-display/878159-show-product-price-by-different-units?start=20#316691 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 2.5.28 -- Browser(s) name and version -- : Mozilla  Hi, We are now testing Hikashop and some other Online shop solutions, for now we are in conflict with Hikashop setting up prices. We have successfully export items from home made shop and import to Hikashop, create categories etc.  Now, we have problems how to adjust to show product price with different units. Only what we can see now is &quot;Per unit&quot; - all products price is per unit.  What we need? For example we have Kiwi (10 sort), Tomato (5 sort) and Lemon (3 sort) we are selling  - Kiwi one by one - so price will be 1 Kiwi is 1$ (there is no opportunity to buy 1kg Kiwi, only price per quantity - one Kiwi is 30 grams one is 40 etc - so weight is not important here, only quantity)  - Tomato - per KG (so type how many kg and multiple with price - one by one is not important)  - Lemon - per box (so 1 box contains 5 Lemons and some boxes are 1 kg some 1,2 kg etc, but buyer can type just how many boxes of Lemon he want)  There is around 800 items in Hikashop, so is there oportunity to export all items and in Excel create in .csv file one column and set article X kg, aricle Y unit, article Z box etc  If it is possible, please write down how to make this in details.  Thank you")*

This topic is almost 5 years old but helpfull.

We also sell products in different sorts of units and I managed to get the right display... with the 1st price.

But: how to display the right unit in the other prices?
[see attached screenshot]

plz help with code

Greetz,
[ ![Schermafbeelding2020-03-19om18.42.30&#95;2020-03-19.png](/forum/attachment/48909) ](/forum/attachment/48909 "...2020-03-19.png")

- [ ![Schermafbeelding2020-03-19om18.42.30&#95;2020-03-19.png](/forum/attachment/48909) ](/forum/attachment/48909 "...2020-03-19.png") [ ](/forum/attachment/48909?download=1 "...2020-03-19.png")

Last edit: 6 years 8 months ago by [Formidog](/forum/user/33871-formidog "View Formidog's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzgxNTktc2hvdy1wcm9kdWN0LXByaWNlLWJ5LWRpZmZlcmVudC11bml0cz9zdGFydD0yMCZ0bXBsPW1hcmtkb3du) 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: 86575
- Thank you received: 14318
-
-

6 years 8 months ago [\#316693](#316693) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Show product price by different units!](/forum/26-product-category-display/878159-show-product-price-by-different-units?start=20#316693 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 2.5.28 -- Browser(s) name and version -- : Mozilla  Hi, We are now testing Hikashop and some other Online shop solutions, for now we are in conflict with Hikashop setting up prices. We have successfully export items from home made shop and import to Hikashop, create categories etc.  Now, we have problems how to adjust to show product price with different units. Only what we can see now is &quot;Per unit&quot; - all products price is per unit.  What we need? For example we have Kiwi (10 sort), Tomato (5 sort) and Lemon (3 sort) we are selling  - Kiwi one by one - so price will be 1 Kiwi is 1$ (there is no opportunity to buy 1kg Kiwi, only price per quantity - one Kiwi is 30 grams one is 40 etc - so weight is not important here, only quantity)  - Tomato - per KG (so type how many kg and multiple with price - one by one is not important)  - Lemon - per box (so 1 box contains 5 Lemons and some boxes are 1 kg some 1,2 kg etc, but buyer can type just how many boxes of Lemon he want)  There is around 800 items in Hikashop, so is there oportunity to export all items and in Excel create in .csv file one column and set article X kg, aricle Y unit, article Z box etc  If it is possible, please write down how to make this in details.  Thank you")*

Hi,

In the product / listing_price.php view file, you'll fine this line: Code:

echo '&lt;span class="hikashop_product_price_per_unit_x"&gt;'.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price-&gt;price_min_quantity).'&lt;/span&gt;';

You could change it to : Code:

if(isset($this-&gt;element-&gt;main)) echo '&lt;span class="hikashop_product_price_per_unit_x"&gt;'.JText::sprintf($this-&gt;row-&gt;salemethod.'_AT_LEAST_X_BOUGHT',$price-&gt;price_min_quantity).'&lt;/span&gt;'; elseif(isset($this-&gt;row)) echo '&lt;span class="hikashop_product_price_per_unit_x"&gt;'.JText::sprintf($this-&gt;row-&gt;salemethod.'_AT_LEAST_X_BOUGHT',$price-&gt;price_min_quantity).'&lt;/span&gt;'; else echo '&lt;span class="hikashop_product_price_per_unit_x"&gt;'.JText::sprintf($this-&gt;row-&gt;salemethod.'_AT_LEAST_X_BOUGHT',$price-&gt;price_min_quantity).'&lt;/span&gt;';

And then you can add your translation overrides like:
PER_PACK_AT_LEAST_X_BOUGHT="per pack for buying at least %s"
where you would change "per pack" and "PER_PACK" based on what you have in your salemethod custom product field.

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

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