【问题标题】:Cannot Update cart in magento 1.7.0.2无法在 magento 1.7.0.2 中更新购物车
【发布时间】:2014-05-02 06:39:05
【问题描述】:

我在 magento 中遇到了一个大问题。

当我没有与客户登录时,我可以更新购物车项目。但是当我与客户登录时,它会显示 无法更新购物车

我启用了它说的日志:-

exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint
violation: 1452 Cannot add or update a child row: a foreign key constraint 
fails
(`databasename`.`wishlist`, CONSTRAINT
 `FK_WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID`
  FOREIGN KEY (`customer_id`)
 REFERENCES `customer_entity_old` (`entity_id`) ON DELETE CASCADE ON UPDATE CA)

请帮忙

【问题讨论】:

    标签: magento magento-1.7 cart


    【解决方案1】:

    我解决了这个问题希望它的帮助。请看这个链接"How to change the foreign key referential action?"

    我在我的数据库中运行两个查询,如下所示:

    我只是从表中删除 CONSTRAINT,然后在表中添加新的 CONSTRAINT:

    1. 扔掉旧的:

      ALTER TABLE `wishlist`
      DROP FOREIGN KEY 
      `FK_WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID`;
      
    2. 添加新的:

      ALTER TABLE `wishlist`
      ADD CONSTRAINT `FK_WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` 
      FOREIGN KEY (`customer_id`) 
      REFERENCES `customer_entity` (`entity_id`) 
      ON DELETE CASCADE ON UPDATE CASCADE;
      

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-21
      • 1970-01-01
      • 1970-01-01
      • 2012-12-28
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多