• 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;
    }
    }

  • 相关阅读:
    微信小程序 视频广告展示异常(“表情、壁纸”等页面,当视频广告与顶部区域重叠时,视频广告呈现透明状态,需重新设置视频广告的层级即可)
    Vue:The template root requires exactly one element.的解决办法
    Angular之ES6语法实现数组去重
    Java程序中的代理作用和应用场景及实现
    Hadoop hdfs副本存储和纠删码(Erasure Coding)存储优缺点
    Hadoop源码:namenode格式化和启动过程实现
    ssh免密登录设置后不生效
    递归查询子级元素,返回树形菜单数据
    mysql设置密码
    PX4飞行模式简单对比梳理
  • 原文地址:https://www.cnblogs.com/alex-13/p/4600186.html
Copyright © 2020-2023  润新知