- Posts: 13
- Thank you received: 0
Price per unit and price per meter
15 years 8 months ago #5788
by nina2011
Price per unit and price per meter was created by nina2011
Hi,
I need to have price per unit on some of my products and price per unit on others. I cannot find anywhere to set it on the individual products, only for the entire shop. Can I change this?
Thanks
I need to have price per unit on some of my products and price per unit on others. I cannot find anywhere to set it on the individual products, only for the entire shop. Can I change this?
Thanks
Please Log in or Create an account to join the conversation.
15 years 8 months ago #5789
by nina2011
Replied by nina2011 on topic Re: Price per unit and price per meter
Per unit and per meter of course...
Please Log in or Create an account to join the conversation.
15 years 8 months ago #5793
by nicolas
Replied by nicolas on topic Re: Price per unit and price per meter
Hi,
Not easily. If can edit the file listing_price of the view product via the menu Display->Views in order to add a condition on the display of the price so that you could change the text:
echo JText::_('PER_UNIT');
You could for example add a custom product field (available in the commercial versions via the menu Display->Custom fields) radio button to select which type of text to display. Suppose that you call that custom field "meter", you could use the code:
if($this->row->meter){
echo ' per meter';
}else{
echo JText::_('PER_UNIT');
}
Not easily. If can edit the file listing_price of the view product via the menu Display->Views in order to add a condition on the display of the price so that you could change the text:
echo JText::_('PER_UNIT');
You could for example add a custom product field (available in the commercial versions via the menu Display->Custom fields) radio button to select which type of text to display. Suppose that you call that custom field "meter", you could use the code:
if($this->row->meter){
echo ' per meter';
}else{
echo JText::_('PER_UNIT');
}
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 1
- Thank you received: 0
14 years 2 weeks ago #65541
by b3n.maclean
Replied by b3n.maclean on topic Re: Price per unit and price per meter
Hi Nicolas
I've been trying to work this out also. Could you please elaborate on the above - ie where does the above code actually go? I am very new to PHP and joomla in general. I have Hikashop Essential so should be able to do this, just not sure about the code.
Thanks
Ben
I've been trying to work this out also. Could you please elaborate on the above - ie where does the above code actually go? I am very new to PHP and joomla in general. I have Hikashop Essential so should be able to do this, just not sure about the code.
Thanks
Ben
Please Log in or Create an account to join the conversation.
14 years 2 weeks ago #65731
by nicolas
Replied by nicolas on topic Re: Price per unit and price per meter
Hi,
I explained it all in my message.
You need to edit the file listing_price of the view product via the menu Display->Views.
Then, replace the code:
echo JText::_('PER_UNIT');
by:
if($this->row->meter){
echo ' per meter';
}else{
echo JText::_('PER_UNIT');
}
I explained it all in my message.
You need to edit the file listing_price of the view product via the menu Display->Views.
Then, replace the code:
echo JText::_('PER_UNIT');
by:
if($this->row->meter){
echo ' per meter';
}else{
echo JText::_('PER_UNIT');
}
Please Log in or Create an account to join the conversation.
Time to create page: 0.155 seconds