ShopWind多商户商城系统支持多规格,实现不同的规格不同的销售价格,第一个规格项可以使用图片展示。ShopWind早期版本(V3.4.1前)存在规格图片显示错误,可以根据此文做相应的修复。
修复方案:
1、打开shopwind服务端common\plugins\oss\qiniucs\qiniucs.plugin.php文件, 查找函数this.init = function()将代码
var aclass ,liclass,canclick,bhidden,spec_img;
aclass = liclass = canclick = bhidden = spec_img = "";
if(specImage[i].image){
spec_img = "<img src='" + url_format(specImage[i].image) + "'/>";
}else{
spec_img = "<span>" + spec1Values[i] + "</span>";
}
修改为:
var aclass ,liclass,canclick,bhidden,spec_img;
aclass = liclass = canclick = bhidden = spec_img = "";
for(var j = 0; j < specImage.length; j++) {
if(specImage[j].spec1 == spec1Values[i] && specImage[j].image) {
spec_img = "<img src='" + url_format(specImage[j].image) + "'/>";
break;
}
}
if(!spec_img){
spec_img = "<span>" + spec1Values[i] + "</span>";
}