How do I access the image URLs (full image and thumbnail), in the template?
In the commercial template I am tweaking, there's a related.php file in sublayouts folder;
A related product is defined in there. But it gets the data like so:
$related = $viewData['related'];
$customfield = $viewData['customfield'];
$thumb = $viewData['thumb'];
The $thumb variable holds the full img element, I just want the URLs.
(I will also need to extract other product data, so please point me to a resource or documentation if there is any)
Thanks!
just enable the virtuemart debug and add
vmdebug('my viewData here',$viewData)
Quote from: Milbo on September 12, 2019, 15:42:41 PM
just enable the virtuemart debug...
For the sake of clarity, are you referring to the debug checkboxes in Shop->Advanced Settings?
yes
what are you trying to do?
Trying to get the URLs for a product's images and thumbnails.
In an older VM e-shop I could use the $product object and find the data.
This newer template uses 'sublayouts', and it's not clear to me how to reference the product's data.
If the full urls are not passed thru the $viewData object then u don't have to use the sublayout in your template
You can just use the code as u did before ( directly using the $product) - but chk first if the urls are in the $viewData
Thanks,
The sublayout is already used because it's a 3rd party template. So I am starting from there.