Welcome Guest, Not a member yet? Register   Sign In
How can I add a related products menu on my site
#1

[eluser]Fr334Ever[/eluser]
I manage to make starting script for my shop to get some products from database,and now I want to make this script to get for evry product related products . I have 2 tables named 'product' and 'category' and based on thes tabels I want to get related products and the url for them , when a customer will click on a related product to send him to thet product page !
I will atach my script and i anyone can help please !
10x Big Grin

c_related - controller
m_related - model
v_related - view
#2

[eluser]regal2157[/eluser]
Okay, well how about I give you the idea of it, and you try it?

You need something to match the products, i.e. subcategories, name, etc.

You can then do a query upon that. So for example, let's say someone is looking at keyboards in a product page. Related products would be other keyboards, and maybe even accessories - like a mouse, or monitor. So you can do a mysql search on like [$this->db->like();] Or you can query other products with that subcategory.

so in your model, create another function.. let's say get_like_items($item), where the $item is the identifier of the product being viewed. Whether it be a name, or preferably an id. Then query your database and return x products.
#3

[eluser]Fr334Ever[/eluser]
[quote author="regal2157" date="1305823982"]Okay, well how about I give you the idea of it, and you try it?

You need something to match the products, i.e. subcategories, name, etc.

You can then do a query upon that. So for example, let's say someone is looking at keyboards in a product page. Related products would be other keyboards, and maybe even accessories - like a mouse, or monitor. So you can do a mysql search on like [$this->db->like();] Or you can query other products with that subcategory.

so in your model, create another function.. let's say get_like_items($item), where the $item is the identifier of the product being viewed. Whether it be a name, or preferably an id. Then query your database and return x products.[/quote]

Can you meke me an example please and I will adapte it to my site !?
Thank you !




Theme © iAndrew 2016 - Forum software by © MyBB