6
6
namespace Magento \SalesRule \Controller \Adminhtml \Promo \Quote ;
7
7
8
8
use Magento \Framework \App \Action \HttpPostActionInterface ;
9
+ use Magento \Rule \Model \Condition \AbstractCondition ;
9
10
use Magento \SalesRule \Controller \Adminhtml \Promo \Quote ;
11
+ use Magento \SalesRule \Model \Rule ;
10
12
11
13
/**
12
14
* New action html action
@@ -20,8 +22,10 @@ class NewActionHtml extends Quote implements HttpPostActionInterface
20
22
*/
21
23
public function execute ()
22
24
{
23
- $ id = $ this ->getRequest ()->getParam ('id ' );
24
- $ formName = $ this ->getRequest ()->getParam ('form_namespace ' );
25
+ $ id = $ this ->getRequest ()
26
+ ->getParam ('id ' );
27
+ $ formName = $ this ->getRequest ()
28
+ ->getParam ('form_namespace ' );
25
29
$ typeArr = explode ('| ' , str_replace ('- ' , '/ ' , $ this ->getRequest ()->getParam ('type ' )));
26
30
$ type = $ typeArr [0 ];
27
31
@@ -32,20 +36,22 @@ public function execute()
32
36
)->setType (
33
37
$ type
34
38
)->setRule (
35
- $ this ->_objectManager ->create (\ Magento \ SalesRule \ Model \ Rule::class)
39
+ $ this ->_objectManager ->create (Rule::class)
36
40
)->setPrefix (
37
41
'actions '
38
42
);
39
43
if (!empty ($ typeArr [1 ])) {
40
44
$ model ->setAttribute ($ typeArr [1 ]);
41
45
}
42
46
43
- if ($ model instanceof \ Magento \ Rule \ Model \ Condition \ AbstractCondition) {
47
+ if ($ model instanceof AbstractCondition) {
44
48
$ model ->setJsFormObject ($ formName );
49
+ $ model ->setFormName ($ formName );
45
50
$ html = $ model ->asHtmlRecursive ();
46
51
} else {
47
52
$ html = '' ;
48
53
}
49
- $ this ->getResponse ()->setBody ($ html );
54
+ $ this ->getResponse ()
55
+ ->setBody ($ html );
50
56
}
51
57
}
0 commit comments