首页 » ZenCart » ZenCart教程 » 阅读文章
ZenCart产品页多产品展示幻灯片效果
效果图
下载
zencart产品详细页幻灯片效果.rar (60.9 KB, 361 次)
使用方法:
1.上传文件,将YOUR_TEMPLATES改为自己的模板名
2.将includes\templates\YOUR_TEMPLATES\templates\tpl_product_info_mobile_products.php中
YOUR_TEMPLATES改为自己的模板名
includes/templates/你的模板/templates/tpl_product_info_display.php顶部加上
<?php require($template->get_template_dir('/tpl_product_info_mobile_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_product_info_mobile_products.php');?>
注:
修改循环产品的数量
将includes\templates\YOUR_TEMPLATES\templates\tpl_product_info_mobile_products.php中
$flash_page_query = "select p.products_id,p.products_image,pd.products_name from " . TABLE_PRODUCTS ." p, ". TABLE_PRODUCTS_DESCRIPTION . " pd where p.`products_id`=pd.`products_id` AND p.`products_status`='1' AND pd.`language_id` = '" . (int)$_SESSION['languages_id'] . "' AND p.`master_categories_id` = " . zen_get_products_category_id($products_id) . " ORDER BY rand() limit 12";
中12改为自己想要的数值。
扩大显示范围到全部产品
将includes\templates\YOUR_TEMPLATES\templates\tpl_product_info_mobile_products.php中
$flash_page_query = "select p.products_id,p.products_image,pd.products_name from " . TABLE_PRODUCTS ." p, ". TABLE_PRODUCTS_DESCRIPTION . " pd where p.`products_id`=pd.`products_id` AND p.`products_status`='1' AND pd.`language_id` = '" . (int)$_SESSION['languages_id'] . "' AND p.`master_categories_id` = " . zen_get_products_category_id($products_id) . " ORDER BY rand() limit 12";
改为
$flash_page_query="select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, p.products_date_added, p.products_price, p.products_type, p.master_categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.products_status = 1 limit 12";
参考自http://hi.baidu.com/liu731/blog/item/2d7f14f7b284b076ddc474b5.html,并做部分改进。
声明: 本文由Ezencart原创,转载请保留链接:ZenCart产品页多产品展示幻灯片效果
评论 共10条 (RSS 2.0) 发表评论
不会滚动怎么办呢
不滚动,应该是你js没有加载,检查下js
安装了,效果还好就是感觉有点不整齐
这是要调整css的,默认的css不可能适应所有网站,改下宽度,边框颜色,左右滚动按钮等等就可以更适合你的站
做完后,图片全都没有了,不知道怎么回事噢!
做完后,图片什么的都没有了,显示这个1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘` = ’1′ and p.products_status = 1 limit 12′ at line 1
in:
[select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, p.products_date_added, p.products_price, p.products_type, p.master_categories_id from products p, products_description pd where p.products_id=pd.products_id and pd.language_id` = '1' and p.products_status = 1 limit 12]
不好意思,是我自己搞错了,这种幻灯片模式我理解错了,我想做的是另外一种,就是比如说一个产品有8张图片,这八张图片都是按照幻灯片差不多的排列,不好用语言表达,就是大龙网或者lightinthebox那种产品图片显示方法!
这个插件1.50可以用吗
安装好了,但有个问题,如果一个分类下没有产品,就会出错,显示: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ORDER BY rand() limit 8′ at line 1
in:
[select p.products_id,p.products_image,pd.products_name from products p, products_description pd where p.`products_id`=pd.`products_id` AND p.`products_status`='1' AND pd.`language_id` = '1' AND p.`master_categories_id` = ORDER BY rand() limit 8]
请问怎么修改呢?谢谢啦
分类下没有产品,你也到不了产品页呀,只会提示There are no products to list in this category.