سؤال

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