I have added custom column in sales_order_grid table and values are showing in backend but how to update that column's value if customer has edited it from frontend order view? Anyone please help!

installer code

            'type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
            'unsigned'  => true,
            'nullable'  => false,
            'default'   => '0',
            'comment' =>'Custom column'


Below is code from my model where i am saving it in sales_order table:

public function setFav($order,$orderId,$favId)

    $order = $order->create();

It is saving in sales_order table but need to save/update in sales_order_grid at same time. Thanks

  • Can you tell me how you can add that column and also share code to save value into this field. – Dhiren Vasoya May 3 '17 at 10:34
  • Please check updated post – Keith May 3 '17 at 10:59

Your Answer

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

Browse other questions tagged or ask your own question.