Suggested Related Product

19 posts by 5 authors in: Forums > CMS Builder
Last Post: November 12, 2010   (RSS)

By kitka - February 8, 2010

HI Guys/Ladies:

Is it possible to cross refrence products?
ie....For example....I am selling a Product "Tires" is there a way to show a link to a related similar product "ie rims"
Kinda like....Mya we suggest as well to puchase..... You see this in alot of shopping cart sites>>>>

The reason i ask is i have a customer who will featuring 1 product but may want tocross link another product on the same page?

Is this possible with CMS?
jim albert

Re: [kitka] Suggested Related Product

By Codee - February 8, 2010

A simple thought of what you could do, and it's very similar to many carts, is create a field in your product/inventory section called or titled "related products" and have it pull a list of product listings (which could be cumbersome) or allow URLs you can cut/paste into the field that it would display a link to chosen products.

Re: [equinox69] Suggested Related Product

By kitka - February 8, 2010

Thanks for your input... will explore that with some detail
jim albert

Re: [kitka] Suggested Related Product

By Codee - February 8, 2010

another thought, and a bit more slick, would be to program the "related products" field to accept the product numbers, comma separated, and then have a custom display on your product inventory pages that pulls the short description and maybe the first thumbnail for the other products. This would take a little bit of custom MySql programming of course. If you are unable to do that, there are other people in the forum that could, and of course the IT staff could handle it for you. good luck!

Re: [equinox69] Suggested Related Product

By kitka - February 8, 2010

thanks alot for your suggestions... A second pair of eyes is always a great help
jim albert

Re: [chris] Suggested Related Product

By kitka - February 9, 2010

Ok... you suggested

Taking this one step further, you could have the product's category field be multi-value. This would allow you to "tag" products with one or more categories, then your code could find other products with matching tags.

I may seeem clueless here but how would one do this....(LOL)
[/#000000]
jim albert

Re: [kitka] Suggested Related Product

By Chris - February 9, 2010

Hi kitka,

You'd use a multi-value list field to select multiple categories for a product. Then, on the viewer page, split the product's category field out to get a list of all the categories this product is assigned to:

$categories = explode("\t", trim($productRecord['categories']));

Then get related products which contain at least one of those categories in their own categories:

$where = "";
foreach ($category in $categories) {
if ($where) { $where .= " OR "; }
$where .= "categories LIKE '%\t" . mysql_escape($category) . "\t%'"
}

if ($where) {
list($relatedProducts,) = getRecords(array(
'tableName' => 'products',
'where' => $where,
'limit' => '10',
));
}
else {
$relatedProducts = array();
}


Does that help?
All the best,
Chris

Re: [chris] Suggested Related Product

By kitka - February 9, 2010

Hi Chris...
Thanks... I am going to be wrking on this this week so i will let you know...
thanks for all your insight and help
JIM
jim albert

Re: [kitka] Suggested Related Product

NOT GETTING VERY FAR
My goal is to set up a product catalog for a small camera store building on the basic approach discussed in this post, but I’m not getting very far...

WHAT'S NEEDED
The client would like to show “suggested items” that work with specific cameras and specific accessories (like the big sites do).

There will eventually be many products, models and kits listed and these products will change over time.

There could be dozens of related products for a given product, in many different categories, like memory cards, flashes, lenses, filters, etc. for a specific camera. Or specific filters, lens caps, and accessories that work with a specific lens.

These relationships and products will also change over time and the client needs to be able to manage everything easily and intuitively.

FIRST APPROACH
One thought is to set up a multi-record editor for each of the main product categories (initially Cameras, Lenses, Filters Memory Cards, Batteries, Flashes, and Lighting) and then create specific product records for each product in the appropriate main category editor.

I could then set up multi-value pulldown lists in each of those editors that pulls the individual product titles from each of the other databases, and then use those to set up the related products lists on the detail pages.

IT’S A MESS
I mocked up a few products and some relationships and it’s become really messy.

If a product category gets added it seems (with my limited programming knowledge) that it would have to be manually added to each editor and then to each viewer.

Products need to be entered in ascending hierarchical order (batteries before cameras) or there are no batteries to assign to a camera.

Any name changes in a previously used title field results in a “Previous selection,( no longer in list)” issue. This could prove very confusing to the client.

And on... And on...

That's when I decided that there must be a better way.

HELP
I was hoping that someone might have some thoughts about a more realistic approach to use in setting up the databases and viewers for a project like this?

Thanks,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php