문제

Is there a way I could retrieve all the custom options and their values? (not from a specific product, but just all of the options)

도움이 되었습니까?

해결책

I found this solution:

    $tableName = $this->_resourceConnection->getTableName('catalog_product_option_type_title');

    $connection = $this->_resourceConnection->getConnection();
    $query = "SELECT * FROM " . $tableName;
    $resultOptions = $connection->fetchAll($query);

다른 팁

If you are trying to retrieve custom options and their values for one time you can use mysql query else you can have your own kind of implementations based on the below sql.

mysql> select t4.title as 'Custom Option', t3.Custom_Option_Values from (select t2.option_id, t1.option_type_id,t1.title as 'Custom_Option_Values' from catalog_product_option_type_title t1 left join catalog_product_option_type_value t2 on t1.option_type_id = t2.option_type_id) t3 left join catalog_product_option_title t4 on t3.option_id = t4.option_id;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top