• Home
  • About Us
  • Contact Us
  • DMCA
  • Sitemap
  • Privacy Policy
Wednesday, March 22, 2023
Insta Citizen
No Result
View All Result
  • Home
  • Technology
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Artificial Intelligence
  • Home
  • Technology
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Artificial Intelligence
No Result
View All Result
Insta Citizen
No Result
View All Result
Home Software

Add a again button to the fee step in checkout

Insta Citizen by Insta Citizen
December 4, 2022
in Software
0
Add a again button to the fee step in checkout
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


So as to add again button on the fee step, it is advisable simply override two core file:

  • magento/module-checkout/view/frontend/net/js/view/fee.js
  • magento/module-checkout/view/frontend/net/template/fee.html

You’ll be able to override them both from theme or by creating customized module.

In fee.html file, add a again button :-

<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license particulars.
 */
-->
<li id="fee" position="presentation" class="checkout-payment-method" data-bind="fadeVisible: isVisible">
    <div id="checkout-step-payment"
         class="step-content"
         data-role="content material"
         position="tabpanel"
         aria-hidden="false">
        <!-- ko if: (quoteIsVirtual) -->
            <!-- ko foreach: getRegion('customer-email') -->
                <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        <!--/ko-->
        <type id="co-payment-form" class="type funds" novalidate="novalidate">
            <enter data-bind='attr: {worth: getFormKey()}' sort="hidden" identify="form_key"/>
            <fieldset class="fieldset">
                <legend class="legend">
                    <span data-bind="i18n: 'Fee Data'"></span>
                </legend><br />
                <!-- ko foreach: getRegion('place-order-captcha') -->
                    <!-- ko template: getTemplate() --><!-- /ko -->
                <!-- /ko -->
                <br />
                <!-- ko foreach: getRegion('beforeMethods') -->
                    <!-- ko template: getTemplate() --><!-- /ko -->
                <!-- /ko -->
                <div id="checkout-payment-method-load" class="opc-payment" data-bind="seen: isPaymentMethodsAvailable">
                    <!-- ko foreach: getRegion('payment-methods-list') -->
                        <!-- ko template: getTemplate() --><!-- /ko -->
                    <!-- /ko -->
                </div>
                <div class="no-quotes-block" data-bind="seen: isPaymentMethodsAvailable() == false">
                    <!-- ko i18n: 'No Fee methodology accessible.'--><!-- /ko -->
                </div>
                <!-- ko foreach: getRegion('afterMethods') -->
                    <!-- ko template: getTemplate() --><!-- /ko -->
                <!-- /ko -->
            </fieldset>
        </type>
        <div class="main">
            <button data-bind="click on: goToPrevStep()" class="again button motion main">
                <span translate="'Return'" />
            </button>
        </div>
    </div>
</li>

In fee.js file, it is advisable outline goToPrevStep() perform

/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license particulars.
 */

 outline([
    'jquery',
    'underscore',
    'uiComponent',
    'ko',
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/model/step-navigator',
    'Magento_Checkout/js/model/payment-service',
    'Magento_Checkout/js/model/payment/method-converter',
    'Magento_Checkout/js/action/get-payment-information',
    'Magento_Checkout/js/model/checkout-data-resolver',
    'mage/translate'
], perform (
    $,
    _,
    Part,
    ko,
    quote,
    stepNavigator,
    paymentService,
    methodConverter,
    getPaymentInformation,
    checkoutDataResolver,
    $t
) {
    'use strict';

    /** Set fee strategies to assortment */
    paymentService.setPaymentMethods(methodConverter(window.checkoutConfig.paymentMethods));

    return Part.lengthen({
        defaults: {
            template: 'Magento_Checkout/fee',
            activeMethod: ''
        },
        isVisible: ko.observable(quote.isVirtual()),
        quoteIsVirtual: quote.isVirtual(),
        isPaymentMethodsAvailable: ko.computed(perform () {
            return paymentService.getAvailablePaymentMethods().size > 0;
        }),

        /** @inheritdoc */
        initialize: perform () {
            this._super();
            checkoutDataResolver.resolvePaymentMethod();
            stepNavigator.registerStep(
                'fee',
                null,
                $t('Assessment & Funds'),
                this.isVisible,
                _.bind(this.navigate, this),
                this.sortOrder
            );

            return this;
        },

        /**
         * Navigate methodology.
         */
        navigate: perform () {
            var self = this;

            if (!self.hasShippingMethod()) {
                this.isVisible(false);
                stepNavigator.setHash('transport');
            } else {
                getPaymentInformation().achieved(perform () {
                    self.isVisible(true);
                });
            }
        },

        /**
         * @return {Boolean}
         */
        hasShippingMethod: perform () {
            return window.checkoutConfig.selectedShippingMethod !== null;
        },

        /**
         * @return {*}
         */
        getFormKey: perform () {
            return window.checkoutConfig.formKey;
        },

        goToPrevStep: perform () {
            return stepNavigator.navigateTo('transport');
        }
    });
});

And right here is the end result (Return button) in backside.

Screenshot-from-2022-12-03-18-03-55

Thanks..

author-thumb


Vikas Kumar
2 Badges

3 December 2022



Source_link

READ ALSO

Superior Pricing in Magento2 – Webkul Weblog

A robotic that makes and launches paper planes to check designs

Related Posts

Superior Pricing in Magento2 – Webkul Weblog
Software

Superior Pricing in Magento2 – Webkul Weblog

March 21, 2023
A robotic that makes and launches paper planes to check designs
Software

A robotic that makes and launches paper planes to check designs

March 21, 2023
Enhance Your Subsequent Undertaking with My Complete Record of Free APIs – 1000+ and Counting!
Software

Enhance Your Subsequent Undertaking with My Complete Record of Free APIs – 1000+ and Counting!

March 21, 2023
How college students are making an influence on psychological well being by means of expertise
Software

How college students are making an influence on psychological well being by means of expertise

March 20, 2023
UPSC Mains 2022 Normal Research Paper 2
Software

Distinction Between Administration by Goals (MBO) and Administration by Exception (MBE)

March 20, 2023
Zoho Sprints vs. Zenhub | Developer.com
Software

Zoho Sprints vs. Zenhub | Developer.com

March 20, 2023
Next Post
Elon Musk is making Twitter a much less pleasant place for journalists. However they’re nonetheless not quitting.

Elon Musk is making Twitter a much less pleasant place for journalists. However they’re nonetheless not quitting.

POPULAR NEWS

AMD Zen 4 Ryzen 7000 Specs, Launch Date, Benchmarks, Value Listings

October 1, 2022
Only5mins! – Europe’s hottest warmth pump markets – pv journal Worldwide

Only5mins! – Europe’s hottest warmth pump markets – pv journal Worldwide

February 10, 2023
XR-based metaverse platform for multi-user collaborations

XR-based metaverse platform for multi-user collaborations

October 21, 2022
Magento IOS App Builder – Webkul Weblog

Magento IOS App Builder – Webkul Weblog

September 29, 2022
Melted RTX 4090 16-pin Adapter: Unhealthy Luck or the First of Many?

Melted RTX 4090 16-pin Adapter: Unhealthy Luck or the First of Many?

October 24, 2022

EDITOR'S PICK

Second within the Solar: Folks Energy Photo voltaic Cooperative

Second within the Solar: Folks Energy Photo voltaic Cooperative

September 28, 2022
Do not Neglect To Analysis Your Reminiscence Bandwidth Earlier than Shopping for That Server

Do not Neglect To Analysis Your Reminiscence Bandwidth Earlier than Shopping for That Server

February 9, 2023
Photo voltaic’s Function In Saving Christmas Island Wildlife

Photo voltaic’s Function In Saving Christmas Island Wildlife

January 31, 2023
Actual-world challenges for AGI

Actual-world challenges for AGI

February 2, 2023

Insta Citizen

Welcome to Insta Citizen The goal of Insta Citizen is to give you the absolute best news sources for any topic! Our topics are carefully curated and constantly updated as we know the web moves fast so we try to as well.

Categories

  • Artificial Intelligence
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Technology

Recent Posts

  • LG made a 49-inch HDR monitor with a 240Hz refresh price
  • Petey for Apple Watch, previously watchGPT, now helps GPT-4
  • I See What You Hear: A Imaginative and prescient-inspired Technique to Localize Phrases
  • Giant-scale perovskite single crystals for laser and photodetector integration
  • Home
  • About Us
  • Contact Us
  • DMCA
  • Sitemap
  • Privacy Policy

Copyright © 2022 Instacitizen.com | All Rights Reserved.

No Result
View All Result
  • Home
  • Technology
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Artificial Intelligence

Copyright © 2022 Instacitizen.com | All Rights Reserved.

What Are Cookies
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT