Hide product if no price available for customer group

Hello.
I am new to the Shopware world, but have experience with the Symfony framework. We are currently building a webshop on Shopware 6 that is connected to an ERP system. From there Shopware then gets its articles / prices etc…

The following scenario:
In the ERP system there are price groups. These are transferred to Shopware as customer groups and assigned to the respective customer. Only one group per customer.
The pricing in the ERP runs on the basis of the price/customer groups. So I thought about creating a price rule for each customer group on each article. Everything works so far.

However, one requirement is that only those articles should be listed for which a price rule exists on the basis of the assigned customer group (also via the search).

I am a bit at a loss as to how best to go about this - perhaps someone has a tip for me?

Many greetings
Philip

I now found a solution for my problem. There might be a better way - I don’t know.

I added a custom text field to the products. When prices are updated via API, I keep the allowed group ids in mind and write them to the custom field.

Then, in the „ProductListingCollectFilterEvent“ I added a filter on the custom field.

Works for me now. If someone knows a way to directly filter on the product prices, please let me know.

Thanks a lot!

Dieses Thema wurde automatisch 30 Tage nach der letzten Antwort geschlossen. Es sind keine neuen Antworten mehr erlaubt.