Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何仅显示相关产品区域中产品的缩略图,我当前的代码也显示链接,即image带有产品名称的 href 标题的标签。我只想显示缩略图
image
<?php foreach($this->product->customfieldsRelatedProducts as $field) { echo $field->display; } ?>
我认为代码会帮助你。
<?php $image_dir = JURI::root()."images/"; foreach($this->product->customfieldsRelatedProducts as $field) { echo $field->display; ?> <img src="<?php echo $image_dir.$field->image; ?>" alt="<?php echo $field->title ?>" /> <?php } ?>