-- url of the page with the problem -- localhost
-- HikaShop version -- :HK Essential: 2.3.0
-- Joomla version -- :2.5.19
-- PHP version -- : 5.3.13
-- Browser(s) name and version -- : FreFox 27.0.1
-- Error-message(debug-mod must be tuned on) -- : Error_message
Hi, I would like to implement linked dynamic comboboxes for product charateristics (ie parent-child drop-downs) using an approach similar to the reference listed below:
Dynamic Dropdowns with charateristics & options
Being a novice HK user, I would like to ask a few questions before venturing in coding:
1. Child drop-down location. My understanding is that the child drop-down html code needs to be explicitely defined. If so, in which file should the child drop-down be inserted into (show_block_characteristics.php, option.php, ..) and how should the select html skeleton be structured? (Note that parents and children share the same class.)
<!-- Parent drop-down skeleton: -->
<select id="hikashop_product_characteristic_1" onchange="return hikashopUpdateVariant(this);">..
<option value="10" class="opt1" selected="selected">Option 1</option>
<option value="11" class="opt2">Option 2</option>
<option value="12" class="opt3">Option 3</option>
...
</select>
....
<!-- Child drop-down skeleton: -->
<select id="hikashop_product_option_1" name="hikashop_product_option[1]" onchange="hikashopChangeOption();;">
<option value="0" class="opt1" selected="selected">None</option>
<option value="100" class="opt1"> Option 1.1</option>
...
<option value="0" class="opt2" selected="selected">None</option>
<option value="200" class="opt2"> Option 2.1</option>
....
<option value="0" class="opt3" selected="selected">None</option>
<option value="300" class="opt3"> Option 3.1</option>
...
</select>
2. jQuery. The child option drop-down should only reveal items that share the same class as their parent (ie opt1, opt2, etc.), the other items remaining hidden. Can the js module be written with jQuery? If so, where should the jQuery module be located at?
// jQuery module:
function hikashopUpdateVariant(elSel) { .... };
3. Upgrades. Currently, I am using Essentials v 2.3.0. How code resilient would those changes be in regard to future releases?
TIA for any clarifications and hints.