In Configurable products REST API, the price response is 0, so I need to get ride of it.

I knew later that configurable products prices are displayed in the web store as the smallest price listed in its children simple products and the solution is to make custom API to loop in its related simple products and return the smallest price.

The problem is I return configurable products in many APIs (Search, List products in categories, Featured products, Latest products, ...etc), So I think it is bad practice to loop on each API to make it custom, so I had an idea which make product attribute non visible and make its value automatically read the price attribute.

Is that correct and how can I achieve that?

OR, If there is a better solution, kindly share it.


1 Answer 1


You could create a new product attribute (of type 'Price') and use the 'after save'-event to populate it. If I'm not mistaking product attributes get included in the API response. You might have to set them to 'use in product listing'.

  • Thanks, Could you please share the code ?
    – Jsparo30
    Commented Aug 21, 2017 at 21:31

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