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

  • 相关阅读:
    WinForm窗口间传值
    如何自定义标签
    oracle数据库开启的时候 是先开监听还是先开主服务,关数据库的时候呢???
    oracle 10g 安装时字符集的选择,和后边的修改
    Oracle数据库安装及配置(一)
    Win7下完全卸载Oracle 11g的步骤
    Oracle创建表空间、创建用户以及授权
    ORACLE创建表空间、创建用户、更改用户默认表空间以及授权、查看权限
    Linux 常用命令集合
    Java之JSP和Servlet基础知识
  • 原文地址:https://www.cnblogs.com/alex-13/p/4600186.html
Copyright © 2011-2022 走看看