File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Braintree/view/adminhtml/web/js
Sales/view/adminhtml/templates/order/create/billing/method Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ define([
145
145
_initBraintree : function ( ) {
146
146
var self = this ;
147
147
148
+ this . disableEventListeners ( ) ;
149
+
148
150
self . braintree . setup ( self . clientToken , 'custom' , {
149
151
id : self . selector ,
150
152
hostedFields : self . getHostedFields ( ) ,
@@ -154,6 +156,7 @@ define([
154
156
*/
155
157
onReady : function ( ) {
156
158
$ ( 'body' ) . trigger ( 'processStop' ) ;
159
+ self . enableEventListeners ( ) ;
157
160
} ,
158
161
159
162
/**
Original file line number Diff line number Diff line change 12
12
$ _methods = $ block ->getMethods ();
13
13
$ _methodsCount = count ($ _methods );
14
14
$ _counter = 0 ;
15
+ $ currentSelectedMethod = $ block ->getSelectedMethodCode ();
15
16
?>
16
17
<?php foreach ($ _methods as $ _method ) :
17
18
$ _code = $ _method ->getCode ();
39
40
</span>
40
41
<?php endif ;?>
41
42
42
- <label class="admin__field-label"
43
- for="p_method_ <?= $ block -> escapeHtml ( $ _code ); ?> "> <?= $ block ->escapeHtml ($ _method ->getTitle ()) ?>
43
+ <label class="admin__field-label" for="p_method_ <?= $ block -> escapeHtml ( $ _code ); ?> ">
44
+ <?= $ block ->escapeHtml ($ _method ->getTitle ()) ?>
44
45
</label>
45
46
</dt>
46
47
<dd class="admin__payment-method-wrapper">
55
56
'Magento_Sales/order/create/form'
56
57
], function(mage) {
57
58
mage.apply();
58
- order.setPaymentMethod('<?= $ block ->escapeHtml ($ block ->getSelectedMethodCode ()); ?> ');
59
+ <?php if ($ _methodsCount != 1 ) : ?>
60
+ order.setPaymentMethod('<?= $ block ->escapeHtml ($ currentSelectedMethod ); ?> ');
61
+ <?php else : ?>
62
+ payment.switchMethod('<?= $ block ->escapeHtml ($ currentSelectedMethod ); ?> ');
63
+ <?php endif ; ?>
59
64
});
60
65
</script>
61
66
<?php else : ?>
You can’t perform that action at this time.
0 commit comments