Events
How to redirect a customer to another URL from Observer
In order to redirect a customer from observer you need to use another way than the Controller
protected $_response;
protected $_objectManager;
public function __construct( \Magento\Framework\App\ResponseInterface $response, \Magento\Framework\ObjectManagerInterface $objectManager,
) { $this->_response = $response; $this->_objectManager = $objectManager;
}
then in your function you can use this
Add Order Attribute to Custom Attributes on Magento 2 Rest API?
Step 1: Create new column and set value for the existing order
Firstly, you need to create a new column in table sales_order in your installer file
$setup->getConnection()->addColumn($setup->getTable('sales_order'), 'order_attribute', 'varchar(1)');
In this post, we named it “order_attribute”.
Step 2: Create extension_attributes.xml file