diff --git a/app/code/Magento/Catalog/Block/Product/View/Gallery.php b/app/code/Magento/Catalog/Block/Product/View/Gallery.php index 2312a945f7d0a..f8b77d46d3ca7 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Gallery.php +++ b/app/code/Magento/Catalog/Block/Product/View/Gallery.php @@ -30,7 +30,8 @@ public function getGalleryImages() $product = $this->getProduct(); $images = $product->getMediaGalleryImages(); if ($images instanceof \Magento\Framework\Data\Collection) { - foreach ($images as &$image) { + foreach ($images as $image) { + /* @var \Magento\Framework\DataObject $image */ $image->setData( 'small_image_url', $this->_imageHelper->init($product, 'product_page_image_small') diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php index 9c50b8f3145ad..7b995dbd2a13e 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php @@ -62,10 +62,12 @@ public function execute() if ($attribute->getId() && !$attributeId) { if (strlen($this->getRequest()->getParam('attribute_code'))) { - $response->setAttributes(['attribute_code' => __('An attribute with this code already exists.')]); + $response->setMessage( + __('An attribute with this code already exists.') + ); } else { - $response->setAttributes( - ['attribute_label' => __('An attribute with the same code (%1) already exists.', $attributeCode)] + $response->setMessage( + __('An attribute with the same code (%1) already exists.', $attributeCode) ); } $response->setError(true); diff --git a/app/code/Magento/Catalog/Ui/Component/FilterFactory.php b/app/code/Magento/Catalog/Ui/Component/FilterFactory.php index a0d72392eb28e..a32daf19149a5 100644 --- a/app/code/Magento/Catalog/Ui/Component/FilterFactory.php +++ b/app/code/Magento/Catalog/Ui/Component/FilterFactory.php @@ -43,7 +43,7 @@ public function create($attribute, $context) 'dataScope' => $columnName, 'label' => __($attribute->getDefaultFrontendLabel()), ]; - if ($attribute->usesSource()) { + if ($attribute->usesSource() && $attribute->getSourceModel()) { $config['options'] = $attribute->getSource()->getAllOptions(); $config['caption'] = __('Select...'); } diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Filters.php b/app/code/Magento/Catalog/Ui/Component/Listing/Filters.php index 0100320f03c07..9c2950a596bca 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Filters.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Filters.php @@ -7,6 +7,11 @@ class Filters extends \Magento\Ui\Component\Filters { + /** + * @var AttributeRepository + */ + protected $attributeRepository; + /** * @param \Magento\Framework\View\Element\UiComponent\ContextInterface $context * @param \Magento\Catalog\Ui\Component\FilterFactory $filterFactory diff --git a/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Filters.php b/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Filters.php new file mode 100644 index 0000000000000..af27ebc05c328 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Filters.php @@ -0,0 +1,59 @@ +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]); + } +} diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml index ae3896ffd097a..9ed318d2b3379 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml @@ -8,98 +8,8 @@ - - - configurable_associated_products_grid - Magento\ConfigurableProduct\Model\Resource\Product\Collection\AssociatedProduct - true - entity_id - DESC - 0 - - 1 - - - - - super_product_links - - - - ID - 60px - text - entity_id - entity_id - 0 - 1 - Magento\ConfigurableProduct\Block\Product\Configurable\AssociatedSelector\Renderer\Id - - - - - Name - text - 1 - name - name - 0 - 1 - - - - - Price - currency - price - price - 0 - 1 - - - - - SKU - text - 1 - sku - sku - 0 - 1 - - - - - Weight - text - weight - weight - 0 - 1 - - - - - Stock Availability - text - inventory_in_stock - inventory_in_stock - 0 - 1 - Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config\Grid\Renderer\Inventory - - - - - Qty - text - qty - qty - 0 - 1 - - - + + diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/attributes_values.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/attributes_values.phtml index a1a753039f100..9485d0efef19d 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/attributes_values.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/attributes_values.phtml @@ -30,12 +30,24 @@
- - +
diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/summary.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/summary.phtml index 305a17dc62ec3..32d619aee3d89 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/summary.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/summary.phtml @@ -14,7 +14,7 @@