Saving a product as a favorite

Does anyone know how a user can save a product/item and find it in their profile?

1 Like

Hi,

This may not be the best way, however its the first thing that comes to mind.

So in the data types I’ve created a new field as follows (on the item/product data type):
image

So on your product/item your need a heart icon or something similar that can action the workflow to add a user to that product/item - in my case that item is a listing e.g. holiday listing. The workflow action is something like the below when the heart icon is clicked:

image

Now on the users profile page were have a repeating group with the following search and data source:
image

So again your type of content maybe product/item and perform the search on that data type. Now on the search we add a constraint like so:
image

You can add sorting and other constraints on top if needed. Then of course in the repeating group we add any fields from the item/product e.g. title, sku, photo

Below serves as an example:
image

Hope that helps…

I was actually thinking the exact opposite, but same theory.

Instead of creating a Favorited By on the product itself, I was thinking you could create an item in the User data called Favorited Products, and have the type be Products.

I don’t know if that would be more effective or what, just the thought that came into mine.

2 Likes

I agree I think your method is the better way round, heres the logic and reason:

On the users data type create a new field as follows:
image
Change the field type depending on the item/product

Then when this heart is clicked (heart icon is within the repeating group of items/products) start a workflow:
image

Job done.

Then somewhere on the user’s profile we add a repeating group with the following data source:

Using the expression ‘Current User’s…’ in the data source I believe is a faster call compared to ‘Do a search for…’. It also means you don’t need a filter to match the user, but optionally the data can be filtered or sorted with an additional expression at the end.

2 Likes

Thanks everyone.

This topic was automatically closed after 70 days. New replies are no longer allowed.