2016-02-12 128 views
2

當客戶在Magento的結賬過程中,並被重定向到他的後臺網站完成付款。如果他們取消付款和重定向回Magento的店這是不可能再下訂單,我得到這個錯誤電子郵件:Magento - SQLSTATE [23000]:完整性約束違規:1062重複條目

SQLSTATE [23000]:完整性約束違規:1062重複項「MF00000007」關鍵 'UNQ_SALES_FLAT_ORDER_INCREMENT_ID',查詢是:INSERT INTO sales_flat_ordercoupon_codeprotect_codeshipping_descriptionis_virtualstore_idcustomer_idbase_discount_amountbase_grand_totalbase_shipping_amountbase_shipping_tax_amountbase_subtotalbase_tax_amountbase_to_global_ratebase_to_order_ratediscount_amountgrand_totalshipping_amountshipping_tax_amountstore_to_base_ratestore_to_order_ratesubtotaltax_amounttotal_qty_orderedcustomer_is_guestcustomer_note_notifycustomer_group_idquote_idbase_shipping_discount_amountbase_subtotal_incl_taxshipping_discount_amountsubtotal_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_ipshipping_methodstore_currency_codestore_namex_forwarded_forcustomer_notecreated_atupdated_attotal_item_countcustomer_genderhidden_tax_amountbase_hidden_tax_amountshipping_hidden_tax_amountbase_shipping_hidden_tax_amntshipping_incl_taxbase_shipping_incl_taxgift_message_id)VALUES(?,?,?,?,?,?,?,?, ,??,?????????????????????????????????????????????? ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'2016-02-11 15:39:09' ,'2016-02-11 15:39:09',?,?,?,?,?,?,?,?)

有人可以幫我解決這個問題嗎?與th的magento商店是同一個問題...

最好的問候, 羅伯特

+0

http://www.thevortexcode.com/solved-unq_sales_flat_order_increment_id-in-magento/ – Matt

+0

http://stackoverflow.com/questions/27303536/magento-sqlstate23000-integrity-constraint-violation-1062-duplicate-entry – Matt

+0

周圍有很多解決方案 – Matt

回答

2

複製文件app/code/core/Mage/Sales/Model/Resource/Quote.phpapp/code/local/Mage/Sales/Model/Resource/Quote.php (或創建一個自定義模塊覆蓋這個類)。

查找:

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

,並替換此:

$bind = array(':increment_id' => $orderIncrementId); 
相關問題