首页 > 解决方案 > Magento 2:无法将产品添加到购物车

问题描述

从 Magento 1.5 迁移到 Magento 2.2.4 后,无法添加到购物车,它显示“我们现在无法将此商品添加到您的购物车”。

以下是 var/log 目录中的 expection.log 文件

[2018-06-05 09:51:00] main.CRITICAL:SQLSTATE [42S02]:未找到基表或视图:1146 表“hyl-old.salesrule_customer_group”不存在,查询为:

    SELECT
        `main_table`.*
    FROM
        `salesrule` AS `main_table`
    INNER JOIN `salesrule_website` AS `website`
    ON
        website.website_id IN('1') AND main_table.rule_id = website.rule_id
    INNER JOIN `salesrule_customer_group` AS `customer_group_ids`
    ON
        main_table.rule_id = customer_group_ids.rule_id AND customer_group_ids.customer_group_id = 0
    WHERE
        (
            from_date IS NULL OR from_date <= '2018-06-05'
        ) AND(
            to_date IS NULL OR to_date >= '2018-06-05'
        ) AND(`is_active` = '1') AND(`main_table`.`coupon_type` = '1') AND(
            (main_table.to_date IS NULL) OR(
                main_table.to_date >= '2018-06-05'
            )
        ) AND(`is_active` = '1')
    ORDER BY
        sort_order ASC

{
    "exception" : "[object] (Zend_Db_Statement_Exception(code: 42): 
                   SQLSTATE[42S02] : Base table or view not found: 1146 Table 
                   'hyl-old.salesrule_customer_group' doesn't exist, query was: 

    SELECT
        `main_table`.*
    FROM
        `salesrule` AS `main_table`
    INNER JOIN `salesrule_website` AS `website`
    ON
        website.website_id IN('1') AND main_table.rule_id = website.rule_id
    INNER JOIN `salesrule_customer_group` AS `customer_group_ids`
    ON
        main_table.rule_id = customer_group_ids.rule_id AND customer_group_ids.customer_group_id = 0
    WHERE
        (
            from_date IS NULL OR from_date <= '2018-06-05'
        ) AND(
            to_date IS NULL OR to_date >= '2018-06-05'
        ) AND(`is_active` = '1') AND(`main_table`.`coupon_type` = '1') AND(
            (main_table.to_date IS NULL) OR(
                main_table.to_date >= '2018-06-05'
            )
        ) AND(`is_active` = '1')
    ORDER BY
        sort_order ASC

    at /home/wirw5dhnfutp/public_html/demo/vendor/magento/zendframework1/library/Zend/D 
    b/Statement/Pdo.php:235, PDOException(code: 42S02): SQLSTATE[42S02]: Base 

    table or view not found: 1146 Table 'hyl-old.salesrule_customer_group' 
    doesn't exist at home/wirw5dhnfutp/public_html/demo/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"

} []

标签: phpmagento2

解决方案


推荐阅读