zen-cart网站,模版,采集,二次开发

首页 » ZenCart » ZenCart教程 » 阅读文章

ZenCart产品页多产品展示幻灯片效果

2011-05-31 11:15 28542 10 发表评论
标签:


效果图

下载

使用方法:

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,并做部分改进。

相关日志:

评论 共10条 (RSS 2.0) 发表评论

  1. cc 说道:

    不会滚动怎么办呢

  2. an 说道:

    安装了,效果还好就是感觉有点不整齐

    • E-zencart 说道:

      这是要调整css的,默认的css不可能适应所有网站,改下宽度,边框颜色,左右滚动按钮等等就可以更适合你的站

  3. pan 说道:

    做完后,图片全都没有了,不知道怎么回事噢!

  4. pan 说道:

    做完后,图片什么的都没有了,显示这个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]

  5. pan 说道:

    不好意思,是我自己搞错了,这种幻灯片模式我理解错了,我想做的是另外一种,就是比如说一个产品有8张图片,这八张图片都是按照幻灯片差不多的排列,不好用语言表达,就是大龙网或者lightinthebox那种产品图片显示方法!

  6. kale888 说道:

    这个插件1.50可以用吗

  7. alex 说道:

    安装好了,但有个问题,如果一个分类下没有产品,就会出错,显示: 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]
    请问怎么修改呢?谢谢啦

  8. E-zencart 说道:

    :sad: 分类下没有产品,你也到不了产品页呀,只会提示There are no products to list in this category.

发表评论

  • 
  • 插入代码

联系我 Contact Me

回到页首