File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
app/code/Magento/ProductAlert Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 10
10
use Magento \Customer \Model \Session as CustomerSession ;
11
11
use Magento \Framework \App \RequestInterface ;
12
12
13
+ /**
14
+ * Abstract controller for notifying.
15
+ */
13
16
abstract class Add extends Action
14
17
{
15
18
/**
@@ -39,8 +42,8 @@ public function dispatch(RequestInterface $request)
39
42
{
40
43
if (!$ this ->customerSession ->authenticate ()) {
41
44
$ this ->_actionFlag ->set ('' , 'no-dispatch ' , true );
42
- if (!$ this ->customerSession ->getBeforeUrl ()) {
43
- $ this ->customerSession ->setBeforeUrl ($ this ->_redirect ->getRefererUrl ());
45
+ if (!$ this ->customerSession ->getBeforeAuthUrl ()) {
46
+ $ this ->customerSession ->setBeforeAuthUrl ($ this ->_redirect ->getRefererUrl ());
44
47
}
45
48
}
46
49
return parent ::dispatch ($ request );
Original file line number Diff line number Diff line change 8
8
9
9
namespace Magento \ProductAlert \Controller \Unsubscribe ;
10
10
11
+ use Magento \Customer \Model \Session as CustomerSession ;
11
12
use Magento \Framework \App \Action \Context ;
12
13
use Magento \Framework \App \Action \HttpGetActionInterface ;
13
- use Magento \Framework \App \Action \Action ;
14
14
use Magento \Framework \View \Result \Page ;
15
15
use Magento \Framework \View \Result \PageFactory ;
16
+ use Magento \ProductAlert \Controller \Unsubscribe as UnsubscribeController ;
16
17
17
18
/**
18
19
* Unsubscribing from 'Back in stock Alert'.
19
20
*
20
21
* Is used to transform a Get request that triggered in the email into the Post request endpoint
21
22
*/
22
- class Email extends Action implements HttpGetActionInterface
23
+ class Email extends UnsubscribeController implements HttpGetActionInterface
23
24
{
24
25
/**
25
26
* @var PageFactory
@@ -29,13 +30,15 @@ class Email extends Action implements HttpGetActionInterface
29
30
/**
30
31
* @param Context $context
31
32
* @param PageFactory $resultPageFactory
33
+ * @param CustomerSession $customerSession
32
34
*/
33
35
public function __construct (
34
36
Context $ context ,
35
- PageFactory $ resultPageFactory
37
+ PageFactory $ resultPageFactory ,
38
+ CustomerSession $ customerSession
36
39
) {
37
40
$ this ->resultPageFactory = $ resultPageFactory ;
38
- parent ::__construct ($ context );
41
+ parent ::__construct ($ context, $ customerSession );
39
42
}
40
43
41
44
/**
Original file line number Diff line number Diff line change 8
8
<page xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" layout =" 1column" xsi : noNamespaceSchemaLocation =" urn:magento:framework:View/Layout/etc/page_configuration.xsd" >
9
9
<body >
10
10
<referenceContainer name =" content" >
11
- <block class =" Magento\Framework\View\Element\Template" name =" unsubscription_form" template =" Magento_ProductAlert::email/email.phtml" />
11
+ <block class =" Magento\Framework\View\Element\Template" name =" unsubscription_form" cacheable = " false " template =" Magento_ProductAlert::email/email.phtml" />
12
12
</referenceContainer >
13
13
</body >
14
14
</page >
You can’t perform that action at this time.
0 commit comments