Tell me. Is there any functionality to get all the options and only them? what module can eat.

There are options for products. These options can be picked up to the goods. this is not a question and there is no problem getting options for this product. And I need to get all the options and their values ​​without reference to any product.

    1 answer 1

    In the model, add a method (for example, in catalog / product, not the essence):

    public function getAllOptions() { $option_value_description = array(); $option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "option_description WHERE language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY option_id ASC"); foreach ($option_value_query ->rows as $option){ $option_value_description_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "option_value_description WHERE option_id = " . $option['option_id'] . " AND language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY option_value_id ASC"); $option_value_description[$option['name']] = $option_value_description_query->rows; } return $option_value_description; } 

    Somewhere in the controller, call the model method:

     $this->load->model('catalog/category'); //подключение модели .... $all_options = $this->model_catalog_product->getAllOptions(); 

    As a result, get an array of options:

     Array( [опция1] => Array( [0] => Array ( [option_value_id] => ... [language_id] => ... [option_id] => ... [name] => ... ) [1] => ... [опция2] => Array( ... ....