Zen Cart Logo
Forums / General Questions / How do you identify linked products in different categories? Same model number??

How do you identify linked products in different categories? Same model number??

Locked

Views: 851

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
12 Nov 2010, 8:50 PM
#1
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

How do you identify linked products in different categories? Same model number??

Hi

I have lots of different categories to represent different ranges of a product. But in each category are the same products linked. They are all the same price and everything so I dont want duplicate them.

But when a customer buys a product the model numbers are the same across all categories, and the category name is not appearing in the order.

So is there any way to identify which products are ordered, or which categories they came from? We do not want the category name in the title of each product.

Thanks

12 Nov 2010, 10:38 PM
#2
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

Re: How do you identify linked products in different categories? Same model number??

Clearly I have completely overlooked the fact that a linked product is the EXACT same product as in the master category with no linkage to the category you viewed it in. I think this is a big issue for linked products, I am sure there would be many people who would like to know which category the linked product came from. Separate products and attributes would mean a massive database for my site..

So I may have a workaround that I think works well but does mean some hacking (all template files though).

I created a custom text field and managed to insert the category name into this to pass as an attribute of the purchased product.

Here is an overview if interested:-

  • I created a Text attribute called Range (which is our category)
  • I have hidden this box with "display: none" (the only way to identify it was hack attributes.php and tpl_modules_attributes.php to add a class to each attribute "wrapperAttribsOptions" div to identify it).
  • Then I added in custom input type="hidden" box with the name of the above hidden text attribute.
  • Using Ultimate SEOs I added the cPath onto the product URLs. Luckily this DOES keep the actual category you are in rather than the master one!
  • Then using function zen_get_category_name() I was able to get the Category name from the cPath, which I then inserted as the Value in the hidden input form, which when submitted will submit this value as the textbox attribute.
    So this means the category of the linked product is passed to the cart as an attribute of the product which is fine.

The above would be quite straightforward to include, so would be good if next Zencart version allowed you to pass this category info from a linked product.

12 Nov 2010, 10:43 PM
#3
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

Re: How do you identify linked products in different categories? Same model number??

There are of course problems with things like New, Featured, Bestsellers, etc. which cannot link to a specific category so i have disabled all those and have to add links to products in manually if needed.