1

I need to override below two core file of vendor folder :

vendor/magento/module-quote/Api/Data/ShippingMethodInterface.php

vendor/magento/module-quote/Model/Cart/ShippingMethod.php

file to my code folder.

1 Answer 1

2

vendor/magento/module-quote/Api/Data/ShippingMethodInterface.php is already override magento quote model.

<preference for="Magento\Quote\Api\Data\ShippingMethodInterface" 
type="Magento\Quote\Model\Cart\ShippingMethod" />

So you should Override the class Magento\Quote\Model\Cart\ShippingMethod

Not ShippingMethodInterface.

3
  • But how can I add my custom get, set method in ShippingMethodInterface and ShippingMethod? Commented Aug 16, 2017 at 9:12
  • @amitbera Is there any way to override the Magento\Sales\Api\Data\OrderInterface to set value custom attribute on sales_order_place_after event? Commented Dec 15, 2017 at 9:39
  • i need to check ..
    – Amit Bera
    Commented Dec 15, 2017 at 9:46

Your Answer

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

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