Skip to main content

Price per unit and price per meter

More
15 years 8 months ago #5788 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

Please Log in or Create an account to join the conversation.

More
15 years 8 months ago #5789 by nina2011
Per unit and per meter of course...

Please Log in or Create an account to join the conversation.

More
15 years 8 months ago #5793 by nicolas
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');
}

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #65541 by b3n.maclean
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

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #65731 by nicolas
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');
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.155 seconds
Powered by Kunena Forum