If I wanted to change the function getPrice for instance? [Edit] Lets suppose that I wanted to change the way that the price is calculated. e.g.: if the customer is from a certain state, the price should be multiplied by 1.12.

1 Answer 1


The best way to change would be using Plugins(Interceptors)

There are three types of plugins:

  • before
  • around
  • after

You can read more about here http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html