Author Topic: $field->display for related products is rubbish  (Read 1664 times)

AbsoluteVM

  • Jr. Member
  • **
  • Posts: 85
$field->display for related products is rubbish
« on: June 13, 2012, 11:35:58 am »
I'm probably not the first one to find the related products template a little narrow minded.

I want to be able to have a custom HTML structure for my related products, yet all the template contains is field->display which outputs HTML from the core.

Has anyone got an answer for me, as this seems unfinished and completely different to how the rest of VM is done?

Is there a way I can override field->display's output, as it looks like I am going to have to make a custom php function to select related products?

exolut

  • Beginner
  • *
  • Posts: 8
Re: $field->display for related products is rubbish
« Reply #1 on: June 29, 2012, 18:39:29 pm »
I also need to know! pleaseee help!!!

fire2

  • Beginner
  • *
  • Posts: 41
Re: $field->display for related products is rubbish
« Reply #2 on: November 30, 2012, 10:52:44 am »
Did you ever figure this out? I need this too!
currently using:
Joomla 2.5.8
VM 2.0.14

AbsoluteVM

  • Jr. Member
  • **
  • Posts: 85
Re: $field->display for related products is rubbish
« Reply #3 on: February 05, 2013, 11:58:16 am »
Hello,

I actually didn't bother and just worked around this. You can't really access any of the objects without some high PHP knowledge, they aren't immediately available to you.

At this present time, I guess the related products scope is fairly limited.

okmit

  • Beginner
  • *
  • Posts: 1
Re: $field->display for related products is rubbish
« Reply #4 on: March 28, 2013, 12:52:38 pm »
It's not that easy as it should be, but you can menage it by editing component/com_virtuemart/models/customfield/customfields.php


line 986 -    public function displayProductCustomfieldFE (&$product, $customfield, $row = '')

there is a switch section there you can edit case 'R': to achive your goal

I wanted to have only image in related products so i have changed
Code: [Select]
return JHTML::link (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $value . '&virtuemart_category_id=' . $related->virtuemart_category_id), $thumb   . $related->product_name, array('title' => $related->product_name));
break;

to

Code: [Select]
return JHTML::link (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $value . '&virtuemart_category_id=' . $related->virtuemart_category_id), $thumb , array('title' => $related->product_name));
break;