【问题标题】:Magento - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entryMagento - SQLSTATE [23000]:完整性约束违规:1062重复条目
【发布时间】:2016-05-23 05:48:22
【问题描述】:

当客户在 Magento 的结帐过程中并被重定向到他的后台网站以完成付款时。如果他们取消付款并被重定向回 magento 商店,则无法再下订单,我会收到此错误电子邮件:

SQLSTATE[23000]:完整性约束违规:1062 键“UNQ_SALES_FLAT_ORDER_INCREMENT_ID”的重复条目“MF00000007”,查询为:INSERT INTO sales_flat_order (coupon_code, protect_code, shipping_description, @98765 987654328 @,customer_idbase_discount_amountbase_grand_totalbase_shipping_amountbase_shipping_tax_amountbase_subtotalbase_tax_amountbase_to_global_ratebase_to_order_ratediscount_amountgrand_totalshipping_amount ,shipping_tax_amount,store_to_base_rate,store_to_order_rate,subtotal,tax_amount,total_qty_ordered,customer_is_guest,customer_note_notify,customer_group_id,base_shipping_discount_amount,base_shipping_discount_amount,base_subtotal_incl_tax,@9876 987654353 @,subtotal_incl_taxweightcustomer_dobincrement_idapplied_rule_idsbase_currency_codecustomer_emailcustomer_firstnamecustomer_lastnamecustomer_middlenamecustomer_prefixcustomer_suffix ,customer_taxvat,discount_description,global_currency_code,order_currency_code,remote_ip,shipping_method,store_currency_code,store_name,x_forwarded_for,created_at,created_at,created_at,@987654376 987654378@, customer_gender, hidden_tax_amount, base_hidden_tax_amount, shipping_hidden_tax_amount, base_shipping_hidden_tax_amnt, shipping_incl_tax, base_shipping_incl_tax, gift_message_id) 值 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '2016-02-11 15:39:09', '2016-02-11 15:39:09', ?, ?, ?, ?, ?, ?, ?, ?, ?)

有人可以帮我解决这个问题吗,我们有另一个客户也遇到了同样的问题...

最好的问候, 罗伯特

【问题讨论】:

标签: php magento checkout onepage-checkout


【解决方案1】:

将文件app/code/core/Mage/Sales/Model/Resource/Quote.php复制到app/code/local/Mage/Sales/Model/Resource/Quote.php (或者创建一个自定义模块来覆盖这个类)。

查找:

$bind = array(':increment_id' => (int)$orderIncrementId);

并将其替换为:

$bind = array(':increment_id' => $orderIncrementId);

【讨论】:

    猜你喜欢
    • 2015-03-31
    • 1970-01-01
    • 2017-08-04
    • 2016-01-16
    • 2014-09-16
    • 2012-04-26
    • 2018-06-06
    • 2020-12-20
    • 2016-03-10
    相关资源
    最近更新 更多