Esempio n. 1
0
 public function getInput()
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_j2store/models/weights.php';
     $model = new J2StoreModelWeights();
     $lengths = $model->getWeights();
     //generate country filter list
     $length_options = array();
     foreach ($lengths as $row) {
         $length_options[] = JHTML::_('select.option', $row->weight_class_id, $row->weight_title);
     }
     return JHTML::_('select.genericlist', $length_options, $this->name, 'onchange=', 'value', 'text', $this->value);
 }
Esempio n. 2
0
 protected function getWeightClass($product_id)
 {
     $product = $this->getData($product_id);
     require_once JPATH_ADMINISTRATOR . '/components/com_j2store/models/weights.php';
     $model = new J2StoreModelWeights();
     $weights = $model->getWeights();
     //generate country filter list
     $weight_options = array();
     $weight_options[] = JHTML::_('select.option', 0, JText::_('J2STORE_METRICS_SELECT_WEIGHT_CLASS'));
     foreach ($weights as $row) {
         $weight_options[] = JHTML::_('select.option', $row->weight_class_id, $row->weight_title);
     }
     return JHTML::_('select.genericlist', $weight_options, 'jform[attribs][item_metrics][item_weight_class_id]', 'onchange=', 'value', 'text', $product->item_weight_class_id);
 }