Here are 3 steps for you to Join Product Tables with Custom Table to Get Product Data without Product Collection:

  1. Get your custable table collection, you must have your custom table collection class early.
  2. To fill product data into your collection, you must join your custom table collection with “catalog_product_entity” table
  3. To get other product data, you must get them from value tables of product. But before that, you must get attribute ids of product data

1.Get your custable table collection, you must have your custom table collection class early.

$collection->getSelect()->joinLeft(

2.To fill product data into your collection, you must join your custom table collection with “catalog_product_entity” table.

$productNameAttributeId = $this->_objectManager

3.To get other product data, you must get them from value tables of product. But before that, you must get attribute ids of product data. Example, I fill product name into custom table collection.

$productPriceAttributeId = $this->_objectManager

4.Example with product price and product status.

 

 

We also contribute great content of Magento Download for FREE (all versions)

DON'T MISS THE CHANCE!

magento download

How to Remove Magento 2 Extension by Composer

Leave a Reply

Your email address will not be published. Required fields are marked *