Jump to content

Module "Recommended goods"


Siregik
 Share

Recommended Posts

Hi everyone!!!
 
I have catalog of some products and I'm wanting create modul, which will be show slider of recommended products. And I'm wanting to show this modal in every page of products.
I don't know, how I can choose products which I will demonstrate on the page.

Who can recommend some model or solution for this situation?
 
Thanks!!!
 
Link to comment
Share on other sites

Hi,

ProcessWire is completely versatile so this can be achieved many ways. Recommended, would this be based on the user history? Also how will you be dealing with identifying the product. For example tags/category?

I am by no means as talented as most of the developers on here, and I'm also pretty new with ProcessWire and I'm still learning, so my answer may not be 100% correct. But I'll give it ago.

If you are wanting it on your users session history, I would store each product ID in an array firstly using the $session API

<?php
    $session->viewed = is_array($session->viewed) ? array_push($session->viewed, $page->id) : array($page->id);
?>

Then to display related I would do 

<?php
foreach($session->viewed as $view) {
    $v = $pages->get($view);
    $c[] = $v->categories->name;
}
$c = implode("|", $c);
foreach($pages->find("template=product, categories=$c, limit=10")->shuffle() as $item) {
     echo "<a href='$item->url'>$item->title</a>";
}
?>

This probably isn't the correct way, but lets say you have been looking at TVs, so you've been in the category TV, it should return TVs for that user. You may want to limit how many pages are stored in a session that way it will always be current with that they were recently looking at. 

Link to comment
Share on other sites

This topic can be handled in a simple way like Tom suggests (or even simpler) or in a very complex way, like using machine learning algorithms and tools (e.g. https://prediction.io/

 

From a non-technical view, you want to recommend:

- products that are similar (comparing attributes/specs of products) and/or

- products based on behaviour of other visitors (user A looks at product X; previously user B, who also looked at product X bought a similar product Y, so recommend Y to A).

 

Another simple way could be to reccomend based on visit statistics and categories: the users looks at a t-shirt -> recommend him the most viewed t-shirts.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...