- Posts: 6
- Thank you received: 1
Displaying custom field on product page
12 years 6 months ago #147658
by apeelapan
Displaying custom field on product page was created by apeelapan
-- 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 & 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?
-- Joomla version -- : 3.2.1
-- PHP Version 5.3.27
I have recreated 2 custom fields (column name: country_of_origin & 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?
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 6 months ago #147662
by Mohamed Thelji
Replied by Mohamed Thelji on topic Displaying custom field on product page
Please Log in or Create an account to join the conversation.
12 years 6 months ago #147729
by apeelapan
Replied by apeelapan on topic Displaying custom field on product page
Hi,
The thread is useful, thank you. The way I solve my problem is that:
Create a "Custom field" in Hikashop > Display > 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 > Display > Views, edit the view: "product / listing_price.php" in the good template.
Find the below code at about line 162
and replace it with
The thread is useful, thank you. The way I solve my problem is that:
Create a "Custom field" in Hikashop > Display > 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 > Display > Views, edit the view: "product / listing_price.php" in the good template.
Find the below code at about line 162
Code:
else{
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
}
and replace it with
Code:
else if($this->element->unit_of_measurement==null){
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
}
else{
echo '<span class="hikashop_product_price_per_unit">'.$this->element->unit_of_measurement.'</span>';
}
The following user(s) said Thank You: Mohamed Thelji
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 6 months ago #147773
by Mohamed Thelji
Replied by Mohamed Thelji on topic Displaying custom field on product page
Thanks for your feedback
.
Please Log in or Create an account to join the conversation.
Time to create page: 0.167 seconds