File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Controller/Product/Compare Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 6
6
*/
7
7
namespace Magento \Catalog \Controller \Product \Compare ;
8
8
9
- use Magento \Framework \App \Action \HttpGetActionInterface as HttpGetActionInterface ;
10
9
use Magento \Catalog \Api \ProductRepositoryInterface ;
10
+ use Magento \Framework \App \Action \HttpGetActionInterface as HttpGetActionInterface ;
11
11
use Magento \Framework \Data \Form \FormKey \Validator ;
12
12
use Magento \Framework \View \Result \PageFactory ;
13
13
@@ -81,6 +81,8 @@ public function execute()
81
81
$ this ->_catalogSession ->setBeforeCompareUrl (
82
82
$ this ->urlDecoder ->decode ($ beforeUrl )
83
83
);
84
+ } else {
85
+ $ this ->_catalogSession ->unsBeforeCompareUrl ();
84
86
}
85
87
return $ this ->resultPageFactory ->create ();
86
88
}
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ public function getSectionData()
73
73
return [
74
74
'count ' => $ count ,
75
75
'countCaption ' => $ count == 1 ? __ ('1 item ' ) : __ ('%1 items ' , $ count ),
76
- 'listUrl ' => $ this ->helper ->getListUrl (),
76
+ 'listUrl ' => $ this ->helper ->getListUrl (false ),
77
77
'items ' => $ count ? $ this ->getItems () : [],
78
78
'websiteId ' => $ this ->storeManager ->getWebsite ()->getId ()
79
79
];
Original file line number Diff line number Diff line change @@ -142,12 +142,13 @@ public function __construct(
142
142
/**
143
143
* Retrieve compare list url
144
144
*
145
+ * @param bool $encodedUrl
145
146
* @return string
146
147
*/
147
- public function getListUrl ()
148
+ public function getListUrl ($ encodedUrl = true )
148
149
{
149
150
$ params = [
150
- \Magento \Framework \App \ActionInterface::PARAM_NAME_URL_ENCODED => $ this ->getEncodedUrl ()
151
+ \Magento \Framework \App \ActionInterface::PARAM_NAME_URL_ENCODED => $ encodedUrl ? $ this ->getEncodedUrl () : ''
151
152
];
152
153
return $ this ->_getUrl ('catalog/product_compare ' , $ params );
153
154
}
You can’t perform that action at this time.
0 commit comments