• 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) {

  • 相关阅读:
    161028、Nginx负载均衡实现tomcat集群方案简要小结
    161027、Java 中的 12 大要素及其他因素
    161026、更快速将你的页面展示给用户[前端优化篇]
    161025、java提高篇之关键字static
    161024、并发控制中的乐观锁与悲观锁
    161021、spring异步调用,完美解决!
    161020、web调试工具fiddler介绍及使用
    RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptool
    PyCharm IDE环境下,执行unittest不生成测试报告问题解决
    (转)selenium使用Xpath+CSS+JavaScript+jQuery的定位方法(治疗selenium各种定位不到,点击不了的并发症)
  • 原文地址:https://www.cnblogs.com/lzj87980239/p/3644390.html
Copyright © 2020-2023  润新知