File tree 8 files changed +42
-9
lines changed
Controller/Product/Compare
Ui/view/base/web/js/form/element
UrlRewrite/Block/Catalog/Product
dev/tests/integration/testsuite/Magento/Catalog/Controller/Product
lib/internal/Magento/Framework/Data
8 files changed +42
-9
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,14 @@ public function execute()
36
36
$ productName = $ this ->_objectManager ->get (
37
37
\Magento \Framework \Escaper::class
38
38
)->escapeHtml ($ product ->getName ());
39
- $ this ->messageManager ->addSuccess (__ ('You added product %1 to the comparison list. ' , $ productName ));
39
+ $ this ->messageManager ->addComplexSuccessMessage (
40
+ 'addCompareSuccessMessage ' ,
41
+ [
42
+ 'product_name ' => $ productName ,
43
+ 'compare_list_url ' => $ this ->_url ->getUrl ('catalog/product_compare ' )
44
+ ]
45
+ );
46
+
40
47
$ this ->_eventManager ->dispatch ('catalog_product_compare_add_product ' , ['product ' => $ product ]);
41
48
}
42
49
Original file line number Diff line number Diff line change 79
79
<argument name =" typeId" xsi : type =" string" >recently_compared_product</argument >
80
80
</arguments >
81
81
</virtualType >
82
+ <type name =" Magento\Framework\View\Element\Message\MessageConfigurationsPool" >
83
+ <arguments >
84
+ <argument name =" configurationsMap" xsi : type =" array" >
85
+ <item name =" addCompareSuccessMessage" xsi : type =" array" >
86
+ <item name =" renderer" xsi : type =" const" >\Magento\Framework\View\Element\Message\Renderer\BlockRenderer::CODE</item >
87
+ <item name =" data" xsi : type =" array" >
88
+ <item name =" template" xsi : type =" string" >Magento_Catalog::messages/addCompareSuccessMessage.phtml</item >
89
+ </item >
90
+ </item >
91
+ </argument >
92
+ </arguments >
93
+ </type >
82
94
<type name =" Magento\Framework\App\ResourceConnection" >
83
95
<plugin name =" get_catalog_category_product_index_table_name" type =" Magento\Catalog\Model\Indexer\Category\Product\Plugin\TableResolver" />
84
96
</type >
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ // @codingStandardsIgnoreFile
7
+ /** @var \Magento\Framework\View\Element\Template $block */
8
+ ?>
9
+ <?= $ block ->escapeHtml (__ (
10
+ 'You added product %1 to the <a href="%2">comparison list</a>. ' ,
11
+ $ block ->getData ('product_name ' ),
12
+ $ block ->getData ('compare_list_url ' )),
13
+ ['a ' ]
14
+ );
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ define([
129
129
} ,
130
130
131
131
/**
132
- * Prepare storages congfig .
132
+ * Prepare storages config .
133
133
*
134
134
* @returns {Object } Chainable.
135
135
*/
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ define([
133
133
134
134
/**
135
135
* Retrieves from the list file which matches
136
- * search criteria implemented in itertor function.
136
+ * search criteria implemented in iterator function.
137
137
*
138
138
* @param {Function } fn - Function that will be invoked
139
139
* for each file in the list.
@@ -193,7 +193,7 @@ define([
193
193
} ,
194
194
195
195
/**
196
- * Returns path to the files' preview image.
196
+ * Returns path to the file's preview image.
197
197
*
198
198
* @param {Object } file
199
199
* @returns {String }
@@ -310,7 +310,7 @@ define([
310
310
311
311
/**
312
312
* Abstract handler which is invoked when files are choosed for upload.
313
- * May be used for implementation of aditional validation rules,
313
+ * May be used for implementation of additional validation rules,
314
314
* e.g. total files and a total size rules.
315
315
*
316
316
* @abstract
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ protected function _prepareLayoutFeatures()
55
55
}
56
56
57
57
if ($ this ->_getProduct ()->getId ()) {
58
- $ this ->_addProductLinkBlock ($ this -> _getProduct () );
58
+ $ this ->_addProductLinkBlock ();
59
59
}
60
60
61
61
if ($ this ->_getCategory ()->getId ()) {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public function testAddAction()
49
49
);
50
50
51
51
$ this ->assertSessionMessages (
52
- $ this ->equalTo (['You added product Simple Product 1 Name to the comparison list. ' ]),
52
+ $ this ->equalTo (['You added product Simple Product 1 Name to the <a href="http://localhost/index.php/catalog/product_compare/"> comparison list</a> . ' ]),
53
53
MessageInterface::TYPE_SUCCESS
54
54
);
55
55
Original file line number Diff line number Diff line change @@ -188,8 +188,8 @@ public function toArray($arrRequiredFields = [])
188
188
}
189
189
190
190
/**
191
- * @param null $valueField
192
- * @param null $labelField
191
+ * @param string| null $valueField
192
+ * @param string| null $labelField
193
193
* @param array $additional
194
194
* @return array
195
195
*/
You can’t perform that action at this time.
0 commit comments