Skip to main content
deleted 13 characters in body
Source Link

You can override

Magento\Catalog\Model\ResourceModel\Product\Collection class and join your custom collection with using _initSelect() function

Example:

            protected function _initSelect()
{
     $this->getSelect()->joinRight(
    ['secondTable' => $this->getTable('custom_table')],
    'secondTable.id = main_table.entity_id');
    return $this;
    }

You can override

Magento\Catalog\Model\ResourceModel\Product\Collection class and join your custom collection with using _initSelect() function

Example:

            protected function _initSelect()
{
     $this->getSelect()->joinRight(
    ['secondTable' => $this->getTable('custom_table')],
    'secondTable.id = main_table.entity_id');
    return $this;
    }

You can override

Magento\Catalog\Model\ResourceModel\Product\Collection class and join your custom collection with using _initSelect() function

Example:

protected function _initSelect()
{
    $this->getSelect()->joinRight(['secondTable' => $this->getTable('custom_table')],'secondTable.id = main_table.entity_id');
    return $this;
}
Source Link
Rutvee Sojitra
  • 3.9k
  • 2
  • 18
  • 59

You can override

Magento\Catalog\Model\ResourceModel\Product\Collection class and join your custom collection with using _initSelect() function

Example:

            protected function _initSelect()
{
     $this->getSelect()->joinRight(
    ['secondTable' => $this->getTable('custom_table')],
    'secondTable.id = main_table.entity_id');
    return $this;
    }