Hi Guys,
I am looking for the best way what you feel when doing this. Basically the idea is to save the history of a user.
Consider we have a bunch of products, and categories. And the user needs a way to save a product and check it for later use. Consider the same as you follow a topic in the PW forum.
I was thinking to add a page which have 2 fields
1 ) user_id which is of type Page which is linked to the user template of PW
2 ) product_id which is also a Page which I have built from another template
I have removed the global title, but it needs the url always entered.
$page = new Page();
$page->template = 'product-history-user';
$page->parent_id = 'parent-id';
$page->name = 'something';
$page->history_user_id = $user->id;
$page->user_history_product_id = 'id-of-product';
$page->save();
I also have some more stuffs that needs similar logic. Interested to hear your thoughts to make this better.
Update :
One more problem I missed to write is, I need to sort it based on the priority, that is why I opted the way.
or is there a way we can store the date and time of the product when saved?
Thanks