I added a new column to quote item(lets call custom_type). So I extended \Magento\Quote\Model\Cart\Totals\Item
to implement getters and setters for my column.
public function getCustomType()
{
return $this->_get('custom_type');
}
public function setCustomType($type)
{
return $this->setData('custom_type', $type);
}
It is sufficient to get/set my new column values. It works when we get the column values. But if I try to get the value in checkout review page(#payments), the value is not returned because Magento uses REST to get the item information(missing interface signatures).
So the problem arises here. I need to add interface for these two methods in \Magento\Quote\Api\Data\TotalsItemInterface
to get the values using REST. I am creating a separate module, so I can't touch the core code.
How do I achieve this? Any suggestions.