第一個地方,產品列表頁的產品圖片
文件位置:appdesignfrontenddefaulthelloblanktemplatecatalogproductlist.phtml
在此文件中搜 “resize”,發現有兩處,因為列表頁有 List 和 Grid 兩種顯示方式,第一個resize一般是List列表顯示中的產品圖片,第二個resize一般是 Grid 列表顯示中的產品圖片。
截取代碼片段:
$this->helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(135, 135); ?>” width=”135″ height=”135″
代碼分析:
resize(135, 135),就是設置產品圖片 尺寸的函數,以像素為單位的。width=”135″ height=”135″就是css的設置。例如,想改成 150像素寬,200像素高。那么代碼就改成
$this->helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(150, 200); ?>” width=”150″ height=”200″
第二個地方,產品詳細頁產品圖片
文件位置:appdesignfrontenddefaulthelloblanktemplatecatalogproductviewmedia.phtml
在此文件中搜“resize”。我們會找到兩處,第一處是產品大圖的,第二個是大圖下面小圖的。
代碼片段截?。?/P>
resize(265)
resize(48, 48); ?>” width=”48″ height=”48″
代碼分析:
當resize里面只有一個參數的時候就是設置寬和高是一樣的。resize(265) 等于resize(265,256)。
這頁有大量css的修飾代碼,請務必用firebug等工具檢查下,最大可以修改到多大
第三個地方,相關產品圖片,upsell產品圖片,crosssell產品圖片
相關產品圖片修改文件位置:appdesignfrontenddefaulthelloblanktemplatecatalogproductlistrelated.phtml
upsell產品圖片修改文件位置:appdesignfrontenddefaulthelloblanktemplatecatalog productlistupsell.phtml
crosssell產品圖片修改文件位置:appdesignfrontenddefaulthelloblanktemplatecheckoutcartupsell.phtml
設置圖尺寸的函數還是resize()函數,也基本和前面說的是一樣的。
第四個地方,頁面邊欄購物車里產品圖片
文件位置:appdesignfrontenddefaulthelloblanktemplatecheckoutcartitemdefault.phtml
基本就這些了,還有別的地方要改的,開啟下magento模板路徑看下,在哪里,改的方法也一樣。最重要的是,要和你的css修飾代碼配合好。
更多信息請查看IT技術專欄