Skip to content
Snippets Groups Projects
Commit 7c1a2f5b authored by Vitalii Zabaznov's avatar Vitalii Zabaznov
Browse files

MAGETWO-44109: Import Custom Options grid contains Downloadable product if...

MAGETWO-44109: Import Custom Options grid contains Downloadable product if Import Custom Options for Simple product
parent c7854554
Branches
No related merge requests found
...@@ -62,7 +62,20 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid ...@@ -62,7 +62,20 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid
protected function _prepareCollection() protected function _prepareCollection()
{ {
parent::_prepareCollection(); parent::_prepareCollection();
$this->getCollection()->addFieldToFilter('has_options', 1);
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
);
$this->_productFactory->create()->getMediaGalleryEntries();
return $this; return $this;
} }
......
...@@ -97,6 +97,7 @@ jQuery(function ($) { ...@@ -97,6 +97,7 @@ jQuery(function ($) {
'customOptionsUrl' => $block->getCustomOptionsUrl(), 'customOptionsUrl' => $block->getCustomOptionsUrl(),
'isReadonly' => $block->isReadonly(), 'isReadonly' => $block->isReadonly(),
'itemCount' => $block->getItemCount(), 'itemCount' => $block->getItemCount(),
'currentProductId' => $block->getRequest()->getParam('id'),
] ]
)?>); )?>);
//adding data to templates //adding data to templates
......
...@@ -179,7 +179,7 @@ define([ ...@@ -179,7 +179,7 @@ define([
}); });
importContainer.load( importContainer.load(
this.options.productGridUrl, this.options.productGridUrl,
{form_key: this.options.formKey}, {form_key: this.options.formKey, current_product_id : this.options.currentProductId},
function () { function () {
importContainer.modal('openModal'); importContainer.modal('openModal');
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment