zencart 产品页面尺码属性以List全部显示出来

zencart 产品页面尺码属性以List全部显示出来

有时候产品站我们比较喜欢以尺码属性以List全部显示出来
list3

可以安装ZenCart List Atrributes插件
1.将install.sql导入数据库,这样后台会多出一个List的属性项
[php]INSERT INTO `products_options_types` (`products_options_types_id` ,`products_options_types_name`) VALUES (‘6’, ‘List’);[/php]

2.将插件名为”你的模板”的文件夹改名为你的模板然后覆盖即可

3.在includes\templates\你的模板\common\html_header.php中检查是否有下面的代码,没有加入进去
[php]<?php if (isset($canonicalLink) && $canonicalLink != ”) { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>[/php]

4.还是在html_header.php文件中查看是否引入jquery库,如果没有可以引入google的jquery库
[php]<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>[/php]
5.检查includes\modules\你的模板\attributes.php是否做过修改,如果以前做过修改,删除插件中对应的attributes.php文件
打开你自己的attributes.php文件

查找
[php]$options_menu[] = zen_draw_pull_down_menu(‘id[‘ . $products_options_names->fields[‘products_options_id’] . ‘]’, $products_options_array, $selected_attribute, ‘id="’ . ‘attrib-‘ . $products_options_names->fields[‘products_options_id’] . ‘"’) . "\n";[/php]
替换为
[php]if($products_options_names->fields[‘products_options_type’]==6){
$options_menu[] = zen_list_menu(‘id[‘ . $products_options_names->fields[‘products_options_id’] . ‘]’, $products_options_array, $products_options_names->fields[‘products_options_id’],$products_options_names->fields[‘products_options_name’]) . "\n";
}else{
$options_menu[] = zen_draw_pull_down_menu(‘id[‘ . $products_options_names->fields[‘products_options_id’] . ‘]’, $products_options_array, $selected_attribute, ‘id="’ . ‘attrib-‘ . $products_options_names->fields[‘products_options_id’] . ‘"’) . "\n";
}[/php]

下载:http://pan.baidu.com/s/1c0vYoZQ

发表评论

© 2022. powered by PHP 个人小站