Access the Market object via discount function extension

Hi,
i want to access the market object while calculating a discount,
i found that the docs says its deprecated from the input.localization object,
what alternative do i have?

the docs regarding the market object does not refer to any way of accessing it

2 Likes

Hello :waving_hand:,
This endpoint has been marked as deprecated because of the functionality of new markets.

With the new markets, a buyer can match several markets.

This endpoint will return the most precise region market to retain compatibility with legacy markets.

You can still use this endpoint. We are working on the shape of the data that will replace this, and will communicate as usual in the dev docs one the replacement is ready for public use.

2 Likes

An alternative way to work with it, if you’re also the storefront dev, is to pass the relevant info via cart attributes from the frontend.

The Input of Discount functions can retrieve this. Cart

2 Likes