Hello,
I'm trying to display the first image of each product's repeatable gallery as a thumbnail to use in the cart.
I've followed the advice given in another topic here: https://www.couchcms.com/forum/viewtopic.php?f=4&t=9245
However the result doesn't show anything at all. If I enclose the code in the pages masterpage tag it works but then shows all product thumbnails instead of just the one relating the product.
The code in shop.php where I have all my products listed.
The code to display the products in cart.php.
I'm trying to display the first image of each product's repeatable gallery as a thumbnail to use in the cart.
I've followed the advice given in another topic here: https://www.couchcms.com/forum/viewtopic.php?f=4&t=9245
However the result doesn't show anything at all. If I enclose the code in the pages masterpage tag it works but then shows all product thumbnails instead of just the one relating the product.
The code in shop.php where I have all my products listed.
- Code: Select all
<cms:editable name='group_images' label='Images' type='group' order='20' />
<cms:repeatable name='product_images' label='Gallery Images' stacked_layout='1' group='group_images'>
<cms:editable
name='prod_img'
label='Image'
show_preview='1'
preview_width='150'
type='image' />
</cms:repeatable>
The code to display the products in cart.php.
- Code: Select all
<cms:pages masterpage='shop.php'>
<cms:show_repeatable "product_images">
<cms:if k_count='1' >
<cms:if prod_img>
<a href="<cms:show link />" class="cart-thumb">
<img src="<cms:show prod_img />" width="70" height="64" alt="<cms:show title />">
</a>
</cms:if>
</cms:if>
</cms:show_repeatable>
</cms:pages>