I want to add remark input text field in checkout page I follow Magento 2 - Set custom attribute value on cart page to set custom attribute in quote_item.
In configurable.phtml
<div class="field configurable required">
<div class="control">
<input type="text" name="remark" id="remark">
</div>
</div>
In catalog_attribute.xml
<group name="quote_item">
<attribute name="remark"/>
</group>
In SalesQuoteItemSetCustomAttribute
public function execute(\Magento\Framework\Event\Observer $observer)
{
$product = $observer->getProduct();
$quoteItem = $observer->getQuoteItem();
$quoteItem->setRemark($product->getRemark());
}
But $product->getRemark()
is null
, inside /checkout/cart/add/
do I need to set remark in product directly from http request?