Magento - SQLSTATE[23000]: Нарушение ограничения целостности: 1062 повторяющихся записи
Когда клиент находится в процессе оформления заказа в Magento и перенаправляется на свой веб-сайт для завершения оплаты. Если они отменяют платеж и перенаправляются обратно в магазин magento, больше невозможно разместить заказ, и я получаю сообщение об ошибке по электронной почте:
СОСТОЯНИЕ SQLSTATE[23000]: Нарушение ограничения целостности: 1062 Повторяющаяся запись "MF00000007" для ключа "UNQ_SALES_FLAT_ORDER_INCREMENT_ID", запрос был: ВСТАВИТЬ В
sales_flat_order
(coupon_code
,protect_code
,shipping_description
,is_virtual
,store_id
,customer_id
,base_discount_amount
,base_grand_total
,base_shipping_amount
,base_shipping_tax_amount
,base_subtotal
,base_tax_amount
,base_to_global_rate
,base_to_order_rate
,discount_amount
,grand_total
,shipping_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
,quote_id
,base_shipping_discount_amount
,base_subtotal_incl_tax
,shipping_discount_amount
,subtotal_incl_tax
,weight
,customer_dob
,increment_id
,applied_rule_ids
,base_currency_code
,customer_email
,customer_firstname
,customer_lastname
,customer_middlename
,customer_prefix
,customer_suffix
,customer_taxvat
,discount_description
,global_currency_code
,order_currency_code
,remote_ip
,shipping_method
,store_currency_code
,store_name
,x_forwarded_for
,customer_note
,created_at
,updated_at
,total_item_count
,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', ?, ?, ?, ?, ?, ?, ?, ?, ?)
Может ли кто-нибудь помочь мне с этим, у нас есть еще один клиент, также магазин magento, с той же проблемой...
С наилучшими пожеланиями, Роберт
1 answers
Скопируйте файл 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);