London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
If you install Find.Commerce package, this should be handled automatically
Does it work for both association entries-products (Source/Target)?
The case is: that Parent-Product has association to Product-Accessories
For Product-Accesory we added a convention to store the sort orders obtained from the "Parent-Product TO Product-Accessory" association.
We query for Product-Accessories (explicit `.Filter(p => p.ContentLink.ID.In(contentIds))`)
And we need the result to be ordered based on the SortOrder on the Parent-Product TO Product-Accessory association (mostly paging purposes).
Which simply means, "Parent-Product TO Product-Accessory" association update under the Parent-Product, has to trigger reindex also of the Target entry (Product-Accessoriy)
I have to reindex (Find document) for particular Product on Association change (Product-Product association), but I'm thinking about how to do it best:
In initialization module I added code like this:
var catalogEvents = ServiceLocator.Current.GetInstance<ICatalogEvents>();
catalogEvents.AssociationUpdated += AssociationUpdate;
private void AssociationUpdate(object? sender, AssociationEventArgs e)
{
And followup question, how to trigger that reindex? Is that the proper way?