First we will create the file in our extension like:
getQuery(true); $query->select('product_id, product_name'); $query->from('#__hikashop_product'); $query->where('product_published = 1'); $query->where('product_type = ' . $db->quote('main')); $query->order('product_name ASC'); $db->setQuery($query); if($products = $db->loadObjectList()) { foreach ($products as $product) { $options[] = JHtml::_('select.option', $product->product_id, $product->product_name . ' (' . $product->product_id . ')'); } } return JHTML::_('select.genericlist', $options, $this->name, 'class="inputbox"', 'value', 'text', $this->value); } }
In our extension parameters we will add something like: