How to get the calculated listing price?

Hello,

I have created a command for exporting product details, for that I need product prices. The problem is, if I fetch price from the product entity , it will return all the listing price. I only need the price which is displayed in the storefront. Any suggestion or help is much appreciated.

Thanks.

Hi sameenq,

do you use the storefront API or the administration API?

Best Regards,

Krispin

Hi Krispin,

I am new to shopware, with API I dont understand what do you mean. I have read product entity via DAL.

Kind Regards,

Sameen

Hi sameenq,

the shown price in the storefront depends on the price rules and the graduation of the product.
If you want the product prices from a explicit storefront, may you can use the ProductSearchGateway.

Best Regards,

Krispin

Hi Krispin,

Thank you for your reply.

In order to use the ProductSearchGateway, I need SalesChannelContext . I dont have access to the SalesChannelContext as I am executing a commad. Is there any way to create SalesChannelContext? Please correct me if I understand something wrong.

Regards,

Sameen