Magento:SQLSTATE [23000]:违反完整性约束:1062键"UNQ_SALES_FLAT_ORDER_IN"的条目"100000001"重复 [英] Magento: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '100000001' for key 'UNQ_SALES_FLAT_ORDER_IN

查看:98
本文介绍了Magento:SQLSTATE [23000]:违反完整性约束:1062键"UNQ_SALES_FLAT_ORDER_IN"的条目"100000001"重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Magento 1.9.0.1,并且已经生活了1个月. 客户的第一订单工作正常. 但是,现在应该处理订单时出现以下错误消息处理您的订单时出错.请与我们联系,或稍后再试."

I have installed Magento 1.9.0.1 and I am live since 1 month. The first order of a Client worked without Problem. But now following error message appears when the order should be processed "There was an error processing your order. Please contact us or try again later."

日志文件显示: 消息"SQLSTATE [23000]"的异常"PDOException":违反完整性约束:1062/home/www/web81/html/lib/Zend/Db/Statement/Pdo.php中的键"UNQ_SALES_FLAT_ORDER_INCREMENT_ID"的条目"100000001"重复: 228

Log file says: exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '100000001' for key 'UNQ_SALES_FLAT_ORDER_INCREMENT_ID'' in /home/www/web81/html/lib/Zend/Db/Statement/Pdo.php:228

我已经阅读了很多主题,也使用过Google,但找不到解决方案. 我是一个初学者,这家商店应该明天再去工作:-( 非常感谢您的帮助!

I have read a lot of threads and also used Google but could not find a solution. I am a beginner and the shop should work tomorrow again :-( I very much appreciate your help!

非常感谢您的帮助&最好的问候

Thanks a lot for your help & best regards

推荐答案

您可以尝试关注.

app/code/core/Mage/Sales/Model/Resource/Quote.php

搜索isOrderIncrementIdUsed方法

Search for isOrderIncrementIdUsed method

在该方法中,

替换

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

使用

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

--------------------------------------------------- - - - - - - - 或者 - - - - - - - - - - - - - - - - - - -------------------------------------------

------------------------------------------------------------ OR-------------------------------------------------------------------------------

转到admin-> sales->订单,并查找最高的订单号(针对每个商店视图!)

Go to admin->sales-> orders and look up the highest order number (for each store view!)

然后查看您的数据库.在表eav_entity_type中,您会找到列出的所有实体类型.感兴趣的更改之一是订单号的开始位置,即.订单销售/订单.记住entity_type_id.

Then look at your database. In the table eav_entity_type you will find all entity types listed. The one of interest to change is where the order number starts, ie. order sales/order. Remember the entity_type_id.

接下来转到表eav_entity_store.查找entity_type_id.现在,您可以将increasing_last_id的值更改为上一个实际的订单号. (也就是说,如果您想将下一个orderId设置为15000,请将crement_last_id设置为14999.)

Next go to the table eav_entity_store. Look up the entity_type_id. Now you can change the value of increment_last_id to your last actual order number. (That is, if you wanted to have your next orderId to be 15000 set increment_last_id to 14999.)

这篇关于Magento:SQLSTATE [23000]:违反完整性约束:1062键"UNQ_SALES_FLAT_ORDER_IN"的条目"100000001"重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆