zoukankan      html  css  js  c++  java
  • zencart 后台目录产品黄色icon_yellow_on.gif 解决方案

    解决方法,导入时候发现 更新成功! - 型号: as NO.1209 就是重复model

    文件位置:managerincludesmodulescategory_product_listing.php

    文件内容:

      if (zen_get_products_to_categories($categories->fields['categories_id'], true, 'products_active') == 'true') {
      echo '  ' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_LINKED);
      }

    函数位置: 后台includesfunctionsgeneral.php

    函数内容:

    //////////////////////////////////////////////////////////

    function zen_get_products_to_categories($category_id, $include_inactive = false, $counts_what = 'products') {
    global $db;

    $products_count = 0;
    if ($include_inactive == true) {
    switch ($counts_what) {
    case ('products'):
    $cat_products_query = "select count(*) as total
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
    where p.products_id = p2c.products_id
    and p2c.categories_id = '" . (int)$category_id . "'";
    break;
    case ('products_active'):
    $cat_products_query = "select p.products_id
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
    where p.products_id = p2c.products_id
    and p2c.categories_id = '" . (int)$category_id . "'";
    break;
    }

    } else {
    switch ($counts_what) {
    case ('products'):
    $cat_products_query = "select count(*) as total
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
    where p.products_id = p2c.products_id
    and p.products_status = 1
    and p2c.categories_id = '" . (int)$category_id . "'";
    break;
    case ('products_active'):
    $cat_products_query = "select p.products_id
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
    where p.products_id = p2c.products_id
    and p.products_status = 1
    and p2c.categories_id = '" . (int)$category_id . "'";
    break;
    }

    }
    $cat_products = $db->Execute($cat_products_query);
    switch ($counts_what) {
    case ('products'):
    $cat_products_count += $cat_products->fields['total'];
    break;
    case ('products_active'):
    while (!$cat_products->EOF) {
    if (zen_get_product_is_linked($cat_products->fields['products_id']) == 'true') {
    return $products_linked = 'true';
    }
    $cat_products->MoveNext();
    }
    break;
    }

    $cat_child_categories_query = "select categories_id
    from " . TABLE_CATEGORIES . "
    where parent_id = '" . (int)$category_id . "'";

    $cat_child_categories = $db->Execute($cat_child_categories_query);

    if ($cat_child_categories->RecordCount() > 0) {
    while (!$cat_child_categories->EOF) {
    switch ($counts_what) {
    case ('products'):
    $cat_products_count += zen_get_products_to_categories($cat_child_categories->fields['categories_id'], $include_inactive);
    break;
    case ('products_active'):
    if (zen_get_products_to_categories($cat_child_categories->fields['categories_id'], true, 'products_active') == 'true') {
    return $products_linked = 'true';
    }
    break;
    }
    $cat_child_categories->MoveNext();
    }
    }


    switch ($counts_what) {
    case ('products'):
    return $cat_products_count;
    break;
    case ('products_active'):
    return $products_linked;
    break;
    }
    }

  • 相关阅读:
    POJ 3041 Asteroids 最小点覆盖 == 二分图的最大匹配
    POJ 3083 Children of the Candy Corn bfs和dfs
    POJ 2049 Finding Nemo bfs 建图很难。。
    POJ 2513 Colored Sticks 字典树、并查集、欧拉通路
    POJ 1013 Counterfeit Dollar 集合上的位运算
    POJ 2965 The Pilots Brothers' refrigerator 位运算枚举
    无聊拿socket写的100以内的加法考试。。。
    POJ 1753 Flip Game
    初学socket,c语言写的简单局域网聊天
    汇编语言 复习 第十一章 标志寄存器
  • 原文地址:https://www.cnblogs.com/alex-13/p/4600186.html
Copyright © 2011-2022 走看看