0

I want to move newsletter subscription box after email filed in Magaplaza one step checkout module.

I have tried to move the block

                                               <item name="newsletter" xsi:type="array">
                                                            <item name="component" xsi:type="string">Mageplaza_Osc/js/view/review/addition/newsletter</item>
                                                            <item name="sortOrder" xsi:type="string">20</item>
                                                            <item name="config" xsi:type="array">
                                                                <item name="componentDisabled" xsi:type="helper" helper="Mageplaza\Osc\Helper\Config::isDisabledNewsletter" />
                                                            </item>
                                                        </item>

after block

<item name="shipping-step" xsi:type="array">

in onestepcheckout_index_index.xml but not got any success.Please give idea how to work with component.

Currently newsletter checkbox is coming before comment box.

please Below is code of shipping-step :

     <item name="shipping-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="shippingAddress" xsi:type="array">
                                                <item name="component" xsi:type="string">Mageplaza_Osc/js/view/shipping</item>
                                                <item name="children" xsi:type="array">
                                                    <item name="customer-email" xsi:type="array">
                                                        <item name="component" xsi:type="string">Mageplaza_Osc/js/view/form/element/email</item>
                                                    </item>
                                                    <item name="shippingAdditional" xsi:type="array">
                                                        <item name="component" xsi:type="string">uiComponent</item>
                                                        <item name="displayArea" xsi:type="string">shippingAdditional</item>                                                         
                                                    </item>
                                                    <item name="address-list" xsi:type="array">
                                                        <item name="config" xsi:type="array">
                                                            <item name="rendererTemplates" xsi:type="array">
                                                                <item name="customer-address" xsi:type="array">
                                                                    <item name="component" xsi:type="string">Mageplaza_Osc/js/view/shipping-address/address-renderer/default</item>
                                                                </item>
                                                                <item name="new-customer-address" xsi:type="array">
                                                                    <item name="component" xsi:type="string">Mageplaza_Osc/js/view/shipping-address/address-renderer/default</item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                    <item name="shipping-address-fieldset" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="region_id" xsi:type="array">
                                                                <item name="component" xsi:type="string">Mageplaza_Osc/js/view/form/element/region</item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                            <item name="billingAddress" xsi:type="array">
                                                <item name="component" xsi:type="string">Mageplaza_Osc/js/view/billing-address</item>
                                                <item name="config" xsi:type="array">
                                                    <item name="deps" xsi:type="array">
                                                        <item name="0" xsi:type="string">checkoutProvider</item>
                                                    </item>
                                                </item>
                                                <item name="provider" xsi:type="string">checkoutProvider</item>
                                                <item name="children" xsi:type="array">
                                                    <item name="customer-email" xsi:type="array">
                                                        <item name="component" xsi:type="string">Mageplaza_Osc/js/view/form/element/email</item>
                                                        <item name="displayArea" xsi:type="string">customer-email</item>
                                                        <item name="tooltip" xsi:type="array">
                                                            <item name="description" xsi:type="string" translate="true">We'll send your order confirmation here.</item>
                                                        </item>
                                                        <item name="children" xsi:type="array">
                                                            <item name="before-login-form" xsi:type="array">
                                                                <item name="component" xsi:type="string">uiComponent</item>
                                                                <item name="displayArea" xsi:type="string">before-login-form</item>
                                                                <item name="children" xsi:type="array">
                                                                    <!-- before login form fields -->
                                                                </item>
                                                            </item>
                                                            <item name="additional-login-form-fields" xsi:type="array">
                                                                <item name="component" xsi:type="string">uiComponent</item>
                                                                <item name="displayArea" xsi:type="string">additional-login-form-fields</item>
                                                                <item name="children" xsi:type="array">
                                                                    <!-- additional login form fields -->
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                    <item name="billing-address-fieldset" xsi:type="array">
                                                        <item name="component" xsi:type="string">uiComponent</item>
                                                        <item name="config" xsi:type="array">
                                                            <item name="deps" xsi:type="array">
                                                                <item name="0" xsi:type="string">checkoutProvider</item>
                                                            </item>
                                                        </item>
                                                        <item name="displayArea" xsi:type="string">additional-fieldsets</item>
                                                        <item name="children" xsi:type="array">
                                                            <!-- The following items override configuration of corresponding address attributes -->
                                                            <item name="region" xsi:type="array">
                                                                <!-- Make region attribute invisible on frontend. Corresponding input element is created by region_id field -->
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="region_id" xsi:type="array">
                                                                <item name="component" xsi:type="string">Mageplaza_Osc/js/view/form/element/region</item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="template" xsi:type="string">ui/form/field</item>
                                                                    <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
                                                                    <item name="customEntry" xsi:type="string">billingAddress.region</item>
                                                                </item>
                                                                <item name="validation" xsi:type="array">
                                                                    <item name="required-entry" xsi:type="boolean">true</item>
                                                                </item>
                                                                <!-- Value of region_id field is filtered by the value of county_id attribute -->
                                                                <item name="filterBy" xsi:type="array">
                                                                    <item name="target" xsi:type="string"><![CDATA[${ $.provider }:${ $.parentScope }.country_id]]></item>
                                                                    <item name="field" xsi:type="string">country_id</item>
                                                                </item>
                                                            </item>
                                                            <item name="postcode" xsi:type="array">
                                                                <!-- post-code field has custom UI component -->
                                                                <item name="component" xsi:type="string">Magento_Ui/js/form/element/post-code</item>
                                                                <item name="validation" xsi:type="array">
                                                                    <item name="required-entry" xsi:type="string">true</item>
                                                                </item>
                                                            </item>
                                                            <item name="company" xsi:type="array">
                                                                <item name="validation" xsi:type="array">
                                                                    <item name="min_text_length" xsi:type="number">0</item>
                                                                </item>
                                                            </item>
                                                            <item name="fax" xsi:type="array">
                                                                <item name="validation" xsi:type="array">
                                                                    <item name="min_text_length" xsi:type="number">0</item>
                                                                </item>
                                                            </item>
                                                            <item name="country_id" xsi:type="array">
                                                                <item name="sortOrder" xsi:type="string">115</item>
                                                            </item>
                                                            <item name="telephone" xsi:type="array">
                                                                <item name="config" xsi:type="array">
                                                                    <item name="tooltip" xsi:type="array">
                                                                        <item name="description" xsi:type="string" translate="true">For delivery questions.</item>
                                                                    </item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>

Newsletter checkbox code is:

                                           <item name="addition-information" xsi:type="array">
                                                <item name="component" xsi:type="string">Mageplaza_Osc/js/view/review/addition</item>
                                                <item name="sortOrder" xsi:type="string">20</item>
                                                <item name="children" xsi:type="array">
                                                    <!-- Add more component here -->
                                                    <item name="newsletter" xsi:type="array">
                                                        <item name="component" xsi:type="string">Mageplaza_Osc/js/view/review/addition/newsletter</item>
                                                        <item name="sortOrder" xsi:type="string">20</item>
                                                        <item name="config" xsi:type="array">
                                                            <item name="componentDisabled" xsi:type="helper" helper="Mageplaza\Osc\Helper\Config::isDisabledNewsletter" />
                                                        </item>
                                                    </item>
                                                    <item name="children" xsi:type="array">
                                                        <item name="additional_block" xsi:type="array">
                                                            <item name="component" xsi:type="string">Mageplaza_Osc/js/view/delivery-time</item>
                                                            <item name="componentDisabled" xsi:type="helper" helper="Mageplaza\Osc\Helper\Config::isDisabledDeliveryTime" />
                                                        </item>
                                                        <item name="place-order-comment" xsi:type="array">
                                                            <item name="component" xsi:type="string">Mageplaza_Osc/js/view/review/comment</item>
                                                            <item name="sortOrder" xsi:type="string">30</item>
                                                            <item name="config" xsi:type="array">
                                                                <item name="componentDisabled" xsi:type="helper" helper="Mageplaza\Osc\Helper\Config::isDisabledComment" />
                                                            </item>
                                                        </item>
                                                    </item>
                                                    <item name="gift_wrap" xsi:type="array">
                                                        <item name="component" xsi:type="string">Mageplaza_Osc/js/view/review/addition/gift-wrap</item>
                                                        <item name="sortOrder" xsi:type="string">40</item>
                                                        <item name="config" xsi:type="array">
                                                            <item name="componentDisabled" xsi:type="helper" helper="Mageplaza\Osc\Helper\Config::isDisabledGiftWrap" />
                                                        </item>
                                                    </item>
                                                    <item name="gift-message" xsi:type="array">
                                                        <item name="component" xsi:type="string">Mageplaza_Osc/js/view/review/addition/gift-message</item>
                                                        <item name="sortOrder" xsi:type="string">50</item>
                                                        <item name="config" xsi:type="array">
                                                            <item name="componentDisabled" xsi:type="helper" helper="Mageplaza\Osc\Helper\Config::isDisabledGiftMessage" />
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>

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.