Example #1
0
 /**
  * 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;
 }
Example #2
0
 /**
  * Initialize select
  *
  * @return $this
  */
 protected function _initSelect()
 {
     parent::_initSelect();
     $this->_joinFields();
     return $this;
 }
Example #3
0
 /**
  * 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('*'));
 }
Example #4
0
 /**
  * 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;
 }
Example #5
0
 /**
  * Init Select
  *
  * @return \Magento\Catalog\Model\Resource\Product\Collection
  */
 protected function _initSelect()
 {
     parent::_initSelect();
     $this->_joinReview();
     return $this;
 }
Example #6
0
 /**
  * Initialize collection select
  *
  * @return $this|void
  */
 protected function _initSelect()
 {
     parent::_initSelect();
     $this->getSelect()->join(['selection' => $this->_selectionTable], 'selection.product_id = e.entity_id', ['*']);
 }