What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

HI all, In elastic search i want to restrict it for stocked product only. And if product stock is be

U02HE8RULAG
U02HE8RULAG Posts: 19 🧑🏻‍🚀 - Cadet

HI all, In elastic search i want to restrict it for stocked product only. And if product stock is being 0 it should be removed from Elasticsearch immediately. How we can achieve this.Please anyone help me on this.
Where Elasticsearch update method is written?

Comments

  • sebastian.larisch
    sebastian.larisch Spryker Customer Posts: 143 🧑🏻‍🚀 - Cadet

    I assume u do not want to list your product in search / catalog when stock is 0. the spryker-out-of-the-box behavior should be that it is still listed, but product-detail-page will show some “product is not available” state. so you need to update the is_searchable flag in SpyProductSearch for your product+locale. you can view/update this flag in the product edit view of your concrete product in zed. depending on how you update your stock you could add a listener to subscribe to the related event or (if stock gets updated by middleware) you could add another WriterStep that will take care of that. maybe this helps ..