hello all. im some what a newbie to php/java script mixtures. i'm working on a site that uses Zen-Cart. what im trying to do is . in the product page http://yourpagetest.com/index.php?main_page=product_info&cPath=12&products_id=9 of my site it has attributes that are made in a admin area. which are made up of [name] and [menu] example of code that can be edited.
<div class="wrapperAttribsOptions">
<h4 class="optionName back"><?php echo $options_name[$i]; ?></h4>
<?php
/* the $i value is the position your attribute shows up product id is the id you
* are modifing. this creates the table which you may need to modify the
* options for your site follow the same schema to add drop downs for
* different products
*/
if($i==0){if (($_GET['products_id']) == 9){echo'<table border="0" cellspacing="0" cellpadding="4"><tr><td valign="top">';}}
echo "\n" . $options_menu[$i];
/* After the options are displayed this will close the table. You will need to
* change the img src to point to the default image. This also creates the id
* tag for the image using img as prefix and the option name you will need
* to know this info to update the jscript_showimage.js file if you are using a
* separate default image for each of your dropdowns you will need a separate
* line for each or you create a small image file and have it say please choose
*/
if($i==0){if (($_GET['products_id']) == 9) {echo'</td><td valign="top"><align="center"><img src="includes/templates/darkness/images/PROD_9/12" id="img'.strip_tags($options_name[$i]).'"></table>';}}
?>
ive added a option that shows a image next to a dropdown menu selection thats the extra stuff you see in the code.
my ? is i want to take the dropdown menus and put them into a dynamic dropdowns. similar to this http://javascriptkit.com/script/script2/triplecombo.shtml
the attributes are stored in the data base by # like so. :
Name- Shirt Styles = attribute-1
Vneck = id =12
Hoodie = id = 13
if im not mistaken there should be a way of calling attribute-1 to show its menu
and when selecting a option out of the menu it will show values for that selection. see if this makes sense
if id=attribute-1 get names in menu
if id=name,12 show in next attribute
because i can make duplicate names of menus, like have something like this
colors, red=10,black=11,green=12 (menu=attribute=2)
colors, black=13,red=14,green=15 (menu=attribute=3)
and so on. these would be stored in data base. but they will not show unless i install them to a certain product.
another example:
if vneck is selected from attribute 1 it would show colors availble from attribute 2 (colors)and when color is selected it would show Size from attribute 3 (sizes)
im sorry if im rambling on but im trying to get as much as i know about the code im working with.
note: it seems that 3-4 files make what i have now work. so i would assume i'd be chaning more than one file.
files:
tbl_modules_attributes.php
attributes.php
attributes_controller.php (admin section)
and maybe a few java files that im not to sure about.
i thank anyone very very much for any info on this.