Price per unit and price per meter

  • Posts: 13
  • Thank you received: 0
13 years 3 months ago #5788

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.

  • Posts: 13
  • Thank you received: 0
13 years 3 months ago #5789

Per unit and per meter of course...

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

  • Posts: 81639
  • Thank you received: 13087
  • MODERATOR
13 years 3 months ago #5793

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.

  • Posts: 1
  • Thank you received: 0
11 years 7 months ago #65541

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.

  • Posts: 81639
  • Thank you received: 13087
  • MODERATOR
11 years 7 months ago #65731

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.058 seconds
Powered by Kunena Forum