Frage

Ich habe einen neuen Produkttyp erstellt und wenn ich ein gruppiertes Produkt erstelle, kann ich derzeit keine Produkte meines neuen Typs unter damit verbundenen Produkten auswählen. Ich habe die SQL -Protokollierung aktiviert und sehe diese Abfrage:

SELECT 
    `e` . *,
    `links`.`link_id`,
    `link_attribute_position_int`.`value` AS `position`,
    `link_attribute_qty_decimal`.`value` AS `qty`
FROM
    `catalog_product_entity` AS `e`
        LEFT JOIN
    `catalog_product_link` AS `links` ON links.linked_product_id = e.entity_id
        AND links.link_type_id = 3
        AND links.product_id = '4'
        LEFT JOIN
    `catalog_product_link_attribute_int` AS `link_attribute_position_int` ON link_attribute_position_int.link_id = links.link_id
        AND link_attribute_position_int.product_link_attribute_id = '2'
        LEFT JOIN
    `catalog_product_link_attribute_decimal` AS `link_attribute_qty_decimal` ON link_attribute_qty_decimal.link_id = links.link_id
        AND link_attribute_qty_decimal.product_link_attribute_id = '3'
WHERE
    (((`e`.`required_options` != '1') OR (`e`.`required_options` IS NULL)))
    AND (((`e`.`type_id` = 'simple') OR (`e`.`type_id` = 'virtual') OR (`e`.`type_id` = 'downloadable')))
    AND (`e`.`entity_id` != '4')
ORDER BY `e`.`entity_id` DESC
LIMIT 20

Ich weiß, dass dies die Abfrage ist, die die Produkte erhalten, die ich für das Netz auswählen kann, aber ich kann nicht herausfinden WHERE Klausel. Hier ist die Stapelspur für die Abfrage:

#1 Magento_Db_Adapter_Pdo_Mysql[Varien_Db_Adapter_Pdo_Mysql]#000000004a3d0c9b00007f76c0d70388#->_debugStat(2, 'SELECT `e`.*, `l...', array(), &Varien_Db_Statement_Pdo_Mysql#000000004
#2 Magento_Db_Adapter_Pdo_Mysql[Varien_Db_Adapter_Pdo_Mysql]#000000004a3d0c9b00007f76c0d70388#->query('SELECT `e`.*, `l...', array()) called at [lib/Zend/Db/Adapter/Abstract.php:734]
#3 Magento_Db_Adapter_Pdo_Mysql[Zend_Db_Adapter_Abstract]#000000004a3d0c9b00007f76c0d70388#->fetchAll('SELECT `e`.*, `l...', array()) called at [lib/Varien/Data/Collection/Db.php:734]
#4 Mage_Catalog_Model_Resource_Product_Link_Product_Collection[Varien_Data_Collection_Db]#000000004a3d0ea500007f76c0d70388#->_fetchAll('SELECT `e`.*, `l...') called at [app/code/core/Mage/E
#5 Mage_Catalog_Model_Resource_Product_Link_Product_Collection[Mage_Eav_Model_Entity_Collection_Abstract]#000000004a3d0ea500007f76c0d70388#->_loadEntities(false, false) called at [app/code/
#6 Mage_Catalog_Model_Resource_Product_Link_Product_Collection[Mage_Eav_Model_Entity_Collection_Abstract]#000000004a3d0ea500007f76c0d70388#->load() called at [app/code/core/Mage/Adminhtml/B
#7 Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group[Mage_Adminhtml_Block_Widget_Grid]#000000004a3d0ebe00007f76c0d70388#->_prepareCollection() called at [app/code/core/Mage/Adminhtm
#8 Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group#000000004a3d0ebe00007f76c0d70388#->_prepareCollection() called at [app/code/core/Mage/Adminhtml/Block/Widget/Grid.php:626]
#9 Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group[Mage_Adminhtml_Block_Widget_Grid]#000000004a3d0ebe00007f76c0d70388#->_prepareGrid() called at [app/code/core/Mage/Adminhtml/Bloc
#10 Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group[Mage_Adminhtml_Block_Widget_Grid]#000000004a3d0ebe00007f76c0d70388#->_beforeToHtml() called at [var/Mage_Core_Block
#11 Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group[Mage_Core_Block_Abstract]#000000004a3d0ebe00007f76c0d70388#->toHtml() called at [app/code/core/Mage
#12 Mage_Core_Block_Text_List#000000004a3d0ef700007f76c0d70388#->_toHtml() called at [var/Mage_Core_Block_Abstract.php:921]
#13 Mage_Core_Block_Text_List[Mage_Core_Block_Abstract]#000000004a3d0ef700007f76c0d70388#->toHtml() called at [app/code/core/Mage/Core/Model/Layout.php:555]
#14 Mage_Core_Model_Layout#000000004a3d0cf300007f76c0d70388#->getOutput() called at [app/code/core/Mage/Core/Controller/Varien/Action.php:390]
#15 Mage_Adminhtml_Catalog_ProductController[Mage_Core_Controller_Varien_Action]#000000004a3d0ce600007f76c0d70388#->renderLayout() called at [app/code/core/Mage/Adminhtml/controllers/Catalo
#16 Mage_Adminhtml_Catalog_ProductController#000000004a3d0ce600007f76c0d70388#->superGroupGridOnlyAction() called at [app/code/core/Mage/Core/Controller/Varien/Action.php:418]
#17 Mage_Adminhtml_Catalog_ProductController[Mage_Core_Controller_Varien_Action]#000000004a3d0ce600007f76c0d70388#->dispatch('superGroupGridOn...') called at [app/code/core/Mage/Core/Contro
#18 Mage_Core_Controller_Varien_Router_Admin[Mage_Core_Controller_Varien_Router_Standard]#000000004a3d0cac00007f76c0d70388#->match(&Mage_Core_Controller_Request_Http#000000004a3d0cc600007f7
#19 Mage_Core_Controller_Varien_Front#000000004a3d0c5400007f76c0d70388#->dispatch() called at [app/code/core/Mage/Core/Model/App.php:354]
#20 Mage_Core_Model_App#000000004a3d0cd800007f76c0d70388#->run(array('scope_code' => '', 'scope_type' => 'store', 'options' => array())) called at [app/Mage.php:684]
#21 Mage::run('', 'store') called at [index.php:87]
War es hilfreich?

Lösung

Ich habe es endlich gefunden. Es ist natürlich in Config.xml festgelegt. Es ist in mage_adminhtml_block_catalog_product_edit_tab_super_group :: _ prepareCollection (). Die zweite Zeile erhält alle Knoten:

Mage::getConfig()->getNode('global/catalog/product/type/grouped/allow_product_types')->children();

Nachdem sie alle Knotennamen erhalten haben, ist es der Abfrage mit einem einfachen hinzugefügt ->addAttributeToFilter('type_id', $allowProductTypes); Anruf.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit magento.stackexchange
scroll top