Developer forum

Forum » Rapido » Refactor Favorites logic in Rapido feeds

Refactor Favorites logic in Rapido feeds

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to refactor the Rapido feed to use the new ProductCatalogViewModels instead of the old ProductCatalog.

I have managed to refactor most of the code but I got stuck on the Favorites logic.

I have noticed a few new methods and services (I have peaked into the Swift templates):

Pageview.User.GetFavoriteLists()

Pageview.User.IsProductInAnyFavoriteList(product.Id, product.VariantId)

But these 2 methods do not seem to return what I was expecting. The first method returns 0 even if I have multiple lists and the second one returns  false regardless of the product assignment to lists.

I am using DW 9.14.14.

How should I access the User lists and check if a product is already assigned to an existing list?

Thank you,
Adrian


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Here is a short update on this issue. The problem seems to be related to some caching. Recycling the application solved the issue.

How do I solve it to be caching independent?

I must mention that the product I was checking was added via the old Rapido way and I have created a new list with the old (Rapido) logic. It should not matter, but I have added this information in case it is relevant.

Thank you,
Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Old rapido is using old customer center, Swift uses new customer center.

If you mix and match, you probably get into problems like this.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I did indeed. But I have managed to refactor everything and it seems to work correctly if I don't mix them.

Thank you,

Adrian

 

You must be logged in to post in the forum