We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45bf612 commit 493e5b6Copy full SHA for 493e5b6
app/code/Magento/Catalog/Helper/Product/Compare.php
@@ -166,7 +166,15 @@ public function getListUrl()
166
*/
167
public function getPostDataParams($product)
168
{
169
- return $this->postHelper->getPostData($this->getAddUrl(), ['product' => $product->getId()]);
+ $params = ['product' => $product->getId()];
170
+ $requestingPageUrl = $this->_getRequest()->getParam('requesting_page_url');
171
+
172
+ if (!empty($requestingPageUrl)) {
173
+ $encodedUrl = $this->urlEncoder->encode($requestingPageUrl);
174
+ $params[\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED] = $encodedUrl;
175
+ }
176
177
+ return $this->postHelper->getPostData($this->getAddUrl(), $params);
178
}
179
180
/**
0 commit comments