Commit 8d0ff47c by liumengfei

修复列表页面bug

parent f419995e
...@@ -108,12 +108,14 @@ $_helper = $block->getData('outputHelper'); ...@@ -108,12 +108,14 @@ $_helper = $block->getData('outputHelper');
break; break;
} }
if (in_array($img->getData('position'),[0,1,2])) { if (in_array($img->getData('position'),[0,1,2])) {
$arr[] = $img; $arr[$img->getData('position')] = $img;
} }
} }
if (isset($arr[1])) { if (key_exists("0",$arr)) {
$hoverImg = $imageHelper->init($_product, 'product_page_image_large')->setImageFile($arr[1]->getFile())->resize($productImage->getWidth(),$productImage->getHeight())->getUrl(); $hoverImg = $imageHelper->init($_product, 'product_page_image_large')->setImageFile($arr[1]->getFile())->resize($productImage->getWidth(),$productImage->getHeight())->getUrl();
}elseif (key_exists("2",$arr)){
$hoverImg = $imageHelper->init($_product, 'product_page_image_large')->setImageFile($arr[2]->getFile())->resize($productImage->getWidth(),$productImage->getHeight())->getUrl();
} }
if ($pos != null) { if ($pos != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment