質問

example: i have a table "table_1" i want to join product collection to get the product data? but I don't know how to join product collection? so everybody can help me pls?

  • List item

役に立ちましたか?

解決

Found this one, you can try it (this is untested):

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$collection = $objectManager->get('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory')->getCollection();
$collection->getSelect()->join( array('custom_table'=> 'table_1'), 'custom_table.id = main_table.entity_id', array('custom_table.sku'));   
ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top