Hello,
I use this code in category.php (category view) in VM 2.6.20 and it works. So the external image will be displayed.
<?php
if (!empty($product->customfields)) {
foreach ($product->customfields as $field) {
if ($field->display) {
if ($field->custom_title == "external produkt-image-url") { ?>
<img src="<?php echo $field->display ?>" />
<?php }
}
}
}
?>
Now I have updated to VM 3 (3.0.11.4).
But the code does not work in ../sublayouts/products.php
How can I read the image-url (custom field) from the database?
I can“t figure out what has changed in database.
Thanks!
I use this in my products layout
layout-position is category_swatch
<?php if (!empty($product->customfieldsSorted[category_swatch])) {
foreach ($product->customfieldsSorted[category_swatch] as $field) {
echo '<div class="swatch"><a title="'.$product->product_name.'" href="'.$product->link.$ItemidStr.'">';
echo $field->display.'</a><div class="wrap"></div></div>';
} } ?>
Thanks a lot! :)
It works!