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

#   No different kind of units in the frontend

##

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

Less More

- Posts: 20
- Thank you received: 0
-
-

12 years 9 months ago [\#144820](#144820) by [ronsnijder](/forum/user/9658-ronsnijder "View ronsnijder's Profile")  *[No different kind of units in the frontend](/forum/26-product-category-display/866030-no-different-kind-of-units-in-the-frontend#144820 "-- url of the page with the problem -- : not visible because of development -- HikaShop version -- : 2.3.0 -- Joomla version -- : 2.5.18 -- PHP version -- : 5.4.16 -- Browser(s) name and version -- : Firefox 25.0.1  I need to display different kind of units in the frontend, e.g. per person, per piece and more  I have made a custom field, which is displayed in my article screen. But what do I have to change in the listing&#95;price.php file in order to display the units i have entered?  I am no php programmer, so could anybody help me with this?")* was created by *[ronsnijder](/forum/user/9658-ronsnijder "View ronsnijder's Profile")*

-- url of the page with the problem -- : not visible because of development
-- HikaShop version -- : 2.3.0
-- Joomla version -- : 2.5.18
-- PHP version -- : 5.4.16
-- Browser(s) name and version -- : Firefox 25.0.1

I need to display different kind of units in the frontend, e.g. per person, per piece and more

I have made a custom field, which is displayed in my article screen. But what do I have to change in the listing_price.php file in order to display the units i have entered?

I am no php programmer, so could anybody help me with this?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjYwMzAtbm8tZGlmZmVyZW50LWtpbmQtb2YtdW5pdHMtaW4tdGhlLWZyb250ZW5kP3RtcGw9bWFya2Rvd24=) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

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

12 years 9 months ago [\#144899](#144899) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[No different kind of units in the frontend](/forum/26-product-category-display/866030-no-different-kind-of-units-in-the-frontend#144899 "-- url of the page with the problem -- : not visible because of development -- HikaShop version -- : 2.3.0 -- Joomla version -- : 2.5.18 -- PHP version -- : 5.4.16 -- Browser(s) name and version -- : Firefox 25.0.1  I need to display different kind of units in the frontend, e.g. per person, per piece and more  I have made a custom field, which is displayed in my article screen. But what do I have to change in the listing&#95;price.php file in order to display the units i have entered?  I am no php programmer, so could anybody help me with this?")*

It's explained in the "I sell packed products, how can I change "each" text in the product page ?" section of our FAQ:
[ www.hikashop.com/support/support/documen...on/106-faq.html#tran](http://www.hikashop.com/support/support/documentation/106-faq.html#tran)

> In the menu Display -&gt; Views, edit the product / listing\_price.php file. In this file, replace:
> echo JText::\_('PER\_UNIT');
>
> By:
> if(isset($this-&gt;element-&gt;main)) echo JText::\_($this-&gt;element-&gt;main-&gt;salemethod);
> elseif(isset($this-&gt;row)) echo JText::\_($this-&gt;row-&gt;salemethod);
> else echo JText::\_($this-&gt;element-&gt;salemethod);
>
> And to finish, you just have to create a new translation, in Display -&gt; Languages, edit your language file and add in the override area :
> PER\_PACK="each pack"
>
> This translation is an example, but you can write what you want.

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

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

Less More

- Posts: 20
- Thank you received: 0
-
-

12 years 9 months ago [\#144983](#144983) by [ronsnijder](/forum/user/9658-ronsnijder "View ronsnijder's Profile")  Replied by *[ronsnijder](/forum/user/9658-ronsnijder "View ronsnijder's Profile")* on topic *[No different kind of units in the frontend](/forum/26-product-category-display/866030-no-different-kind-of-units-in-the-frontend#144983 "-- url of the page with the problem -- : not visible because of development -- HikaShop version -- : 2.3.0 -- Joomla version -- : 2.5.18 -- PHP version -- : 5.4.16 -- Browser(s) name and version -- : Firefox 25.0.1  I need to display different kind of units in the frontend, e.g. per person, per piece and more  I have made a custom field, which is displayed in my article screen. But what do I have to change in the listing&#95;price.php file in order to display the units i have entered?  I am no php programmer, so could anybody help me with this?")*

Hi,

I saw that post you are referring to, but there is a difference in files I think, because echo JText::\_('PER\_UNIT'); is not there in my version of the file. Instead of that, this is what I find:

echo '&lt;/span&gt; ';
if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $this-&gt;params-&gt;get('per_unit',1)){
if($price-&gt;price_min_quantity&gt;1){
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;';
}else{
echo '&lt;span class="hikashop_product_price_per_unit"&gt;'.JText::_('PER_UNIT').'&lt;/span&gt;';
}
}

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 9 months ago [\#144998](#144998) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[No different kind of units in the frontend](/forum/26-product-category-display/866030-no-different-kind-of-units-in-the-frontend#144998 "-- url of the page with the problem -- : not visible because of development -- HikaShop version -- : 2.3.0 -- Joomla version -- : 2.5.18 -- PHP version -- : 5.4.16 -- Browser(s) name and version -- : Firefox 25.0.1  I need to display different kind of units in the frontend, e.g. per person, per piece and more  I have made a custom field, which is displayed in my article screen. But what do I have to change in the listing&#95;price.php file in order to display the units i have entered?  I am no php programmer, so could anybody help me with this?")*

Hi,
In your case you'll just have to replace the line : Code:

echo '&lt;span class="hikashop_product_price_per_unit"&gt;'.JText::_('PER_UNIT').'&lt;/span&gt;';

By : Code:

if(isset($this-&gt;element-&gt;main)) echo JText::_($this-&gt;element-&gt;main-&gt;salemethod); elseif(isset($this-&gt;row)) echo JText::_($this-&gt;row-&gt;salemethod); else echo JText::_($this-&gt;element-&gt;salemethod);

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

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

Less More

- Posts: 20
- Thank you received: 0
-
-

12 years 9 months ago [\#145003](#145003) by [ronsnijder](/forum/user/9658-ronsnijder "View ronsnijder's Profile")  Replied by *[ronsnijder](/forum/user/9658-ronsnijder "View ronsnijder's Profile")* on topic *[No different kind of units in the frontend](/forum/26-product-category-display/866030-no-different-kind-of-units-in-the-frontend#145003 "-- url of the page with the problem -- : not visible because of development -- HikaShop version -- : 2.3.0 -- Joomla version -- : 2.5.18 -- PHP version -- : 5.4.16 -- Browser(s) name and version -- : Firefox 25.0.1  I need to display different kind of units in the frontend, e.g. per person, per piece and more  I have made a custom field, which is displayed in my article screen. But what do I have to change in the listing&#95;price.php file in order to display the units i have entered?  I am no php programmer, so could anybody help me with this?")*

Super. It works just fine.

Thank you for your time and effort.

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

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

Less More

- Posts: 20
- Thank you received: 0
-
-

12 years 9 months ago [\#145016](#145016) by [ronsnijder](/forum/user/9658-ronsnijder "View ronsnijder's Profile")  Replied by *[ronsnijder](/forum/user/9658-ronsnijder "View ronsnijder's Profile")* on topic *[No different kind of units in the frontend](/forum/26-product-category-display/866030-no-different-kind-of-units-in-the-frontend#145016 "-- url of the page with the problem -- : not visible because of development -- HikaShop version -- : 2.3.0 -- Joomla version -- : 2.5.18 -- PHP version -- : 5.4.16 -- Browser(s) name and version -- : Firefox 25.0.1  I need to display different kind of units in the frontend, e.g. per person, per piece and more  I have made a custom field, which is displayed in my article screen. But what do I have to change in the listing&#95;price.php file in order to display the units i have entered?  I am no php programmer, so could anybody help me with this?")*

This works fine now, but unfortunatelyI now see that the following "problem" occurs in the frontend when it comes to displaying the current availability of the item. It only shows "articles in stock" and not such thing as "seats available" of "sets available"

Where do I have to change this?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjYwMzAtbm8tZGlmZmVyZW50LWtpbmQtb2YtdW5pdHMtaW4tdGhlLWZyb250ZW5kP3RtcGw9bWFya2Rvd24=) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

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

12 years 9 months ago [\#145096](#145096) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[No different kind of units in the frontend](/forum/26-product-category-display/866030-no-different-kind-of-units-in-the-frontend#145096 "-- url of the page with the problem -- : not visible because of development -- HikaShop version -- : 2.3.0 -- Joomla version -- : 2.5.18 -- PHP version -- : 5.4.16 -- Browser(s) name and version -- : Firefox 25.0.1  I need to display different kind of units in the frontend, e.g. per person, per piece and more  I have made a custom field, which is displayed in my article screen. But what do I have to change in the listing&#95;price.php file in order to display the units i have entered?  I am no php programmer, so could anybody help me with this?")*

You can change any text in HikaShop with a translation override:
[ www.hikashop.com/download/languages.html#modify](http://www.hikashop.com/download/languages.html#modify)

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

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