1

In magento 1.9.x if i click in "reorder" in an order page he duplicate the increment_id of original order and add "-1" in the end.

ex: order-> increment_id = 12345

reorder-> increment_id = 12345-1

where i can found this function? there is a way to change this function? because i need to create new increment_id

ex: order-> increment_id = 12345

reorder-> increment_id = 12346

thank you very much

0

Open app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php

Check following method:


public function createOrder()
{

Check following code:


if ($oldOrder->getId()) {
    $originalId = $oldOrder->getOriginalIncrementId();
    if (!$originalId) {
        $originalId = $oldOrder->getIncrementId();
    }
    $orderData = array(
        'original_increment_id'     => $originalId,
        'relation_parent_id'        => $oldOrder->getId(),
        'relation_parent_real_id'   => $oldOrder->getIncrementId(),
        'edit_increment'            => $oldOrder->getEditIncrement()+1,
        'increment_id'              => $originalId.'-'.($oldOrder->getEditIncrement()+1)
    );
    $quote->setReservedOrderId($orderData['increment_id']);
    $service->setOrderData($orderData);

    $oldOrder->cancel();
}

Comment out following two line:


//$quote->setReservedOrderId($orderData['increment_id']);
//$service->setOrderData($orderData);

NB: Don't modify core code. Use overwrite for modification.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.