News:

Looking for documentation? Take a look on our wiki

Main Menu

Looking for the product image URL (PHP)

Started by EvanGR, October 18, 2013, 13:09:31 PM

Previous topic - Next topic

EvanGR

Hello people,

I am modifying a template to add product metadata in the header. I need to add the open graph 'og:image' tag so I need a full-clean URL string to the main product image. I can't get displayMediaFull() to give me what I want, it includes the <img> HTML element. Any ideas?

Thank you!


[joomla 2.4.14, VM 2.0.24]

Jumbo!

Try this in product details page:

<?php echo $this->product->images[0]->file_url?>

In product listing pages within the foreach loop:

<?php echo $product->images[0]->file_url?>

EvanGR


Jumbo!