Skip to main content
deleted 42 characters in body; edited title
Source Link

How to override Braintree payment option html for a module within my custom theme?

What is the correct way to customize Braintree payment options - add image for payments card icons? How to override module-braintree HTML within my custom theme? In other words, what is the correct file structure?

I tried to copy form.html from

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

and customize it and paste to:

app/design/frontend/MJ/theme/Magento_Braintree/web/template/

Also tried here:

app/design/frontend/MJ/theme/Magento_Braintree/templates/html/

but the native one shows instead (I used different classes names to disgusting files). So I assume I have the wrong structure.

My goal was to add payment method images like Visa and PayPal to appear under Credit Card options. I managed to do so by editing this file:

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

Adding this code:

    <span class="field type">
        <span class="control">
            <ul class="credit-card-types amir-credit-card-types">
                <!-- ko foreach: {data: getCcAvailableTypes(), as: 'item'} -->
                <li class="item  item._active _active"  >
                    <!--ko if: $parent.getIcons(item) -->
                    <img class="" data-bind="attr: {
                            'src': $parent.getIcons(item).url,
                            'width': $parent.getIcons(item).width,
                            'height': $parent.getIcons(item).height
                        }">
                    <!--/ko-->
                </li>
                <!--/ko-->
            </ul>
        </span>
    </span>

And my objective was achieved:

enter image description here

Now my question is, how to override module-braintree within my custom theme?

I was not sure how to structure folders or where to place form.htmlThis is what I tried:

enter image description here

How to override Braintree payment option html within my custom theme?

What is the correct way to customize Braintree payment options - add payments card icons? How to override module-braintree within my custom theme? In other words, what is the correct file structure?

I tried to copy form.html from

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

and customize it and paste to:

app/design/frontend/MJ/theme/Magento_Braintree/web/template/

Also tried here:

app/design/frontend/MJ/theme/Magento_Braintree/templates/html/

but the native one shows instead (I used different classes names to disgusting files). So I assume I have the wrong structure.

My goal was to add payment method images like Visa and PayPal to appear under Credit Card options. I managed to do so by editing this file:

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

Adding this code:

    <span class="field type">
        <span class="control">
            <ul class="credit-card-types amir-credit-card-types">
                <!-- ko foreach: {data: getCcAvailableTypes(), as: 'item'} -->
                <li class="item  item._active _active"  >
                    <!--ko if: $parent.getIcons(item) -->
                    <img class="" data-bind="attr: {
                            'src': $parent.getIcons(item).url,
                            'width': $parent.getIcons(item).width,
                            'height': $parent.getIcons(item).height
                        }">
                    <!--/ko-->
                </li>
                <!--/ko-->
            </ul>
        </span>
    </span>

And my objective was achieved:

enter image description here

Now my question is, how to override module-braintree within my custom theme?

I was not sure how to structure folders or where to place form.htmlThis is what I tried:

enter image description here

How to override html for a module within custom theme?

What is the correct way to customize Braintree payment options - add image for payments card ? How to override module-braintree HTML within my custom theme?

I tried to copy form.html from

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

and customize it and paste to:

app/design/frontend/MJ/theme/Magento_Braintree/web/template/

Also tried here:

app/design/frontend/MJ/theme/Magento_Braintree/templates/html/

but the native one shows instead (I used different classes names to disgusting files). So I assume I have the wrong structure.

My goal was to add payment method images like Visa and PayPal to appear under Credit Card options. I managed to do so by editing this file:

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

Adding this code:

    <span class="field type">
        <span class="control">
            <ul class="credit-card-types amir-credit-card-types">
                <!-- ko foreach: {data: getCcAvailableTypes(), as: 'item'} -->
                <li class="item  item._active _active"  >
                    <!--ko if: $parent.getIcons(item) -->
                    <img class="" data-bind="attr: {
                            'src': $parent.getIcons(item).url,
                            'width': $parent.getIcons(item).width,
                            'height': $parent.getIcons(item).height
                        }">
                    <!--/ko-->
                </li>
                <!--/ko-->
            </ul>
        </span>
    </span>

And my objective was achieved:

enter image description here

Now my question is, how to override module-braintree within my custom theme?

I was not sure how to structure folders or where to place form.htmlThis is what I tried:

enter image description here

added 90 characters in body; edited title
Source Link

Correct way How to customizeoverride Braintree payment options - add payments card iconsoption html within my custom theme?

What is the correct way to customize Braintree payment options - add payments card icons? How to override module-braintree within my custom theme? In other words, what is the correct file structure.?

I tried to copy form.html from

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

and customize it and paste to:

app/design/frontend/MJ/theme/Magento_Braintree/web/template/

Also tried here:

app/design/frontend/MJ/theme/Magento_Braintree/templates/html/

but the native one shows instead (I used different classes names to disgusting files). So I assume I have the wrong structure.

My goal was to add payment method images like Visa and PayPal to appear under Credit Card options. I managed to do so by editing this file:

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

Adding this code:

    <span class="field type">
        <span class="control">
            <ul class="credit-card-types amir-credit-card-types">
                <!-- ko foreach: {data: getCcAvailableTypes(), as: 'item'} -->
                <li class="item  item._active _active"  >
                    <!--ko if: $parent.getIcons(item) -->
                    <img class="" data-bind="attr: {
                            'src': $parent.getIcons(item).url,
                            'width': $parent.getIcons(item).width,
                            'height': $parent.getIcons(item).height
                        }">
                    <!--/ko-->
                </li>
                <!--/ko-->
            </ul>
        </span>
    </span>

And my objective was achieved:

enter image description here

Now my question is, how to override module-braintree within my custom theme?

I was not sure how to structure folders or where to place form.htmlThis is what I tried:

enter image description here

Correct way to customize Braintree payment options - add payments card icons

How to override module-braintree within my custom theme? In other words, what is the correct file structure.

I tried to copy form.html from

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

and customize it and paste to:

app/design/frontend/MJ/theme/Magento_Braintree/web/template/

Also tried here:

app/design/frontend/MJ/theme/Magento_Braintree/templates/html/

but the native one shows instead (I used different classes names to disgusting files). So I assume I have the wrong structure.

My goal was to add payment method images like Visa and PayPal to appear under Credit Card options. I managed to do so by editing this file:

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

Adding this code:

    <span class="field type">
        <span class="control">
            <ul class="credit-card-types amir-credit-card-types">
                <!-- ko foreach: {data: getCcAvailableTypes(), as: 'item'} -->
                <li class="item  item._active _active"  >
                    <!--ko if: $parent.getIcons(item) -->
                    <img class="" data-bind="attr: {
                            'src': $parent.getIcons(item).url,
                            'width': $parent.getIcons(item).width,
                            'height': $parent.getIcons(item).height
                        }">
                    <!--/ko-->
                </li>
                <!--/ko-->
            </ul>
        </span>
    </span>

And my objective was achieved:

enter image description here

Now my question is, how to override module-braintree within my custom theme?

I was not sure how to structure folders or where to place form.htmlThis is what I tried:

enter image description here

How to override Braintree payment option html within my custom theme?

What is the correct way to customize Braintree payment options - add payments card icons? How to override module-braintree within my custom theme? In other words, what is the correct file structure?

I tried to copy form.html from

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

and customize it and paste to:

app/design/frontend/MJ/theme/Magento_Braintree/web/template/

Also tried here:

app/design/frontend/MJ/theme/Magento_Braintree/templates/html/

but the native one shows instead (I used different classes names to disgusting files). So I assume I have the wrong structure.

My goal was to add payment method images like Visa and PayPal to appear under Credit Card options. I managed to do so by editing this file:

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

Adding this code:

    <span class="field type">
        <span class="control">
            <ul class="credit-card-types amir-credit-card-types">
                <!-- ko foreach: {data: getCcAvailableTypes(), as: 'item'} -->
                <li class="item  item._active _active"  >
                    <!--ko if: $parent.getIcons(item) -->
                    <img class="" data-bind="attr: {
                            'src': $parent.getIcons(item).url,
                            'width': $parent.getIcons(item).width,
                            'height': $parent.getIcons(item).height
                        }">
                    <!--/ko-->
                </li>
                <!--/ko-->
            </ul>
        </span>
    </span>

And my objective was achieved:

enter image description here

Now my question is, how to override module-braintree within my custom theme?

I was not sure how to structure folders or where to place form.htmlThis is what I tried:

enter image description here

added 494 characters in body
Source Link

How to override module-braintree within my custom theme? In other words, what is the correct file structure.

I tried to copy form.html from

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

and customize it and paste to:

app/design/frontend/MJ/theme/Magento_Braintree/web/template/

Also tried here:

app/design/frontend/MJ/theme/Magento_Braintree/templates/html/

but the native one shows instead (I used different classes names to disgusting files). So I assume I have the wrong structure.

My goal was to add payment method images like Visa and PayPal to appear under Credit Card options. I managed to do so by editing this file:

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

Adding this code:

    <span class="field type">
        <span class="control">
            <ul class="credit-card-types amir-credit-card-types">
                <!-- ko foreach: {data: getCcAvailableTypes(), as: 'item'} -->
                <li class="item  item._active _active"  >
                    <!--ko if: $parent.getIcons(item) -->
                    <img class="" data-bind="attr: {
                            'src': $parent.getIcons(item).url,
                            'width': $parent.getIcons(item).width,
                            'height': $parent.getIcons(item).height
                        }">
                    <!--/ko-->
                </li>
                <!--/ko-->
            </ul>
        </span>
    </span>

And my objective was achieved:

enter image description here

Now my question is, how to override module-braintree within my custom theme?

I was not sure how to structure folders or where to place form.htmlThis is what I tried:

enter image description here

How to override module-braintree within my custom theme?

My goal was to add payment method images like Visa and PayPal to appear under Credit Card options. I managed to do so by editing this file:

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

Adding this code:

    <span class="field type">
        <span class="control">
            <ul class="credit-card-types amir-credit-card-types">
                <!-- ko foreach: {data: getCcAvailableTypes(), as: 'item'} -->
                <li class="item  item._active _active"  >
                    <!--ko if: $parent.getIcons(item) -->
                    <img class="" data-bind="attr: {
                            'src': $parent.getIcons(item).url,
                            'width': $parent.getIcons(item).width,
                            'height': $parent.getIcons(item).height
                        }">
                    <!--/ko-->
                </li>
                <!--/ko-->
            </ul>
        </span>
    </span>

And my objective was achieved:

enter image description here

Now my question is, how to override module-braintree within my custom theme?

I was not sure how to structure folders or where to place form.htmlThis is what I tried:

enter image description here

How to override module-braintree within my custom theme? In other words, what is the correct file structure.

I tried to copy form.html from

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

and customize it and paste to:

app/design/frontend/MJ/theme/Magento_Braintree/web/template/

Also tried here:

app/design/frontend/MJ/theme/Magento_Braintree/templates/html/

but the native one shows instead (I used different classes names to disgusting files). So I assume I have the wrong structure.

My goal was to add payment method images like Visa and PayPal to appear under Credit Card options. I managed to do so by editing this file:

vendor/magento/module-braintree/view/frontend/web/template/payment/form.html

Adding this code:

    <span class="field type">
        <span class="control">
            <ul class="credit-card-types amir-credit-card-types">
                <!-- ko foreach: {data: getCcAvailableTypes(), as: 'item'} -->
                <li class="item  item._active _active"  >
                    <!--ko if: $parent.getIcons(item) -->
                    <img class="" data-bind="attr: {
                            'src': $parent.getIcons(item).url,
                            'width': $parent.getIcons(item).width,
                            'height': $parent.getIcons(item).height
                        }">
                    <!--/ko-->
                </li>
                <!--/ko-->
            </ul>
        </span>
    </span>

And my objective was achieved:

enter image description here

Now my question is, how to override module-braintree within my custom theme?

I was not sure how to structure folders or where to place form.htmlThis is what I tried:

enter image description here

Source Link
Loading