Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
2

I did R & D on this task and prepared some implementation notes it might help you others if you would like to do, please follow the below steps on Advanced JS Bundling. A) Required Tools node.js >= 8.x npm >= 6.x Magento 2 DevTool Git B) DevTool Installation Clone the repository in your local machine Ex: git clone https://github.com/magento/m2-...


2

You can do this by adding a layout handles (say your_layout.xml) using event observer ( for event layout_load_before) and then on the your_layout.xml you can add JS and CSS file. Steps are given below. I assume you are using a module names "Company_MyModule". step 1) create file events.xml under YOUR-MAGENTO-ROOT/app/code/Company/MyModule/etc/frontend ...


2

You can use jQuery events like below method will work <script> require(['jquery', 'jquery/ui'],function($){ jQuery('#nbrbox').on('input', function(){ var nbrbox = document.getElementById('nbrbox').value; var qtybox = parseFloat(document.getElementById('qtybox').textContent); var qtysquare =(Math.round(nbrbox*...


1

document.getElementById("code_a_barre") is null That would suggest there isn't an element on the page which has id="code_a_barre" As you are using jQuery you could use $('#code_a_barre') But also remember that magento 2 uses require-js. So you need something like this: require(['jquery'], function($){ $(document).ready(function () { var ...


1

The best practice is to use mixins. I also note that requirejs-config.js is wrong. We don't need web folder in the path. Magento_Ui/web/js/modal/modal => Magento_Ui/js/modal/modal Using mixins: app/code/Vendor/Module/view/frontend/requirejs-config.js var config = { config: { mixins: { 'Magento_Ui/js/modal/modal': { ...


1

Replace your form code with below <field name="open_amount" formElement="checkbox"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="component" xsi:type="string">[Vendor]_[Module]/js/mycheckbox</item> <item name="source" xsi:...


1

For the toggle field, single-checkbox.js file is responsible for this. so you need to extend the single-checkbox.js file in your custom module. First, create a require-config.js file in below path. app/code/Namespace/Modulename/view/adminhtml/requirejs-config.js var config = { 'paths': { 'fabric': 'Magedelight_Productlabel/js/fabric' }, map: { ...


1

This problem appears when we set the backend setting for Use Custom Admin URL wrong. To get rid of this problem, follow the steps mentioned below: Login to the database and open the core_config_data table. Find and remove the row having the path like admin/url/custom. Now find the value where scope = stores scope_id = 0 path = web/secure/...


1

<script type="text/javascript"> require([ 'jquery', 'jquery/ui'], function($){ $(document).on("click","#acceptnow", function(e) { var currentRow=$(this).closest("tr"); var col1=currentRow.find(".quoteid").text().toString().trim(); var col2=currentRow.find("td:eq(3)").text().toString().trim(); var col3=...


Only top voted, non community-wiki answers of a minimum length are eligible