cubecart / v6

CubeCart Version 6
https://cubecart.com
71 stars 59 forks source link

Option Types Lock-in #3538

Open bhsmither opened 3 months ago

bhsmither commented 3 months ago

In the admin template products.options.php, the Attributes tab, the select (line 70) and the accompanying fieldset (line 104) are locked to two specific option types: select and radio.

There are also checkbox and hidden types, as well as custom types, added through hooks, that then need to have value attributes associated with those types.

Maybe make Catalogue::_options_selectable and Catalogue::_options_textual public, or provide magic getter and setter for these arrays (able to marshal the array contents).

Eventually, in the admin script products.options.inc.php, near line 286, the template variable GROUPS could contain an element in $option to indicate that this is a 'selectable' type of option type.

Then, the template will test for 'selectable' instead of the hard-coded option types.

Please also look at template lines 169-185. (Select and Radio has the same code.)

bhsmither commented 3 months ago

Also look at products.index.inc.php, near line 792:

$select_types = array(0,4);