zoukankan      html  css  js  c++  java
  • ZenCart分类数量打折Category Quantity Discount插件

    附件: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);

    在其上添加      

        $products_query_discount_type = $products_query->fields['products_discount_type'];
          if ($products_discounts_query->RecordCount() <=0 and $products_query_discount_type == 0) {
                $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 . "'");
                $products_query_discount_type = $products_query2->fields['categories_discount_type'];
                $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");
    }

    查找

    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 emplatesYOUR_TEMPLATE emplates pl_product_info_display.php查找

    if ($products_discount_type != 0) {

    修改为

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

  • 相关阅读:
    WCF message logging and tracing
    How to create a custom composite activity
    两个Datatable合并
    JS生成柱形图表
    InstallShiled12激活过程
    InstallShield Premier版本和Professional版本的功能差异
    InstallShield12注册过程
    Oracle回收站使用
    SQLite数据库管理的相关命令
    Installshield 2010 预安装组件或软件
  • 原文地址:https://www.cnblogs.com/lzj87980239/p/3644390.html
Copyright © 2011-2022 走看看