public function getInput() { require_once JPATH_ADMINISTRATOR . '/components/com_j2store/models/lengths.php'; $model = new J2StoreModelLengths(); $lengths = $model->getLengths(); //generate country filter list $length_options = array(); foreach ($lengths as $row) { $length_options[] = JHTML::_('select.option', $row->length_class_id, $row->length_title); } return JHTML::_('select.genericlist', $length_options, $this->name, 'onchange=', 'value', 'text', $this->value); }
protected function getLengthClass($product_id) { $product = $this->getData($product_id); require_once JPATH_ADMINISTRATOR . '/components/com_j2store/models/lengths.php'; $model = new J2StoreModelLengths(); $lengths = $model->getLengths(); //generate country filter list $length_options = array(); $length_options[] = JHTML::_('select.option', 0, JText::_('J2STORE_METRICS_SELECT_LENGTH_CLASS')); foreach ($lengths as $row) { $length_options[] = JHTML::_('select.option', $row->length_class_id, $row->length_title); } return JHTML::_('select.genericlist', $length_options, 'jform[attribs][item_metrics][item_length_class_id]', 'onchange=', 'value', 'text', $product->item_length_class_id); }