![]() |
foreach loop product.tpl
I use custom product skins and I am trying to eliminate duplicate variant images from appearing on my custom product page
I need to change the following code so that var_image_exists =Y only when $v.image_url is unique. Any suggestions? {assign var="var_img_exists" value=""} {foreach from=$variants item=v key=vid} {if $v.is_image ne ""} {assign var="var_img_exists" value="Y"} {/if} {/foreach} |
Re: foreach loop product.tpl
That code doesn't look quite right if you want to check each image. The first line should be within the foreach loop so it gets reset each time through.
It may be difficult to tell if the images are truly unique but you may be able to compare image URLs. If you want to compare with the previous entry in the loop then store each one and compare (untested): Code:
{assign var=oldImg value=""} |
All times are GMT -8. The time now is 07:36 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.