File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
Controller/Product/Compare Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -78,11 +78,14 @@ public function execute()
78
78
{
79
79
$ beforeUrl = $ this ->getRequest ()->getParam (self ::PARAM_NAME_URL_ENCODED );
80
80
if ($ beforeUrl ) {
81
- $ this ->_catalogSession ->setBeforeCompareUrl (
82
- $ this ->urlDecoder ->decode ($ beforeUrl )
83
- );
84
- } else {
85
- $ this ->_catalogSession ->unsBeforeCompareUrl ();
81
+ $ beforeUrl = $ this ->urlDecoder ->decode ($ beforeUrl );
82
+ if (strpos ((string )$ beforeUrl , "customer/section/load " ) == 0 ){
83
+ $ this ->_catalogSession ->setBeforeCompareUrl (
84
+ $ beforeUrl
85
+ );
86
+ } else {
87
+ $ this ->_catalogSession ->unsBeforeCompareUrl ();
88
+ }
86
89
}
87
90
return $ this ->resultPageFactory ->create ();
88
91
}
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 (false ),
76
+ 'listUrl ' => $ this ->helper ->getListUrl (),
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,13 +142,12 @@ public function __construct(
142
142
/**
143
143
* Retrieve compare list url
144
144
*
145
- * @param bool $encodedUrl
146
145
* @return string
147
146
*/
148
- public function getListUrl ($ encodedUrl = true )
147
+ public function getListUrl ()
149
148
{
150
149
$ params = [
151
- \Magento \Framework \App \ActionInterface::PARAM_NAME_URL_ENCODED => $ encodedUrl ? $ this ->getEncodedUrl () : ''
150
+ \Magento \Framework \App \ActionInterface::PARAM_NAME_URL_ENCODED => $ this ->getEncodedUrl ()
152
151
];
153
152
return $ this ->_getUrl ('catalog/product_compare ' , $ params );
154
153
}
You can’t perform that action at this time.
0 commit comments