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

#   Displaying custom field on product page

##

- **[apeelapan](/forum/user/29536-apeelapan "View apeelapan's Profile")**
- [![apeelapan's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar29536.jpg)](/forum/user/29536-apeelapan "View apeelapan's Profile") Topic Author
- [ Offline](/forum/user/29536-apeelapan)

Less More

- Posts: 6
- Thank you received: 1
-
-

12 years 7 months ago [\#147658](#147658) by [apeelapan](/forum/user/29536-apeelapan "View apeelapan's Profile")  *[Displaying custom field on product page](/forum/26-product-category-display/866506-displaying-custom-field-on-product-page#147658 "-- HikaShop version -- : Essential 2.2.3 -- Joomla version -- : 3.2.1 -- PHP Version 5.3.27  I have recreated 2 custom fields (column name: country&#95;of&#95;origin &amp; unit&#95;of&#95;measurement) showing additional information of products. Hikashop displays them in a table under the &quot;add to cart&quot; button on the product detail page.  I would like to move the content of the unit&#95;of&#95;measurement to replace the word &quot;each&quot; that is located after the price. How can I do that?")* was created by *[apeelapan](/forum/user/29536-apeelapan "View apeelapan's Profile")*

-- HikaShop version -- : Essential 2.2.3
-- Joomla version -- : 3.2.1
-- PHP Version 5.3.27

I have recreated 2 custom fields (column name: country_of_origin &amp; unit_of_measurement) showing additional information of products. Hikashop displays them in a table under the "add to cart" button on the product detail page.

I would like to move the content of the unit_of_measurement to replace the word "each" that is located after the price. How can I do that?

- [ ![h542a1de.jpg](/forum/attachment/15913) ](/forum/attachment/15913 "h542a1de.jpg") [ ](/forum/attachment/15913?download=1 "h542a1de.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjY1MDYtZGlzcGxheWluZy1jdXN0b20tZmllbGQtb24tcHJvZHVjdC1wYWdlP3RtcGw9bWFya2Rvd24=) 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 7 months ago [\#147662](#147662) 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 *[Displaying custom field on product page](/forum/26-product-category-display/866506-displaying-custom-field-on-product-page#147662 "-- HikaShop version -- : Essential 2.2.3 -- Joomla version -- : 3.2.1 -- PHP Version 5.3.27  I have recreated 2 custom fields (column name: country&#95;of&#95;origin &amp; unit&#95;of&#95;measurement) showing additional information of products. Hikashop displays them in a table under the &quot;add to cart&quot; button on the product detail page.  I would like to move the content of the unit&#95;of&#95;measurement to replace the word &quot;each&quot; that is located after the price. How can I do that?")*

Hi,
I think that you'll probably find your answer through that [ thread](http://www.hikashop.com/forum/4-how-to/51395-change-per-unit-into-per-set-per-length-per-reel.html#51475) ![:)](/media/kunena/emoticons/8.png ":)").

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

- **[apeelapan](/forum/user/29536-apeelapan "View apeelapan's Profile")**
- [![apeelapan's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar29536.jpg)](/forum/user/29536-apeelapan "View apeelapan's Profile") Topic Author
- [ Offline](/forum/user/29536-apeelapan)

Less More

- Posts: 6
- Thank you received: 1
-
-

12 years 7 months ago [\#147729](#147729) by [apeelapan](/forum/user/29536-apeelapan "View apeelapan's Profile")  Replied by *[apeelapan](/forum/user/29536-apeelapan "View apeelapan's Profile")* on topic *[Displaying custom field on product page](/forum/26-product-category-display/866506-displaying-custom-field-on-product-page#147729 "-- HikaShop version -- : Essential 2.2.3 -- Joomla version -- : 3.2.1 -- PHP Version 5.3.27  I have recreated 2 custom fields (column name: country&#95;of&#95;origin &amp; unit&#95;of&#95;measurement) showing additional information of products. Hikashop displays them in a table under the &quot;add to cart&quot; button on the product detail page.  I would like to move the content of the unit&#95;of&#95;measurement to replace the word &quot;each&quot; that is located after the price. How can I do that?")*

Hi,

The thread is useful, thank you. The way I solve my problem is that:

Create a "Custom field" in Hikashop &gt; Display &gt; Custom fields with the table "Product" with the column name "unit_of_measurement";

The unit_of_measurement custom field can now be edited in the product configuration page of each product.

Then in Hikashop &gt; Display &gt; Views, edit the view: "product / listing_price.php" in the good template.
Find the below code at about line 162 Code:

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

and replace it with
Code:

else if($this-&gt;element-&gt;unit_of_measurement==null){ echo '&lt;span class="hikashop_product_price_per_unit"&gt;'.JText::_('PER_UNIT').'&lt;/span&gt;'; } else{ echo '&lt;span class="hikashop_product_price_per_unit"&gt;'.$this-&gt;element-&gt;unit_of_measurement.'&lt;/span&gt;'; }

The following user(s) said Thank You: [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjY1MDYtZGlzcGxheWluZy1jdXN0b20tZmllbGQtb24tcHJvZHVjdC1wYWdlP3RtcGw9bWFya2Rvd24=) 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 7 months ago [\#147773](#147773) 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 *[Displaying custom field on product page](/forum/26-product-category-display/866506-displaying-custom-field-on-product-page#147773 "-- HikaShop version -- : Essential 2.2.3 -- Joomla version -- : 3.2.1 -- PHP Version 5.3.27  I have recreated 2 custom fields (column name: country&#95;of&#95;origin &amp; unit&#95;of&#95;measurement) showing additional information of products. Hikashop displays them in a table under the &quot;add to cart&quot; button on the product detail page.  I would like to move the content of the unit&#95;of&#95;measurement to replace the word &quot;each&quot; that is located after the price. How can I do that?")*

Thanks for your feedback ![:)](/media/kunena/emoticons/8.png ":)").

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

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

[](#top)
