附件:http://files.cnblogs.com/lzj87980239/Category_Quantity_Discount.rar

效果图
后台
1.将update.sql导入到数据库

2.将YOUR_TEMPLATES文件夹改为自己的模板名,然后上传到网站根目录

3.在includes/database_tables.php 在末尾添加代码

define('TABLE_CATEGORIES_DISCOUNT_QUANTITY', DB_PREFIX . 'categories_discount_quantity');

4.在includes/functions/functions_prices.php查找

$display_price = zen_get_products_base_price($product_id);

在其上添加

  1. $products_query_discount_type = $products_query->fields['products_discount_type'];
  2. if ($products_discounts_query->RecordCount() <=0 and $products_query_discount_type == 0) {
  3. $products_query2 = $db->Execute("select categories_discount_type, categories_discount_type_from FROM " . TABLE_CATEGORIES . " c , ". TABLE_PRODUCTS_TO_CATEGORIES ." pc where c.categories_id = pc.categories_id AND products_id='" . (int)$product_id . "'");
  4. $products_query_discount_type = $products_query2->fields['categories_discount_type'];
  5. $products_discounts_query = $db->Execute("SELECT * FROM " . TABLE_CATEGORIES_DISCOUNT_QUANTITY ." cd,". TABLE_PRODUCTS_TO_CATEGORIES." pc WHERE cd.categories_id = pc.categories_id AND products_id = " . (int)$product_id. " AND discount_qty <= '" .(float)$check_qty. "' ORDER BY discount_qty DESC");
  6. }

查找

switch ($products_query->fields['products_discount_type']) {

替换为

switch ($products_query_discount_type) {

5.在includes/classes/shopping_cart.php查找

// discount qty pricing

在其下添加(有2处,2处都添加)

$categories_query = $db->Execute("SELECT categories_discount_type FROM ". TABLE_CATEGORIES ." WHERE categories_id = ". zen_get_products_category_id($products_id));

再查找

if ($products->fields['products_discount_type'] != '0') {

修改为

if ($products->fields['products_discount_type'] != '0' || $categories_query->fields['categories_discount_type'] != '0') {

再查找

if ($product->fields['products_discount_type'] != '0') {

修改为

if ($product->fields['products_discount_type'] != '0' || $categories_query->fields['categories_discount_type'] != '0') {

6.在includes/modules/pages/product_info/main_template_vars.php查找

$products_discount_type = $product_info->fields['products_discount_type']; $products_discount_type_from = $product_info->fields['products_discount_type_from'];

修改为

$categories_discount = $db->Execute("SELECT * FROM ".TABLE_CATEGORIES." WHERE categories_id = ".$current_category_id); if( $product_info->fields['products_discount_type']!=0 ){  $products_discount_type = $product_info->fields['products_discount_type'];  $products_discount_type_from = $product_info->fields['products_discount_type_from']; }else{  $products_discount_type = $categories_discount->fields['categories_discount_type'];  $products_discount_type_from = $categories_discount->fields['categories_discount_type_from']; }

7.在includes/modules/products_quantity_discounts.php中查找

$discount_col_cnt = DISCOUNT_QUANTITY_PRICES_COLUMN;

在其上添加

if ($products_discounts_query->RecordCount() <=0 ) {    $products_discounts_query = $db->Execute("SELECT * FROM " . TABLE_CATEGORIES_DISCOUNT_QUANTITY ." WHERE categories_id = " . (int)$current_category_id . " AND discount_qty !=0" . " ORDER BY discount_qty" ); }

8.在includes\templates\YOUR_TEMPLATE\templates\tpl_product_info_display.php查找

if ($products_discount_type != 0) {

修改为

if ($products_discount_type != 0 || $categories_discount_type != 0) {

ZenCart分类数量打折Category Quantity Discount插件的更多相关文章

  1. Zen cart 根据数量打折插件

    Quantity Discounts 可以根据顾客购买多少来打折,很不错. 假如顾客买了3个以上的产品,就给他10%折扣,设置如下: Turn On Quantity Discount 1. In t ...

  2. 分类(类别/Category)与 类扩展(Extension)

    一.分类(类别/Category) 1.适用范围      当你已经封装好了一个类(也可能是系统类.第三方库),不想在改动这个类了,可是随着程序功能的增加需要在类中增加一个方法,这时我们不必修改主类, ...

  3. zencart分类页每页显示产品数量自定义选择的方法

    zencart默认分类页每页显示产品数量是固定的,如何让顾客可以选择每页显示的产品的数量呢?效果图 方式一:全部展示 方式二:下拉菜单 修改方法 1.导入sql INSERT INTO configu ...

  4. zencart分类页产品页去掉url中的id号

    最近公司新上的网站被seo指出要修改url,去掉url中产品id.由于我们用的是zencart框架,装了 Ultimate SEO URLs 插件,所以在网上应该有这方面的资料,本文主要参考资料: 原 ...

  5. 3 - JVM随笔分类(gc.log ,VisualVM插件介绍,VisualVM远程连接方式介绍)

    gc.log 354.2 KB 对于对应用的监控上可以使用Jdk自带的VisualVM来做可视化监控,可以查看当前服务应用进程的堆大小的走向,以及类的加载数量等,除此之外,VisualVM可以支持很多 ...

  6. iOS开发中常用的分类方法---UIImage+Category

    在开发中使用分类对原有的系统类进行方法扩展,是增强系统原有类功能的常见做法. /** * 自由拉伸一张图片 * * @param name 图片名字 * @param left 左边开始位置比例 值范 ...

  7. mysql获取分类数量

    1.sql <select id="getTypeNum" resultType="TypeNum" > select count(*) as al ...

  8. zencart,分类,所有,显示

    改的文件:includes/classes/category_tree.php,最简单的修改 if (!isset($first_element)) {        $first_element = ...

  9. 清除zencart分类页多页后面的&disp_order &sort字符串的方法

    在includes\classes\split_page_results.php页面中的function display_links()函数第一行添加如下两行代码即可$parameters=preg_ ...

随机推荐

  1. java 多线程 1 “常用的实现多线程的2种方式”:Thread 和 Runnable

    转载系列自http://www.cnblogs.com/skywang12345/p/java_threads_category.html 当使用第一种方式(继承Thread的方式)来生成线程对象时, ...

  2. Leetcode_num4_Reverse Integer

    题目: Reverse digits of an integer. Have you thought about this? Here are some good questions to ask b ...

  3. sublime window 配置记录 (转)

    大家好,今天给大家分享一款编辑器:sublime text2    我用过很多编辑器,EditPlus.EmEditor.Notepad++.Notepad2.UltraEdit.Editra.Vim ...

  4. 苹果使用蓝汛CDN网络分发ios8

        2014年9月18日凌晨,苹果公司公布了全新的ios8系统正式版.不出所料的引发了空前高涨的"果粉"下载热潮.引爆整个苹果界.     ios8被业内称为"自Ap ...

  5. Visual Studio 32位64位的问题和如何编译32位64位工程的问题

    Visual Studio自身没有32位和64位的分别,对于某一个特定的版本只有一个版本安装文件(即不存在32位版本的VS2015安装文件和64位版本的VS2015安装文件) 对于自己开发的工程,编译 ...

  6. PDF.NET数据开发框架实体类操作实例

    PDF.NET数据开发框架实体类操作实例(MySQL)的姊妹篇,两者使用了同一个测试程序,不同的只是使用的类库和数据库不同,下面说说具体的使用过程. 1,首先在App.config文件中配置数据库连接 ...

  7. NUC972 MDK NON-OS

     NUC972直接可以在BSP包里模板进行编程,烧录用Nu writer  http://www2.keil.com/mdk5/legacy 下载对应的安装包的插件 是直接下载到DDR 里面去运行,所 ...

  8. JSP内置对象——request 及其响应get和post请求的实例

    request对象客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求,然后做出响应.它是HttpServletRequest类的实例.request对象具有请求域,即完成客户端的 ...

  9. js的等于号==的判断

    var str=0; str == "" 将返回true:

  10. Android开源天气预报应用Weather-Lite

    由于最近繁忙的工作告一段落,要清闲一段时间,所以可以好好利用这段时间给自己充充电. 于是乎这个app就诞生了.本着开源的精神我把它放在了github上.这里如果有Android初学者的话不妨学习一下, ...