Zen Cart Logo
Forums / General Questions / Link Attribute Option To Another Product

Link Attribute Option To Another Product

Views: 1,158

Results 1 to 7 of 7
20 Apr 2011, 3:43 PM
#1
antoineyow avatar

antoineyow

New Zenner

Join Date:
Oct 2005
Posts:
15
Plugin Contributions:
0

Link Attribute Option To Another Product

Hello, I need some help figuring out how to link a color option to another product in my store.
Essentially what I am trying to do is to have a drop down menu on the product detail page with various colors that links to another product.

I cannot use the image swap module because it only swap the main product image and my products have additional images so I had to create the products separately.
If you have any suggestions, clues, ideas or experience please let me know as I am about to rip my hair out :)

20 Apr 2011, 4:36 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Link Attribute Option To Another Product

You will have to explain in more detail how you want this "link" to work. We can't answer from this. It sounds like you may be looking at a significant coding job, depending on what you really want.

20 Apr 2011, 5:22 PM
#3
antoineyow avatar

antoineyow

New Zenner

Join Date:
Oct 2005
Posts:
15
Plugin Contributions:
0

Re: Link Attribute Option To Another Product

Check this out: I need a poor man's version of this... http://www.shopbop.com/actions/quickShopProductDetailPageAction.action?stripType=DP&productID=845524441899736&folderID=2534374302024684&height=465&width=610&TB_iframe=true click on the color option and see what happens.

The way I imagine it working is:

ADMIN

  • admin create an option name, add a value and then add it to a product
  • when adding the attribute to the product there should be a textbox to input a link (similar to the Price and Weight section where you can add custom value to a single option).

USER

  • frontend browsing works the same, the only difference is if they are on a product with multiple option (please view link http://www.11redpixels.com/z/color_switch.gif) once they click on cinnamon it take them to that product.
  • so basically it will work as a "product swap".

Thats how I think it works, honestly not sure. I have never seen anything like it

20 Apr 2011, 7:17 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Link Attribute Option To Another Product

That's not going to a different product; it's just showing images for the same product in the selected color. It would require some custom javascript. There are mods in Free Addons for image swapping, but I don't think they work quite like this.

20 Apr 2011, 7:28 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Link Attribute Option To Another Product

I think you have made the job harder by separating the colors into different products. With the usual arrangement of attributes, you could build some javascript that would edit the base image name when a selection is made. It might work best to code the PHP to look up variants on the base image name according to some attribute information, find all the images that correspond to those base names, and put this info into some form that is accessible to js. Then have the js swap sets of images on change of whatever attribute is relevant.

21 Apr 2011, 6:39 PM
#6
antoineyow avatar

antoineyow

New Zenner

Join Date:
Oct 2005
Posts:
15
Plugin Contributions:
0

Re: Link Attribute Option To Another Product

The store uses a lot of different modules that wouldn't allow me to just have a single product with multiple options like that. I guess I am going to have to create a my own version.
Thanks for clarifying things for me!

25 Apr 2011, 8:02 PM
#7
antoineyow avatar

antoineyow

New Zenner

Join Date:
Oct 2005
Posts:
15
Plugin Contributions:
0

Re: Link Attribute Option To Another Product

Hello, progress update...
now I can insert a link per option in the attribute controller, its saving to the database without any issues.
My problem is how do I get that link to show up on the frontend. It seems as if there are 2 files controlling this (html_output.php and attributes.php). Any suggestion would be welcome!

Ideally should look like this <option value="value-from-zencart" title="the-new-link-ive-added">Option Value</option>

I can always convert this to a jump menu so I'm not worried about that.