cancel
Showing results for 
Search instead for 
Did you mean: 

Magento2 checkoutpage html getcode

Magento2 checkoutpage html getcode

What does this code mean in the Magento2 payment page? In particular, what does getCode mean

<div class="payment-method" data-bind="css: {'_active': (getCode() == isChecked())}">
    <div class="payment-method-title field choice">
        <input type="radio"
               name="payment[method]"
               class="radio"
               data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>
        <label data-bind="attr: {'for': getCode()}" class="label">
</div>
</div>

 

4 REPLIES 4

Re: Magento2 checkoutpage html getcode

@yousufkhan31c8 

You can get the payment method's code value using getCode()

This function can be found in JS file as mentioned below:

getCode: function () {
.............
},
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: Magento2 checkoutpage html getcode


@prepaidgiftbalance wrote:

What does this code mean in the Magento2 payment page? In particular, what does getCode mean

<div class="payment-method" data-bind="css: {'_active': (getCode() == isChecked())}">
    <div class="payment-method-title field choice">
        <input type="radio"
               name="payment[method]"
               class="radio"
               data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>
        <label data-bind="attr: {'for': getCode()}" class="label">
</div>
</div>

 


This function can be found in JS files.

Re: Magento2 checkoutpage html getcode

Re: Magento2 checkoutpage html getcode