magento2 – Take recurring subscription payments via Guest checkout – Magento 2

We have a client who is keen to take recurring payments BUT only allows guest checkouts

They ideally wanted to use Braintree, but it seems the Braintree recurring payment extension only works with customers either logging in to or creating an account (which for conversion optimisation reasons, the client doesn’t want)

Does anyone know of any extensions that will allow recurring payments AND guest checkout in Magento 2? Ones that work with Braintree would be preferable, but at this point I’ll take any payment processor

Thanks

magento2 – How can I insert my custom checkout step form data when place order in quote table and in sales_order table in magento 2?

I create custom checkout step with my custom form in that I need to submit three extra field in quote table and sales order table.

So, how can I submit this form data in that table when order place.

enter image description here

I also create install script for new field in data table
how can insert that value when order place.

8 – How do I get the order_id and order_number on the checkout completed page?

I’m trying to get the order information inside the mymodule_preprocess_page hook.

On the normal page I can get it via the $cart. But the $cart is not available on the checkout page anymore. How do I get the order information specifically the order_id and order_number.

This is what I do on other pages:

  $order_type = 'physical';
  $cart_provider = Drupal::service('commerce_cart.cart_provider');
  $store = Drupal::service('commerce_store.current_store')->getStore();
  $cart = $cart_provider->getCart($order_type, $store);
  if ($cart) {
    foreach ($cart->getItems() as $order_item) {
      $orderId = $order_item->get('purchased_entity')(0)->get('target_id')->getValue();
  }

Magento2 Ajax change store currency and refresh total on Checkout page while change address

Try reloading cart section after change currency customerData.reload(('cart'), true);

Sample code:

define((
    ...
    'Magento_Customer/js/customer-data',
    'Magento_Checkout/js/model/cart/totals-processor/default',
    'Magento_Checkout/js/model/cart/cache'
    ...
), function (
    ...
    customerData,
    defaultTotal,
    cartCache
    ...
) {
    'use strict';

    afterChangeCurrency: function () {
        ...
        ...
        customerData.reload(('cart'), true);
        cartCache.set('totals',null);
        defaultTotal.estimateTotals();
    }

});

magento2 – Magento 2 how to use step navigator of checkout in a custom template?

I’m trying to use the checkout step navigator bar in another template.

I tried this but did not work, it just shows buttons:

in phtml.

<div id="steps" data-bind="scope:'steps'">
    <!-- ko template: getTemplate() --><!-- /ko -->
  </div>

<script type="text/x-magento-init">
    {
 
        "#steps": {
            "Magento_Ui/js/core/app": {
               "components": {
                    "steps": {
                        "component": "Vendor_Application/js/steps"
                    }
                }
            }
        }
    }
    </script>

Js component:

define((
    'ko',
    'uiComponent',
    'underscore',
    'Magento_Checkout/js/model/step-navigator'
), function (ko, Component, _, stepNavigator) {
    'use strict';

    return Component.extend({
        defaults: {
            template: 'Vendor_Application/mystep'
        },

        // add here your logic to display step,
        isVisible: ko.observable(true),

        /**
         * @returns {*}
         */
        initialize: function () {
            this._super();

            // register your step
            stepNavigator.registerStep(
                // step code will be used as step content id in the component template
                'step_1',
                // step alias
                null,
                // step title value
                'Step One',
                // observable property with logic when display step or hide step
                this.isVisible,

                _.bind(this.navigate, this),

                /**
                 * sort order value
                 * 'sort order value' < 10: step displays before shipping step;
                 * 10 < 'sort order value' < 20 : step displays between shipping and payment step
                 * 'sort order value' > 20 : step displays after payment step
                 */
                15
            );

            stepNavigator.registerStep(
                // step code will be used as step content id in the component template
                'step_2',
                // step alias
                null,
                // step title value
                'Step Two',
                // observable property with logic when display step or hide step
                this.isVisible,

                _.bind(this.navigate, this),

                /**
                 * sort order value
                 * 'sort order value' < 10: step displays before shipping step;
                 * 10 < 'sort order value' < 20 : step displays between shipping and payment step
                 * 'sort order value' > 20 : step displays after payment step
                 */
                20
            );

            return this;
        },

        /**
         * The navigate() method is responsible for navigation between checkout steps
         * during checkout. You can add custom logic, for example some conditions
         * for switching to your custom step
         * When the user navigates to the custom step via url anchor or back button we_must show step manually here
         */
        navigate: function () {
            this.isVisible(true);
        },

        /**
         * @returns void
         */
        navigateToNextStep: function () {
            stepNavigator.next();
        }
    });
});

HTML Template

<li id="step_1" data-bind="fadeVisible: isVisible">
    <div class="step-title" data-bind="i18n: 'Step One'" data-role="title"></div>
    <div id="checkout-step-title"
         class="step-content"
         data-role="content">

        <form data-bind="submit: navigateToNextStep" novalidate="novalidate">
            <div class="actions-toolbar">
                <div class="primary">
                    <button data-role="opc-continue" type="submit" class="button action continue primary">
                        <span><!-- ko i18n: 'Next'--><!-- /ko --></span>
                    </button>
                </div>
            </div>
        </form>
    </div>
</li>

<li id="step_2" data-bind="fadeVisible: isVisible">
    <div class="step-title" data-bind="i18n: 'Step Two'" data-role="title"></div>
    <div id="checkout-step-title"
         class="step-content"
         data-role="content">

        <form data-bind="submit: navigateToNextStep" novalidate="novalidate">
            <div class="actions-toolbar">
                <div class="primary">
                    <button data-role="opc-continue" type="submit" class="button action continue primary">
                        <span><!-- ko i18n: 'Next'--><!-- /ko --></span>
                    </button>
                </div>
            </div>
        </form>
    </div>
</li>

Any ideas? or where can I find the template of the step navigator, maybe I can just copy it and assign as template to my js component.
Thanks!