1

I have been trying to create order programatically, it's working well except custom option.

I have one custom option which reference id is 435. I have tried the following. But it seems not working

$order->setData(array( 'options' => array(
     435 => $customvalue,
)));

I got above suggestion From here

How to save custom option field value when create order programatically?

  • 1
    I've never been able to do so, as the order custom values seem to be lost from one step to the other, the way I worked around this was by using session variables. I'd be interested to see the answer to this too. – Julien Lachal May 28 '14 at 8:55
  • @JulienLachal i have posted answer! you can check now – DRAJI Jun 3 '14 at 6:05
1

I got an answer for my question from here

Its working rock

$existentOptions['additional_options'][] = array(
'label' => $optiontitle, // Title of custom option field
'value' => $customvalue,  // Value of custom option field
);

For more details, you can check on my blog here

  • I should test that someday. And is it kept throughout the whole Checkout process? – Julien Lachal Jun 4 '14 at 8:31
  • yeah. I got these custom values in sales/order module in backend too – DRAJI Jun 4 '14 at 9:27
  • I guess you must have added another field to the sales_order table then? – Julien Lachal Jun 4 '14 at 15:44

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.