求助!怎样获取商品原图

2016-07-07 15:00 来源:www.chinab4c.com 作者:ecshop专家

我的商品详细页集成了图片放大镜的效果。

部分代码修改如下
goods.dwt


<!-- {if $pictures}-->
<a href="{$pictures.0.img_url}"id="zoom1" class="MagicZoom" title="{$goods.goods_style_name}" onclick="window.open('gallery.php?id={$goods.goods_id}'); return false;" rel="zoom-width:310px; zoom-height:310px;disable-expand: true">
<img src="{$goods.goods_img}" alt="{$goods.goods_name|escape:html}" width=310 />
</a>
<!-- {else} -->
<img src="{$goods.goods_img}" alt="{$goods.goods_name|escape:html}" width=310/>
<!-- {/if}-->


goods_gallery.lbi

<!-- {foreach from=$pictures item=picture}-->

<li>

<a href="{$picture.img_url}" rel="zoom1" rev="{$picture.img_url}" title="{$picture.img_desc|escape:html}">
<img src="{if $picture.thumb_url}{$picture.thumb_url}{else}{$picture.img_url}{/if}" alt="{$goods.goods_name}" class="B_blue" /></a>
</li>

<!--{/foreach}-->


现在图片放大镜可以使用正常。可是试了一下,就是在后台更改商品图片(不是相册)。然后右侧所显示的图片就对应不上



点击下对应的小图,弹出的大图又恢复正常。



goods.dwt

<!-- {if $pictures}-->
<a href="{$pictures.0.img_url}"id="zoom1" class="MagicZoom" title="{$goods.goods_style_name}" onclick="window.open('gallery.php?id={$goods.goods_id}'); return false;" rel="zoom-width:310px; zoom-height:310px;disable-expand: true">
<img src="{$goods.goods_img}" alt="{$goods.goods_name|escape:html}" width=310 />
</a>
<!-- {else} -->
<img src="{$goods.goods_img}" alt="{$goods.goods_name|escape:html}" width=310/>
<!-- {/if}-->

如果将 {$pictures.0.img_url} 改成 {$goods.goods_img} 会出现弹出的图片不够大。
点击小图又恢复正常;不知道为啥。应该要怎样设置才对呢。求助大虾们,谢谢!