News:

Looking for documentation? Take a look on our wiki

Main Menu

How to get Vendor´s media in a view [SOLVED]

Started by carlos.alonso, January 18, 2012, 11:43:32 AM

Previous topic - Next topic

carlos.alonso

Hi,

I am writing a view and i want to display the images of a vendor, but it looks like it is not as easy as displaying the ones of a category, product, manufacturer, etc.

I have tried:
$this->vendor->images[0]->displayMediaThumb("",false);

But it doesn´t work.

I can access to the media getting the
$this->vendor->virtuemart_media_id[0]

And then with some sql statements i reach the images, but if there is another way i would prefer it as we work in team and i would like to keep the code as clear as possible.

Thanks,
   
      carlos

carlos.alonso

Hi again,

I solved it myself:

$vendor_model = $this->getModel('vendor');
$vendor_model->addImages($this->vendor);

echo $this->vendor->images[0]->displayMediaFull('', false);