Magento: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '100000001' for key 'UNQ_SALES_FLAT_ORDER_IN

前端 未结 5 1878
日久生厌
日久生厌 2021-02-06 07:55

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

5条回答
  •  天涯浪人
    2021-02-06 08:04

    You can try following.

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

    Search for isOrderIncrementIdUsed method

    In that method,

    replace

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

    with

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

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

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

    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.

    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.)

提交回复
热议问题