コード例 #1
0
ファイル: Grid.php プロジェクト: pradeep-wagento/magento2
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     parent::_prepareCollection();
     if (null !== $this->getRequest()->getParam('current_product_id')) {
         $this->getCollection()->getSelect()->where('e.entity_id != ?', $this->getRequest()->getParam('current_product_id'));
     }
     $this->getCollection()->getSelect()->distinct()->join(['opt' => $this->getCollection()->getTable('catalog_product_option')], 'opt.product_id = e.entity_id', null);
     return $this;
 }
コード例 #2
0
ファイル: Grid.php プロジェクト: whoople/magento2-testing
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     parent::_prepareCollection();
     $this->getCollection()->addFieldToFilter('has_options', 1);
     return $this;
 }