Custom Field in the product list

  • Posts: 3
  • Thank you received: 0
12 years 17 hours ago #78873

I have added a custom field for one of my categories, this is to display price ranges "£1,200 to £2,400" which ideally I would like to replace the price with if set to 0. Any ideas on how I can achieve this on both the flypage and the product listings. I use the listing_img_desc.php file for my listings page.

Thanking you in advance,
Andy

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 14 hours ago #78901

Hi,

A category custom field would be a little bit more complicated to retrieve but you could be possible with some view modification to have such result.
The view "list_price" display the product price in several other views (like : product listing and product page)
By modify this view, you would be able to display another text when the price is "free". There is a dedicated part in the view which display the text "FREE_PRICE".
So, you can display the content of the custom field instead of displaying the "free" text.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 3
  • Thank you received: 0
12 years 7 hours ago #78953

Hello Jerome,

thanks for the reply, I realise this, but how :)

Andy

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

  • Posts: 13201
  • Thank you received: 2322
12 years 3 hours ago #78998

Hi,

In the view "product / listing_price" (HikaShop > Display > Views) replace "echo JText::_('FREE_PRICE');" by something like:

if($this->row->product_category_id == '2'){
   echo "£1,200 to £2,400";
else
   echo JText::_('FREE_PRICE');

And replace "2" by the id of your category.

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

  • Posts: 3
  • Thank you received: 0
12 years 1 hour ago #79031

Thanks Xavier,

still struggling to be honest!

I'll carry on trying as this has been an issue for a while now!

Thanks
Andy

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

Time to create page: 0.064 seconds
Powered by Kunena Forum