Magento uses below way to show Requistition list using "x-magento-init".

<div class="block block-requisition-list social-button" data-bind="scope: 'requisition_ - 111'">
<!-- ko template: getTemplate() --><!-- /ko -->

<script type="text/x-magento-init">
    "*": {
        "Magento_Ui/js/core/app": {
            "components": {
                "requisition_ - 111": {
                    "component": "Magento_RequisitionList/js/requisition/action/product/view/add",
                    "editModuleName": "requisition_ - 111.edit",
                    "title": "Add to Requistition List",
                    "action": "http://URL.com/requisition_list/item/add/",
                    "sku": "TEST",
                    "productFormSelector": "#product_addtocart_form122"
                "requisition_ - 111.edit": {
                    "component": "Magento_RequisitionList/js/requisition/list/edit",
                    "modal": "add_to_requisition_popup",
                    "saveUrl": "http://URL.com/rest/V1/requisition_lists/"

Due to some limitations I can not use in this way, I searched that same can also be achieved using "data-mage-init" as well.

But not getting how can I rewrite same using "data-mage-init".

Any idea ?? ?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.