1

Hello Magento community this is my first question so go easy on me, I will try to be as accurate as possible but I am a noob front-end with Magento.

What I am trying to achieve is: when user buys virtual products only, which automatically skips second step of the checkout, display address list at the billing step if user has saved address.

So far I managed to achieved this: enter image description here

by adding:

<item name="beforeMethods" xsi:type="array">
<item name="children" xsi:type="array">
    <item name="billing-address-list" xsi:type="array">
        <item name="component" xsi:type="string">Custom_Checkout/js/view/billing-address/list</item>
    </item>
</item>

Inside checkout_index_index.xml

<item name="billing-step" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="children" xsi:type="array">
    <item name="payment" xsi:type="array">
        <item name="children" xsi:type="array">
            <item name="beforeMethods" xsi:type="array">
                <item name="children" xsi:type="array">
                    <item name="billing-address-list" xsi:type="array">
                        <item name="component" xsi:type="string">Custom_Checkout/js/view/billing-address/list</item>
                    </item>
                </item>
            </item>
            <item name="renders" xsi:type="array">
                <!-- merge payment method renders here -->
                <item name="children" xsi:type="array">
                    <item name="payzen-payments" xsi:type="array">
                        <item name="component" xsi:type="string">Lyranetwork_Payzen/js/view/payment/payzen-payments</item>
                    </item>
                </item>
            </item>
            <item name="afterMethods" xsi:type="array">
                <item name="children" xsi:type="array">
                    <item name="giftCardAccount" xsi:type="array">
                        <!-- Removes GiftCard Account section from Checkout/Payment step -->
                        <item name="config" xsi:type="array">
                            <item name="componentDisabled" xsi:type="boolean">true</item>
                        </item>
                    </item>
                    <item name="discount" xsi:type="array">
                        <!-- Removes Promo Code section from Checkout/Payment step -->
                        <item name="config" xsi:type="array">
                            <item name="componentDisabled" xsi:type="boolean">true</item>
                        </item>
                    </item>
                </item>
            </item>
            <item name="additional-payment-validators" xsi:type="array">
                <item name="children" xsi:type="array">
                    <item name="agreements-validator" xsi:type="array">
                        <item name="component" xsi:type="string">Illicado_Checkout/js/view/billing-address-validation</item>
                    </item>
                </item>
            </item>
        </item>
    </item>
</item>

billing-address/list.html

<div class="field addresses">
    <div class="control">
        <div class="billing-address-items">
        <!-- ko foreach: { data: elems, as: 'element' } -->
        <!-- ko template: element.getTemplate() --><!-- /ko -->
        <!-- /ko -->
        </div>
    </div>
</div>

I would like to make it work and also get rid of this weird second address list element which for some reason appears.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.