Questions tagged [requirejs]

Denotes questions related to require JS. RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments.

Filter by
Sorted by
Tagged with
0
votes
1answer
359 views

How to Load JS Code at the Top Using RequireJS

How can I load a custom JavaScript file using RequireJS at the very beginning? Please note: The key is that RequireJS must load my script FIRST, before any other scripts, as the rest of my script ...
1
vote
1answer
47 views

Adding JS to theme [duplicate]

I've seen a few similar posts on the Magento SE but none seem to work for me. I'm probably missing something but I for whatever reason my JS is not being included. I have a theme app/design/...
0
votes
0answers
65 views

Magento 2 EE : Override configure function(addbysku.js) of Magento_AdvancedCheckout module using mixins

In addbysku.js file, I want to override the configure function of Magento_AdvancedCheckout module using mixins in Magento Enterprise Edition. And my js code is, define([ /* eslint-disable strict */ ...
0
votes
1answer
740 views

Magento 2: Cannot read property 'dialog' of undefined, 'timepicker' of undefined,'RFC_2822' of undefined

Sometimes I'm getting following errors in the console after reloading the page:- Cannot read property 'dialog' of undefined Cannot read property 'timepicker' of undefined Cannot read property '...
0
votes
1answer
322 views

Can't add custom script (leaflet) to Contact page

I'm trying to add a map in Contact page. In order to do that,I did the following: In file: app/design/frontend/MyCompany/MyTheme/Magento_Contact/layout/contact_index_index.xml I added: <page ...
6
votes
2answers
1k views

Magento 2 : How to call text/x-magento-init on Ajax success

I am in need to trigger some script with "text/x-magento-init" on ajax call but I am unable to do so. trigger('contentUpdated') contentUpdated is also not working in my case. I am using ...
0
votes
1answer
52 views

Modified JS file not changing Magento 2 Backend paging grid

I'm currently attempting to change the "sizes.js" file using a child theme in adminhtml. This is with the "Commerce" version of Magento 2.2.5. As we have a large number of customers and orders. What ...
2
votes
1answer
360 views

Upgrade to 2.2.6 missing static JS files

When I upgraded my Magento 2.2.2 to 2.2.6. I got one critical error in pub/static missing one file named trim-input.js "pub/static/version1540806968/frontend/{...}/{...}/pl_PL/mage/trim-input.js" ...
0
votes
2answers
407 views

How to use third party jquery libraries in magento along with requirejs?

I am bit new to requirejs and currently learning AMD pattern in requirejs.I want to use custom third-party jquery libraries in magento. I have two questions: How to use jquery scripts that are ...
0
votes
1answer
953 views

Magento 2 - How to extend wysiwyg setup.js to add language settings?

i need to modify: setup: function (mode) { if (this.config['widget_plugin_src']) { tinyMCE.PluginManager.load('magentowidget', this.config['widget_plugin_src']); } ...
0
votes
1answer
442 views

Datatable js include issue in magento2

I am including datatable plugin to my custom module. I tried in this way, below is the code of my Vendor/Module/view/frontend/requirejs-config.js var config = { map: { '*': { ...
2
votes
2answers
2k views

Extend Swatch rendered js file

How to extend the Swatch rendered js file in my custom module? I have override the phtml template files. <script type="text/x-magento-init"> { "[data-role=swatch-option-<?= /* @...
0
votes
2answers
85 views

Magento 2.2.5 custom theme js errors

I created a custom child theme for luma and it works fine. But when I extend the layout for Magento_Theme I start getting all kinds of javascript errors which are random, sometimes they don't appear ...
1
vote
2answers
53 views

Magento2 : Facing proble with call custom jquery function in Backend

I have to call custom jquery function into Magento backend (sales > Order > View) I have created custom js in adminhtml/web/js/order_status_validation.js require(['jquery'], function(jQuery){ jQuery(...
0
votes
1answer
2k views

How to add Slick Slider in Magento 2?

I have done the following to add slick slider autoplay in magento 2.. In my custom module requirejs-config.js var config = { map: { '*': { slick: 'xxx_yyy/js/slick.min', ...
2
votes
1answer
55 views

Why does one script work but not the other in require.js?

I am trying to add a live chat script to my Magento 2 site. I had previously added slick.js to my Magento 2 site and the require-config.js file looked like this- var config = { paths: { slick: '...
2
votes
1answer
512 views

Magento 2 TypeError Undefined products images not displaying / js not loading

At home page, product category view and product detailed view page images are not loading / displaying at firefox and less frequently at chrome. I am using magento 2.2.6 upgraded from 2.2.2 and porto ...
0
votes
1answer
341 views

using javascript in .html form Magento2

i have a custom form.html that displays at checkout. i want to have a javascript tag - when the form load just show an alert testing purposes. code i used below, "<script type="text/javascript"&...
2
votes
0answers
178 views

New Checkout Billing Address Form Field not saving value to the database

I have added a new checkout billing address form field for entry of an optional field for the customer. Have overridden the template checkout form and able to get the field onto the form, but cannot ...
2
votes
0answers
22 views

Trigger code on every popup

I wrote a specific code but it should run only when a popup is on. Not only a specific popup but all the popups on the site. How can I achieve it?
1
vote
2answers
42 views

JavaScript and CSS don´t works in my Magento 2 page

I found a "partial" solution on the Internet, but if I use that "solution", my store don´t works: If I use that, this is the result: Home JS page Store Like you can see, if it makes me choose ...
0
votes
2answers
658 views

Magento 2.2 some JS files are not loading in production mode

In Magento 2.2.2 when setting website into production mode the following files are not loading, due to which my store switcher and other ui functions are not working in production mode: http://...
0
votes
0answers
434 views

Accordion not working Magento 2 after minify JS

I have minified JS and HTML and CSS in Magento 2. After that Accordion is not working. <?php $collectionTitle = $this->getCollectionFaqcat(); ?> <div class="shy-shadow-container row mrg0"...
0
votes
1answer
194 views

Product view error in admin panel Magento 2

Not able to view the product in the admin panel. getting below error in console. Unable to process binding "if: function(){return label }" Message: label is not defined I am not finding any fix for ...
1
vote
1answer
318 views

RequireJs and Custom JS file blur

this is my simple requirejs-config.js file var config = { deps: ['js/custom'] }; and this is my custom.js file define([ "jquery", "domReady!" ], function($) { "use ...
1
vote
1answer
884 views

Magento2 - Wait for checkout page completely loaded and fire JS code

The goal is to add a piece of JS to manipulate a datepicker on the checkout page. I use a OSC (OneStepCheckout from mageplaza). So far I've followed this documentation and added this mixin: var ...
4
votes
4answers
9k views

Magento 2 : Add custom js to a single CMS page

I am trying to add custom js to a single CMS page in Magento 2.2.5. Here is what I got: I have put the rellax.min.js file at :/app/design/frontend/TemplateMonster/md/web/js And I want to use that ...
3
votes
1answer
161 views

Magento2 What is the difference between uiCollection and uiComponent

Refer to the file - vendor\magento\module-ui\view\base\requirejs-config.js You will see code in map like - uiCollection: 'Magento_Ui/js/lib/core/collection', uiComponent: 'Magento_Ui/js/lib/...
0
votes
0answers
73 views

Site is not opening after setting production mode Magento2

I set mode as production, after that my website gone down, Is there any setting to be done? All css and js are showing 504 gateway error. What is the reason for it?
4
votes
1answer
1k views

How to add JS library to Magento 2?

I need to add the jsPDF library to my Magento 2 Luma theme, so I can use it on the checkout success page.
1
vote
0answers
1k views

Magento 2 load external script in my custom page

I want to add an external script to my store. I have added the script in my phtml file and it is working fine. But I want to follow the magento EQP validation. Here is my working code my layout xml &...
6
votes
2answers
959 views

QuickView not working after load product Using infinite scroll Magento 2

I am using Weltpixel Quick View extension and it is working fine.But there is an issue when products loads using infinite scroll.After loads products using infinite scroll , quick view stops working....
2
votes
1answer
420 views

Requirejs urlArgs paramater in the requirejs-config.js file redirects all the min.js file requests to full .js file urls

I have enabled the production mode in my Magento 2.2.4 version, disabled the static sign functionality and added the parameter: urlArgs:"version='test'" in requirejs-config.js file. I have enabled the ...
1
vote
0answers
28 views

how to rewrite magento2 backend menu js

I want to rewrite magento2 js The file path is "vendor/magento/theme-adminhtml-backend/web/js/theme.js", what should i do? Thanks for you helping
0
votes
1answer
624 views

Magento2 Require js not a function

When running grunt exec require.js not a function error appeared.
2
votes
0answers
47 views

Magento 2: Remove requirejs in checkout phase

I have a question over Magento 2 checkout phase. I don't want to talk about the decision of force developer to user requirejs knockoutjs and so on... Exist an extension which reproduce the checkout ...
2
votes
1answer
82 views

Zoomed image didn't close in Magento 2.2.3 and 2.2.4

I have just installed Magento 2.2.3 in my system. I have also added few categories and that of products. I can see a bigger image when I have clicked on it and it has been closed when I clicked on "X" ...
0
votes
2answers
625 views

How do I add a custom message on magento's checkout page(right below the Country selector) based on the country that user selects to ship the product?

For example: If a user wants to ship to India, I want to show a small message below the country selector and before the shipping method saying that "custom duties and taxes has to be paid by customer"....
3
votes
1answer
232 views

IScroll not defined when loading with RequireJS?

Hi we're using iScroll for a BannerSlider on a customer site and everything works fine on my local copy but we're seeing IScroll is not defined(…) when trying to call new IScroll xxx on our magento 2 ...
2
votes
2answers
2k views

Magento 2 Passing Php Variable to external js for custom theme

I have created a custom theme in app/design/frontend/Vendor/Themename In theme directory I have Themename/requirejs-config.js var config = { deps: [ "js/custom", ] }; Themename/web/js/...
1
vote
3answers
2k views

magento 2 How to override module-configurable-product configurable.js file

I want to override following js core file. public_html/vendor/magento/module-configurable-product/view/frontend I have tried in my custom theme as follow but it is not working public_html/app/...
1
vote
1answer
689 views

pub/static/_requirejs is not being created in magento 2 version 2.2.4

i am trying to include slick plugin into magento 2 through custom theme by requirejs but pub/static/_requirejs folder + files are not being generated on code deploy. file structure is following: /app/...
0
votes
1answer
273 views

JS doesn't load when change mode from development to production in Magento 2.1.9

Website working properly in developer mode when I am changing mode from development to production. JS doesn't load after change mode of production. Below Error: GET https://example.com/pub/static/...
3
votes
1answer
1k views

Pass variable from phtml to js

I am trying to pass variable to js but it is not working. My phtml code is like this- <script type="text/x-magento-init"> { ".open-modal-form": { "Vendor_Mod/js/modal-...
2
votes
1answer
4k views

Magento 2: Uncaught Error: Script error for: smartmenus

I am trying to implement the navigation menu with Bootstrap Smartmenus but the theme does not pick up the javaScript. Can somebody help me out? Vendor/Name/requirejs-config.js var config = { map: {...
1
vote
2answers
206 views

Add js to Widget

Hello looking for some help I have created some Widget , and need to add in it JavaScript for fetch instagram photos I have a library and a script, but this script doesnt work. I have added it in ...
3
votes
2answers
87 views

Require js didn't load my Js in custom module

I'm working on a custom module for GTM. The last part I facing issue is with require js. I want to trigger a custom JS on "add to cart" click. I made a requirejs-config.js file in Vendorname/...
1
vote
2answers
2k views

ReactJS with Magento 2 [closed]

I try to add ReactJS in my custom module but I don't have any idea to How to integrate ReactJS with Magento 2 frontend.
3
votes
0answers
185 views

use system config value to disable code from requirejs-config.js

I would like to create a configuration setting in my module's adminhtml/system.xml to disable it's features. I know how I can system config values to disable code in LayoutXML or PHP but is it ...
2
votes
2answers
301 views

how to i add a javascript file in magento 2 module and how to call it in phtml?

I try to add custom java-script file but giving error of different kind, please give me a proper example of adding JS in Magento 2 module and use it in phtml.

1 2 3
4
5
10