0

I have code that saves order details to a custom table:

    foreach($links as $link) {
        $pdf = Mage::getModel('custom_sales/pdf');
        $pdf->setOrderId($order->getId())
            ->setOrderIncrementId($order->getIncrementId())
            ->setLink($link)
            ->save();
    }

The code saves the records, and the order_id and link columns are correct, but the order increment id's are completely wrong e.g. an order with increment ID 15070100396216 has it's increment ID saved as 4294967295

The table structure is as follows:

  `entity_id` int(10) UNSIGNED NOT NULL auto_increment,
  `order_id` INTEGER(14) UNSIGNED NOT NULL,
  `order_increment_id` INTEGER(20) UNSIGNED NOT NULL,
  `link` VARCHAR(255) NOT NULL DEFAULT '',

Does anyone have any clue why this might be happening?

  • 1
    Datatype increment_id in sales_flat_order table is varchar(50) try to change datatype of increment_id to varchar(50) in your table that may resolve your issue. – Aman Alam Jun 3 '16 at 13:00
  • hi @aman_uni, could you please create an answer? I want to accept it, since this sorted out my issue! – Skytiger Jun 6 '16 at 6:10
  • 1
    Thanks i have created answer. It would be great if you vote up also. Thank you – Aman Alam Jun 6 '16 at 6:16
1

I have seen your table structure you should use below mentioned solution that resolve your issue.

Datatype increment_id in sales_flat_order table is varchar(50) try to change datatype of order_increment_id to varchar(50) in your table that may resolve your issue.

| improve this answer | |

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.