/** * Add attributes to select * * @return $this */ public function _initSelect() { parent::_initSelect(); $allowedProductTypes = $this->_productTypeConfig->getComposableTypes(); $this->addAttributeToSelect('name')->addAttributeToSelect('price')->addAttributeToSelect('sku')->addAttributeToSelect('weight')->addAttributeToSelect('image')->addFieldToFilter('type_id', $allowedProductTypes)->addFieldToFilter('entity_id', array('neq' => $this->getProduct()->getId()))->addFilterByRequiredOptions()->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner')->joinTable(array('cisi' => 'cataloginventory_stock_item'), 'product_id=entity_id', array('qty' => 'qty', 'inventory_in_stock' => 'is_in_stock'), null, 'left'); return $this; }
/** * Initialize select * * @return $this */ protected function _initSelect() { parent::_initSelect(); $this->_joinFields(); return $this; }
/** * Initialize collection select * * @return $this|void */ protected function _initSelect() { parent::_initSelect(); $this->getSelect()->join(array('selection' => $this->_selectionTable), 'selection.product_id = e.entity_id', array('*')); }
/** * Init select * @return $this|\Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable\Product\Collection */ protected function _initSelect() { parent::_initSelect(); $this->getSelect()->join(['link_table' => $this->_linkTable], 'link_table.product_id = e.entity_id', ['parent_id']); return $this; }
/** * Init Select * * @return \Magento\Catalog\Model\Resource\Product\Collection */ protected function _initSelect() { parent::_initSelect(); $this->_joinReview(); return $this; }
/** * Initialize collection select * * @return $this|void */ protected function _initSelect() { parent::_initSelect(); $this->getSelect()->join(['selection' => $this->_selectionTable], 'selection.product_id = e.entity_id', ['*']); }