Questions tagged [requirejs-config.js]
Denotes questions regarding Magento 2 requirejs-config.js
118 questions
0
votes
0
answers
47
views
Magento 2 how to avoid loading of certain js files on checkout page via requirejs?
I want to load certain js files on all pages except checkout page.
How can I add a condition in requirejs-config.js file not to load js files when user is on checkout page?
In the code below, I want ...
0
votes
0
answers
160
views
Js files issue in production mode magento2.4.6-p3
Site is working fine in developer mode but when we put the site in production mode there are different files showing 404 in console and these seems default files of magento but the path of the file ...
2
votes
0
answers
72
views
How to integrate Google Pay library into website?
I'm trying to integrate Google Pay into my Cart page. But, I always get an error, it looks like this:
Uncaught Error: Script error for "https://pay.google.com/gp/p/js/pay.js" https://...
0
votes
1
answer
1k
views
Magento 2.4.5 customer-data.js not initiating in Custom theme js file
I have a function of ajax add to cart in below file and doing section reload.
below code is in app/design/frontend/MyThemeNS/Mytheme/web/js/custom.js (just mentioning sample for understanding.)
...
1
vote
1
answer
1k
views
Magento 2 - override JS from third party module from own module
I successfully overrode a JS file of a third party module from my own module named Amasty/AdvancedReviewOverrides.
First I copied the file from vendor/amasty/advanced-review/view/frontend/web/js/...
1
vote
0
answers
57
views
Disallow Comma Validation Rules
I am using this mixin for the custom validation rules in the below template for the first and last name
Template:
/vendor/magento/module-customer/view/frontend/templates/widget/name.phtml
require js :...
1
vote
1
answer
197
views
Magento 2: Use of map in RequireJs-config
Is anyone know the use of this 'custom' & when we need to use that?
var config = {
map: {
**'custom':** {
'@@@': '@@@',
'@@@': 'js/@@@'
...
1
vote
0
answers
40
views
Customize frontend and backend magento2 using js without using phtml file
Just to explain in simple words.
I want to use the js file in the frontend and backend of magento2 but without using the PHTML file.Just directly usage by getting field name, or id or something.
6
votes
3
answers
3k
views
Magento 2.4.3 - JS mixin file not loading on each page load
I tried to overwrite Magento_Catalog/js/catalog-add-to-cart.js only to extend the submitForm method as follows:
app/code/Vendor/Module/view/frontend/requirejs-config.js
/**
* Copyright © Onectus, Inc....
0
votes
1
answer
289
views
Magento 2 : Marketplace issue combine swatch-renderer js for 2.3 and 2.4
I have two different modules for 2.3 and 2.4 which is using mixin js, I want both these modules to be compatible in one to submit in the marketplace
map: {
'*': {
'mymodule/...
0
votes
2
answers
911
views
add js file to catalog page magento 2
I am using Magento 2.2.1. I want to add a js file to change one special span tag content with CSS class "price" on the catalog page. I was using document.getelementnByClass.. for my js ...
1
vote
1
answer
752
views
How to include YouTube iframe API in Magento 2 layout template?
I'm using Magento v2.4.1 and i want to show a youtube video on my storefront home page and control it using youtube iframe API in .phtml file, how can I correctly load this youtube iframe API in my ....
0
votes
1
answer
851
views
How to override js files in Child theme? Magento 2.4
I've been overriding a few files in our child theme which seems to work perfectly, however, I don't seem to be able to override JS files.
In this case, I'm trying to increase the yearRange in the ...
0
votes
4
answers
788
views
Magento 2 - How does require know where jquery is defined?
You can use jquery in phtml like this:
require([
'jquery'
],function($) {
$(document).ready(function() {
/* Your logic */
});
});
But how does the require know where to find ...
1
vote
1
answer
320
views
How to connect my custom js slick.min.js files with requirejs-config.js?
I need to make a slider for related-products. In order to override the template copied: app/design/frontend/{Vendor Theme}/{Theme name}/Magento_Catalog/templates/product/list/items.phtml.
there is a ...
0
votes
1
answer
694
views
Magento 2.4 admin keep on infinite loading
I updated my magento from 2.1 to 2.4 .
My admin panel keeps on loading since long.
Below is error i see in console.
Failed to load resource: the server responded with a status of 404 (Not Found)
...
0
votes
2
answers
354
views
Cannot load external module through require js
I'm trying to load highcharts in a custom admin form, but it comes out as undefined in my module.
My requirejs-config.js
var config = {
paths: {
'highcharts': 'http://code.highcharts.com/...
3
votes
1
answer
2k
views
Magento 2 - How to override frontend javascript file
I need to overwrite a javascript file from a custom module at:
vendor\amasty\module-single-step-checkout\view\frontend\web\js\model\one-step-layout.js
because I need to replace a code line in it to ...
0
votes
1
answer
2k
views
Magento 2 - override knockoutjs template located in base folder
I need to change the value of the maxinput field in the knockoutjs template vendor\magento\module-ui\view\base\web\templates\form\element\input.html so I have to replace the template with my own ...
1
vote
0
answers
188
views
How to create a mixin for js/modal/confirm.js
I want to create a mixin for js/modal/confirm.js but that widget returns some javascript to make it possible to create an instance of the widget instead of the widget itself.
So it returns this
// ...
0
votes
1
answer
69
views
Is it necessary to add requirejs-config.js when we need to add custom js in magento 2 theme
I have added a custom js file in my child theme and added the link in the default_head_blocks.xml. I am getting errors.
<link src="js/custom.js"/>
<!-- Add external resources --...
0
votes
2
answers
209
views
Requirejs not finding third party file
I'm trying to include Firebase in my website, so I decided to include the dependencies through requirejs. Thing is requirejs can't find my files for some reason.
What I first tried was to load the ...
0
votes
1
answer
493
views
How to add external js script in block via requireJs?
What is the simplest way to add external js script like:
https://sandbox-geowidget.easypack24.net/js/sdk-for-javascript.js
on my page? I've created block which i render on my product page. But i get ...
0
votes
1
answer
286
views
Where to locate requirejs-config.js on the home page of my Magento 2 site which uses a custom third party theme?
I wonder why Network tab in Browser Developers Tool Panel doesn't show requirejs-config.js at the top along with mixins.js, require.js. I am using a custom third party theme. When using Magento Luma ...
0
votes
0
answers
551
views
How to take Product attribute value and pass in JS?
I want to get attribute value which is date and wants to pass it into JS file, I have my JS files linked up properly, basically I am displaying timer in product detail page and I want to display timer ...