-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #566 from magento-goinc/MAGETWO-41755
[GoInc] Configurable Product Variation Update, manual selection product an association - create grid
- Loading branch information
Showing
20 changed files
with
802 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Filters.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\ConfigurableProduct\Ui\Component\Listing\AssociatedProduct; | ||
|
||
class Filters extends \Magento\Ui\Component\Filters | ||
{ | ||
/** | ||
* @var \Magento\Eav\Model\Resource\Entity\Attribute\CollectionFactory | ||
*/ | ||
protected $attributeCollectionFactory; | ||
|
||
/** | ||
* @param \Magento\Framework\View\Element\UiComponent\ContextInterface $context | ||
* @param \Magento\Catalog\Ui\Component\FilterFactory $filterFactory | ||
* @param \Magento\Eav\Model\Resource\Entity\Attribute\CollectionFactory $attributeCollectionFactory | ||
* @param array $components | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
\Magento\Framework\View\Element\UiComponent\ContextInterface $context, | ||
\Magento\Catalog\Ui\Component\FilterFactory $filterFactory, | ||
\Magento\Eav\Model\Resource\Entity\Attribute\CollectionFactory $attributeCollectionFactory, | ||
array $components = [], | ||
array $data = [] | ||
) { | ||
parent::__construct($context, $components, $data); | ||
$this->filterFactory = $filterFactory; | ||
$this->attributeCollectionFactory = $attributeCollectionFactory; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function prepare() | ||
{ | ||
$attributeIds = $this->context->getRequestParam('attribute_ids'); | ||
if ($attributeIds) { | ||
foreach ($this->getAttributes($attributeIds) as $attribute) { | ||
$filter = $this->filterFactory->create($attribute, $this->getContext()); | ||
$filter->prepare(); | ||
$this->addComponent($attribute->getAttributeCode(), $filter); | ||
} | ||
} | ||
parent::prepare(); | ||
} | ||
|
||
/** | ||
* @param array $attributeIds | ||
* @return mixed | ||
*/ | ||
protected function getAttributes($attributeIds) | ||
{ | ||
$attributeCollection = $this->attributeCollectionFactory->create(); | ||
return $attributeCollection->addFieldToFilter('attribute_code', ['in' => $attributeIds]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ableProduct/view/adminhtml/templates/catalog/product/edit/super/manual-product-grid.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
// @codingStandardsIgnoreFile | ||
|
||
/* @var $block \Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config\Grid\ManualProduct */ | ||
|
||
?> | ||
<div> | ||
<div data-role="messages" class="messages"> | ||
<div class="message "> | ||
<div> | ||
<?= __('Choose a new product to delete and replace the current product configuration.') ?> | ||
<?= __('For better results, add attributes and attribute values to your products.') ?> | ||
</div> | ||
</div> | ||
</div> | ||
<?= $block->getChildHtml(); ?> | ||
</div> |
Oops, something went wrong.