- Posts: 20
- Thank you received: 0
No different kind of units in the frontend
- ronsnijder
-
Topic Author
- Offline
-- 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 or Create an account to join the conversation.
www.hikashop.com/support/support/documen...on/106-faq.html#tran
In the menu Display -> Views, edit the product / listing_price.php file. In this file, replace:
echo JText::_('PER_UNIT');
By:
if(isset($this->element->main)) echo JText::_($this->element->main->salemethod);
elseif(isset($this->row)) echo JText::_($this->row->salemethod);
else echo JText::_($this->element->salemethod);
And to finish, you just have to create a new translation, in Display -> 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 or Create an account to join the conversation.
- ronsnijder
-
Topic Author
- Offline
- Posts: 20
- Thank you received: 0
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 '</span> ';
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){
if($price->price_min_quantity>1){
echo '<span class="hikashop_product_price_per_unit_x">'.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity).'</span>';
}else{
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
}
}
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
In your case you'll just have to replace the line :
Please Log in or Create an account to join the conversation.
- ronsnijder
-
Topic Author
- Offline
- Posts: 20
- Thank you received: 0
Thank you for your time and effort.
Please Log in or Create an account to join the conversation.
- ronsnijder
-
Topic Author
- Offline
- Posts: 20
- Thank you received: 0
Where do I have to change this?
Please Log in or Create an account to join the conversation.
www.hikashop.com/download/languages.html#modify
Please Log in or Create an account to join the conversation.