3

Hi I'm using Magento 2.

I'm trying to override Pricing\Price\ConfigurablePriceResolver by adding a plugin or preference in the app/code folder but I can't make it work.

I need to replace the function resolvePrice() in

Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver

with my custom code so it won't have any bug.

1 Answer 1

2

There is an excellent answer to the plugin option of your questions here: how magento getting configurable product lowest price of associated products?

You can see the setup of the module and an aroundResolvePrice method/function

I have worked on this problem before and came to conclusion that it may not be possible to use a preference for ConfigurablePriceResolver. I only say this because I could not get my extension to have any effect using a preference no matter how I tried it. If somebody knows how I'd love to see that.

3
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review
    – Jarnail S
    Commented Jan 27, 2019 at 23:03
  • The linked answer I provided shows him exactly how to setup the aroundResolvePrice plugin method that he requested. The other half explains my suspicion that a preference can not be used on this type of class.
    – Todd
    Commented Jan 28, 2019 at 19:36
  • Perhaps it would have been better to leave this question without any suggestion for a solution like 90% of the dang questions here. Really frustrating to be called out for helping @Jai, especially since you contributed NOTHING to this question. :)
    – Todd
    Commented May 14, 2019 at 15:48

Your Answer

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