From 305aa0bb49e22e55ac7b5e83a8896de266241f35 Mon Sep 17 00:00:00 2001 From: NamrataChangani Date: Tue, 5 Jun 2018 14:11:25 +0530 Subject: [PATCH 1/2] Fixed set template syntax issue --- .../Fieldset/Options/Type/Checkbox.php | 2 +- .../Composite/Fieldset/Options/Type/Multi.php | 2 +- .../Composite/Fieldset/Options/Type/Radio.php | 2 +- .../Fieldset/Options/Type/Select.php | 2 +- .../Catalog/Product/Edit/Tab/Bundle.php | 2 +- .../Product/Edit/Tab/Bundle/Option.php | 2 +- .../Product/Edit/Tab/Bundle/Option/Search.php | 2 +- .../Edit/Tab/Bundle/Option/Selection.php | 2 +- .../View/Type/Bundle/Option/Checkbox.php | 2 +- .../Product/View/Type/Bundle/Option/Multi.php | 19 ++++++++++++++++++- .../Product/View/Type/Bundle/Option/Radio.php | 2 +- .../View/Type/Bundle/Option/Select.php | 2 +- 12 files changed, 29 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php index 95486e0ee8bf9..b3a0b0ec0a380 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php @@ -15,7 +15,7 @@ class Checkbox extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Op /** * @var string */ - protected $_template = 'product/composite/fieldset/options/type/checkbox.phtml'; + protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/checkbox.phtml'; /** * @param string $elementId diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php index 58b9304e31274..754fe14c9cf02 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php @@ -15,7 +15,7 @@ class Multi extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio /** * @var string */ - protected $_template = 'product/composite/fieldset/options/type/multi.phtml'; + protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/multi.phtml'; /** * @param string $elementId diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php index bb4b999418e52..274474a8ce9cd 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php @@ -15,7 +15,7 @@ class Radio extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio /** * @var string */ - protected $_template = 'product/composite/fieldset/options/type/radio.phtml'; + protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/radio.phtml'; /** * @param string $elementId diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php index 86f073c6b02bd..e2669f3bd019d 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php @@ -15,7 +15,7 @@ class Select extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Opti /** * @var string */ - protected $_template = 'product/composite/fieldset/options/type/select.phtml'; + protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/select.phtml'; /** * @param string $elementId diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php index d7ff808afb24d..00f5eadc70321 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php @@ -20,7 +20,7 @@ class Bundle extends \Magento\Backend\Block\Widget implements \Magento\Backend\B /** * @var string */ - protected $_template = 'product/edit/bundle.phtml'; + protected $_template = 'Magento_Bundle::product/edit/bundle.phtml'; /** * Core registry diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php index 5ffbf21edc46a..e9710467b0482 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php @@ -26,7 +26,7 @@ class Option extends \Magento\Backend\Block\Widget /** * @var string */ - protected $_template = 'product/edit/bundle/option.phtml'; + protected $_template = 'Magento_Bundle::product/edit/bundle/option.phtml'; /** * Core registry diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php index 737221d827b92..b9d1b3080161c 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php @@ -15,7 +15,7 @@ class Search extends \Magento\Backend\Block\Widget /** * @var string */ - protected $_template = 'product/edit/bundle/option/search.phtml'; + protected $_template = 'Magento_Bundle::product/edit/bundle/option/search.phtml'; /** * @return void diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php index 21ed74e4c886b..6d5d8b856abb0 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php @@ -15,7 +15,7 @@ class Selection extends \Magento\Backend\Block\Widget /** * @var string */ - protected $_template = 'product/edit/bundle/option/selection.phtml'; + protected $_template = 'Magento_Bundle::product/edit/bundle/option/selection.phtml'; /** * Catalog data diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php index 6a03124901235..fa33a64b0ec76 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php @@ -15,5 +15,5 @@ class Checkbox extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Op /** * @var string */ - protected $_template = 'catalog/product/view/type/bundle/option/checkbox.phtml'; + protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/checkbox.phtml'; } diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php index c686cce41f3fb..e180a6b64d307 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php @@ -15,5 +15,22 @@ class Multi extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio /** * @var string */ - protected $_template = 'catalog/product/view/type/bundle/option/multi.phtml'; + protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/multi.phtml'; + + /** + * @inheritdoc + * @since 100.2.0 + */ + protected function assignSelection(\Magento\Bundle\Model\Option $option, $selectionId) + { + if (is_array($selectionId)) { + foreach ($selectionId as $id) { + if ($id && $option->getSelectionById($id)) { + $this->_selectedOptions[] = $id; + } + } + } else { + parent::assignSelection($option, $selectionId); + } + } } diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php index 8962e680fd22b..6f3ffaa268b52 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php @@ -15,5 +15,5 @@ class Radio extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio /** * @var string */ - protected $_template = 'catalog/product/view/type/bundle/option/radio.phtml'; + protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/radio.phtml'; } diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php index 438b194a12649..a5d2dd91eb180 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php @@ -15,5 +15,5 @@ class Select extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Opti /** * @var string */ - protected $_template = 'catalog/product/view/type/bundle/option/select.phtml'; + protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/select.phtml'; } From b36a0abb19f13f48f46aa03a5d86d7d39174c384 Mon Sep 17 00:00:00 2001 From: vgelani Date: Mon, 16 Jul 2018 13:18:14 +0530 Subject: [PATCH 2/2] Reverted back extra changes --- .../Product/View/Type/Bundle/Option/Multi.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php index e180a6b64d307..f1c882789bd5d 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php @@ -16,21 +16,4 @@ class Multi extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio * @var string */ protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/multi.phtml'; - - /** - * @inheritdoc - * @since 100.2.0 - */ - protected function assignSelection(\Magento\Bundle\Model\Option $option, $selectionId) - { - if (is_array($selectionId)) { - foreach ($selectionId as $id) { - if ($id && $option->getSelectionById($id)) { - $this->_selectedOptions[] = $id; - } - } - } else { - parent::assignSelection($option, $selectionId); - } - } }