Hi There:
I had the same issue. And thank you this post got me on the right track
I initially set things up the same way you did but the copy the name from above bit really bugged me as it comes off as being clunky. After a couple of false starts and hair pulling i was able to come up with a method to integrate external drop down list into the Attributes system of ZenCart.
First off I created a Text Entry in Catalog:Option Name Manager to hold the drop down list result.
Then I inserted the includes into tpl_modules_attributes.php as opposed to product info to get the dropdown to appear after the Please Choose: header for the Attributes.
Code:
<?php if ($zv_display_select_option > 0) { ?>
<h3 id="attribsOptionsText">
<?php echo TEXT_PRODUCT_OPTIONS; ?></h3><?php } // show please select unless all are readonly ?>
<!--bof Available Names -->
<?php if (($_GET['products_id']) == '3') { include 'prd_03.php'; }
elseif (($_GET['products_id']) == '4') { include 'prd_04.php'; }
elseif (($_GET['products_id']) == '5') { include 'prd_05.php'; }
elseif (($_GET['products_id']) == '6') { include 'prd_06.php'; }
elseif (($_GET['products_id']) == '7') { include 'prd_07.php'; }
elseif (($_GET['products_id']) == '8') { include 'prd_08.php'; }?>
<!--eof Available Names -->
<?php for($i=0;$i<sizeof($options_name);$i++) {?>
For the include files I made some name and code changes to insert the selection into data tables along the lines of the following:
Code:
<div id="productAttributes">
<div class="wrapperAttribsOptions">
<h4 class="optionName back">
<label class="attribsSelect" for="attrib-17">Child's Name: </label>
</h4>
<div class="back">
<select name="id[txt_17]" id="attrib-17">
<option value="0" selected="selected">-- Please Choose --</option>
<option value="3">A.J.</option>
.
.
.
<option value="9189">Zoe</option></select></div>
<br class="clearBoth" />
</H4>
Now the Selection gets passed along to the Cart etc.
I'll likely play with this a little more to see if I can convinve ZenCart to Parse and Verify the customers entry to see if they didn't just leave the selection at -- Please Choose -- and rebuild the option list so the names are passed instead of reference #'s but for now at least I can focus on the rest of my 101 things to do list.
If you want to have a look see http://www.namethosesongs.com still in work in progress mode but feedback is always welcome!
Greg
Bookmarks