0

Which event I have to use? I have need to store product wise shipping tax.

3 Answers 3

2

As per my understanding I think you have to use Magento extension attribute feature

If you want to learn how to use Magento Extension attribute then I think you can go through with this link :

https://store.fooman.co.nz/blog/an-introduction-to-extension-attributes.html

In your case in extension_attribute.xml of your module you have to add code like this, this is the sample of gift_message column at order item level

<extension_attributes for="Magento\Sales\Api\Data\OrderItemInterface">
<attribute code="gift_message" type="Magento\GiftMessage\Api\Data\MessageInterface" />
</extension_attributes>
1
  • 1
    Use of Magento extension attribute is best idea.
    – Amit Bera
    Sep 14, 2018 at 4:49
0

I don't think you need to create an extra field on sales_order_item as magento already have tax fields to this table.

enter image description here

5
  • no i have add shipping tax not only tax Sep 14, 2018 at 4:12
  • did you able to create custom field?
    – Amit Bera
    Sep 14, 2018 at 4:12
  • no i see it first time Sep 14, 2018 at 4:14
  • please donot called me sir...
    – Amit Bera
    Sep 14, 2018 at 4:33
  • i have done it.. Sep 14, 2018 at 7:07
0

Magento already offers the tax field in it's table. Hence, I don't think you need to create an extra field. However, I can help you out if you can be a bit specific about what you wanna add.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.