1800contacts Posted April 18, 2003 Share Posted April 18, 2003 Hi I am working on a contact lenses website. Among all the different categories, i want to create a separate 'color' drop down menu ONLY in the 'color contacts' category. So, when customers select 'color contacts' category and pick one of the product, it will show a 'pick a color' drop down menu in product_info.php that can let users select all the different colors. Can someone tell me how can I can i do that? Also, how can I integrate that in admin/categories.php section? Thanks. :lol: Richard da bomb Link to comment Share on other sites More sharing options...
Guest Posted April 18, 2003 Share Posted April 18, 2003 You can achieve the dropdown on a per product basis using the Product Attributes feature in OSCommerce. Link to comment Share on other sites More sharing options...
Lakeland Posted April 18, 2003 Share Posted April 18, 2003 Hi I am working on a contact lenses website. Among all the different categories, i want to create a separate 'color' drop down menu ONLY in the 'color contacts' category. So, when customers select 'color contacts' category and pick one of the product, it will show a 'pick a color' drop down menu in product_info.php that can let users select all the different colors. Can someone tell me how can I can i do that? Also, how can I integrate that in admin/categories.php section? Thanks. :lol: Use the attributes in your admin section.When in the attributes where it says option name type in colour.On the right hand side of the page start entering all the different colours one by one.Then at the bottom of the page choose the products you wish to add colours to and add each colour to that product one by one.You may also have multiple choices eg colour size and where it says value price put in how much more the product will cost from standard and any extra cost will automaticaly added on. Hope this helps, Brian Link to comment Share on other sites More sharing options...
1800contacts Posted April 19, 2003 Author Share Posted April 19, 2003 Hi, Actually, I need to to put the below javascript function in the 'color lenses' category for preview puropose. When user click on the drop down list to select the color, the image will change according to the color that the user pick. This does not have to link to the database, so, I won't have to change the admin section. The javascript code is as follow: <html> <head> <title>Untitled Document</title> </head> <body> <img src="1.gif" width="88" height="51" border="1" name="base" alt="1"> <form name="Myform"> <script language="JavaScript" type="text/javascript"> image1 = new Image(); image1.src = "1.gif"; //first image image2 = new Image(); image2.src = "2.gif"; //second image // Insert your text for each picture red= new Array(); red[0]="This is the first lense."; red[1]="This is the second lense."; dom = (document.getElementById)? true:false ns4 = (document.layers)? true:false ie4 = (document.all && !dom)? true:false if (ns4) document.write('<textarea name="dropdownchanger" wrap="soft" rows="5" cols="20">' +red[0] + '</textarea><br>') //Set the width and height of your textarea else document.write('<div id="dropdownchanger" style="width:200px; height:50px;"><p>' +red[0] + '</p></div>') function change(){ document.base.src=eval(document.Myform.Myselect.options[document.Myform.Myselect.options.selectedIndex].value); if (ns4) {document.Myform.dropdownchanger.value=red[document.Myform.Myselect.options.selectedIndex]} if (ie4) {document.all['dropdownchanger'].innerHTML ='<p>' + red[document.Myform.Myselect.options.selectedIndex] + '</p>'} else if (dom) {document.getElementById("dropdownchanger").innerHTML ='<p>' + red[document.Myform.Myselect.options.selectedIndex] + '</p>'} } </script> <select name="Myselect" onChange="change()" size="1"> <option value="image1.src" selected>Contacts 1</option> <option value="image2.src">Contacts 2</option> </select> </form> </body> </html> I only want to put the above code in product_info.php of 'color lenses' category only, not the other category. what kind of 'if' statement do i need to accomplish this? Richard da bomb Link to comment Share on other sites More sharing options...
Lakeland Posted April 19, 2003 Share Posted April 19, 2003 Dont know the answer to that.Sorry Hi, Actually, I need to to put the below javascript function in the 'color lenses' category for preview puropose. When user click on the drop down list to select the color, the image will change according to the color that the user pick. This does not have to link to the database, so, I won't have to change the admin section. The javascript code is as follow: <html> <head> <title>Untitled Document</title> </head> <body> <img src="1.gif" width="88" height="51" border="1" name="base" alt="1"> <form name="Myform"> <script language="JavaScript" type="text/javascript"> image1 = new Image(); image1.src = "1.gif"; //first image image2 = new Image(); image2.src = "2.gif"; //second image // Insert your text for each picture red= new Array(); red[0]="This is the first lense."; red[1]="This is the second lense."; dom = (document.getElementById)? true:false ns4 = (document.layers)? true:false ie4 = (document.all && !dom)? true:false if (ns4) document.write('<textarea name="dropdownchanger" wrap="soft" rows="5" cols="20">' +red[0] + '</textarea><br>') //Set the width and height of your textarea else document.write('<div id="dropdownchanger" style="width:200px; height:50px;"><p>' +red[0] + '</p></div>') function change(){ document.base.src=eval(document.Myform.Myselect.options[document.Myform.Myselect.options.selectedIndex].value); if (ns4) {document.Myform.dropdownchanger.value=red[document.Myform.Myselect.options.selectedIndex]} if (ie4) {document.all['dropdownchanger'].innerHTML ='<p>' + red[document.Myform.Myselect.options.selectedIndex] + '</p>'} else if (dom) {document.getElementById("dropdownchanger").innerHTML ='<p>' + red[document.Myform.Myselect.options.selectedIndex] + '</p>'} } </script> <select name="Myselect" onChange="change()" size="1"> <option value="image1.src" selected>Contacts 1</option> <option value="image2.src">Contacts 2</option> </select> </form> </body> </html> I only want to put the above code in product_info.php of 'color lenses' category only, not the other category. what kind of 'if' statement do i need to accomplish this? Link to comment Share on other sites More sharing options...
gannonh Posted April 25, 2003 Share Posted April 25, 2003 I'm looking for a very similar solution to what you describe. Please let me know if you figure it out. I'll do the same from my end. Link to comment Share on other sites More sharing options...
Guest Posted May 2, 2003 Share Posted May 2, 2003 You could try adding the category description contribution. Place the javascript in the description of the category you want to use it in. I dont know if it will work. Worth a try tho. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.