News:

Support the VirtueMart project and become a member

Main Menu

$field->display for related products is rubbish

Started by AbsoluteVM, June 13, 2012, 11:35:58 AM

Previous topic - Next topic

AbsoluteVM

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


fire2

currently using:
Joomla 2.5.8
VM 2.0.14

AbsoluteVM

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

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
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

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;