Tuesday, 13 August 2013

using PHP to recommend products based on the current view item

using PHP to recommend products based on the current view item

I wanted to know how to use PHP to show recommend items based on what the
user is viewing or has in cart.
I have a view page in which I display all my items and when the user
clicks on the item. The ID of the item is posted to the product detail
page in which I render the product by using the ID to select from my
product table
In my product I have product table
I have something like below with over 40 records. 10 of it are shoes
Id, name category desc
1 leather shoe blah
2 italian shoe blah blah
In my product detail page. I want to echo some recommended items atleast 4
of the items item some divs with just an image and name.
My question
How can I select an item based on the category of the item getting view?
for an example in my table, lets says i was viewing item 1 which is in the
category columns. I want to show random 4 items in the category columns.
Thanks for your help.

No comments:

Post a Comment