There is only one look up table possible. In your code you replace the var lookup_table ($tabledit->lookup_table) so only the product_types appear in the editor (I think...)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to have more than one drop down in the edit and add sections but when I add one then the other doesnt work.
There is only one look up table possible. In your code you replace the var lookup_table ($tabledit->lookup_table) so only the product_types appear in the editor (I think...)
I ended up creating custom add and edit pages.
Index.php
$tabledit->lt_product_tax = array(
'product_tax' => array(
'query' => "SELECT
tax
,tax_text
FROMtax_rate
;",'option_value' => 'tax',
'option_text' => 'tax_text'
)
);
$tabledit->lt_product_type = array(
'product_type' => array(
'query' => "SELECT
type
FROMproduct_types
;",'option_value' => 'type',
'option_text' => 'type'
)
);
mte.php
$lt_fieldname = 'lt_' . $key;
if (isset($this->$lt_fieldname[$key])) {
if (is_array($this->$lt_fieldname[$key])) {
$result = mysqli_query($this->mysqli,$this->$lt_fieldname[$key]['query']);
if (mysqli_num_rows($result) > 0) {
while ($menu_items = mysqli_fetch_assoc($result)) {
$option_value = $menu_items[$this->l$t_fieldname[$key]['option_value']];
$option_text = $menu_items[$this->$lt_fieldname[$key]['option_text']];
Last edit: André Fournier 2017-11-27
Hi Andre,
What line int mte.php did you place your code or did you overwrite the lookup_table section?
Thanks.