• Basisthema
  • Tweede menu item
    • Sub menu item
Inloggen
Home » Javascript inladen in Magento module

Javascript inladen in Magento module

Javascript inladen in Magento module

JAVASCRIPT Code

javascript
<script type="text/x-magento-init">
    {
        "*": {
            "oci_post": {}
        }
    }
</script>
JavaScript inline inladen in module.
https://gitlab.indenty.nl/magento/OciPunchout/-/commit/b1a965af837ea9586e6fccb42b12f366f08ae91f

====================

In je .phtml bestand:

Hetgeen in de JS Snippet

====================

Dan in je require-config.js

var config = {
    map: {
        '*': {
            'oci_post': 'Gladior_OciPunchout/js/post'
        }
    }
};

====================

En dan in je module:

define([] , function ($) {
    return function () {
        document.getElementById("oci-submitbutton").style.display="none";
        document.getElementById("oci-checkout").submit()
    };
});
Bekijk Snippet

Door Gladior

  • Facebook
  • Linkedin
  • Mail
  • Instagram

Contact

service@gladior.com

Overige informatie

Basisthema voor WordPress