Questions tagged [javascript]

JavaScript (JS) is a client side script language which allows to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed. By default Magento 1 comes with the prototype.js library and Magento 2 comes with jQuery. Use 'prototype-js' and 'jquery' tags for questions about those libraries.

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

Failed To Load Component, Checkout Page (Console Error)

I upgraded Magento from 2.2.1 to 2.3.2, after that when i add any product to cart, on cart page i got these console errors: and when i proceed to Checkout i get more error like these, also i can't ...
0
votes
0answers
16 views

Calling MAGENTO API 1.9 using HTML and JAVASCRIPT (experts question - problem) HELP

I need someone who knows MAGENTO and everything related to APIs and REST APIS very well I have a website and I want to validate (check if you want) if the email for a certain customer exist or not ...
0
votes
0answers
15 views

Validate email using MAGENTO 1.9 (not way)

I've been trying several times to validate an email from my website against MAGENTO without success. I know it is possible to use MAGENTO REST API through JAVASCRIPT or maybe a PHP script but THIS IS ...
0
votes
0answers
13 views

keep extend Magento_Ui/js/form/element/wysiwyg but remove component dependency

I just want to extend almost content (not duplicate content to second file). And only remove component 'Magento_Variable/variables'. For reason i don't want to use variables in wysiwyg Is there a way ...
0
votes
1answer
51 views

Cannot validate email - MAGENTO api - how

I've been trying without success to validate the email from my website against the MAGENTO customers API and throw a message (exist or not exist) I mean, i have a website where customers are created; ...
1
vote
2answers
33 views

Magento 2.3.X Custom Module JavaScript won't load with require.js

I am building a module, and the HTML loads fine, but the JS isn't. Here is what I have: Vendor Name: NewShop Module Name: HelloWorld File: app/code/NewShop/HelloWorld/view/frontend/requirejs-config....
1
vote
1answer
22 views

Magento2 : How can i scroll up to first input error validation message on checkout

I saw some simillar questions, but they wanted to remove this feature. They suggested to comment some code in MAGENTO_ROOT/vendor/magento/magento2-base/lib/web/mage/validation.js file if (firstActive....
0
votes
0answers
13 views

JS Bundling causing loading spinner issues in IE11 checkout - Magento 2

Have tried to use Magento 2's JS bundling and am running into a strange error on IE 11 only. When proceeding to the checkout the loading spinner will not disappear. The page seems to load correctly in ...
0
votes
0answers
19 views

Searchbox Stays Open After Upgrade to 2.2.9

Extensions Amasty Advance Search Amasty Elastic Search Elasticsearch 5.1 Apache 2.4 PHP 7.1 The search box in my theme stays opened after I upgraded to Magento Community Edit 2.2.9 and has become ...
0
votes
0answers
8 views

Validation Zip/Code for only “Deutschland” in Magento 1.x

I have a select box like this <div class="input-box"> <select name="billing[country_id]" id="billing-country_id" class="validate-select" title="Land"> <option value=""> &...
0
votes
3answers
26 views

Is there any way to reflect the css,js changes without running static content deploy in Magento 2?

Is there any other method other than running deploy command to get new changes in the files in Magento 2?
0
votes
1answer
27 views

Magento 2.2.9 problem after installing not loading some JS files

After successfully installing Magento 2.2.9 (Windows 10, wamp server) I got the following picture. Does someone know how to solve this? I'm a beginner in Magento. I will be grateful for your answers....
1
vote
1answer
19 views

Magento 2 - remove stylesheet and javascript from the home page to improve page load speed

i'm trying to remove some unnecessarily css and javascript that is included in the homepage. For example, the swatches.mini.css, blog-m.min.css, blog-custom.min.css, calendar.min.css doesn't seem to ...
0
votes
0answers
14 views

Strange scroll behavior on mobile device

When I scroll up/down in a mobile browser (Firefox and Safari e.g.) on my iPhone, the scroll stops when the bottom browser menu collapses. I recorded a video to make it more clear. You can see the ...
0
votes
0answers
14 views

Magento 2.X Add external JS snippest not working on checkout page under payment method

I want to add custom JS snippest that display button from third party server. It's like embedded javascript code. I tried to add that source code below the discount code section on the checkout page. ...
0
votes
0answers
10 views

How to get the price of this JSON products to be exibihited on my html in a dropdown list?

I have this JSON table that I need to add on my HTML as a dropdown list and when the chosen product is selected, it shows its price and shows a button to simulate a shopping procedure (increase items ...
0
votes
0answers
11 views

M2 Modal Widget - How to stop video playing after close or click off modal

I have searched for the answer and tried to implement the solutions, and they were not working for me. Everything works fine except the video sound continues to play after closing or clicking off the ...
0
votes
1answer
12 views

Magento 2: How To Disable Button On Form Submit?

I'm trying to disable button after submitting form, but i'm facing some issue, when i submit black field it validate the form and disable the button... but i want to disable it on form submit ...
0
votes
1answer
31 views

Magento2 : Call custom Js before body closing tag on every page

I have used the below code to call example js file which is located in Magento_Theme folder of the theme. <referenceContainer name="before.body.end"> <block class="Magento\Framework\View\...
0
votes
1answer
37 views

Add Js code for Google measuing checkout in checkout

I want to measure checkout page using tag manager Enhanced Ecommerce. I refered https://developers.google.com/tag-manager/enhanced-ecommerce#checkout. How to add this script. Thanks.
1
vote
1answer
30 views

How to Validate Comma Seprated Values in Admin Configuration

I want to Add Validation of Comma Separated Values in Admin Configurations I Know How to Add Custom Validation Using Js is just need the Regex (Regular Expression)
0
votes
0answers
20 views

Magento 2 LocalHost, Admin Panel error js and disappeared Setup Wizard button

After several days of testing and testing, I ask for help. 3 Problems. The theme in local is no longer the one purchased (The default one appears) The Accordian does not work on the Admin panel The ...
0
votes
1answer
28 views

check content update javascript Magento 2

I have changed content to next page in category page in magento by https://infiniteajaxscroll.com/docs/methods.html I try to check content of list update by this function: $('.category-products ....
1
vote
2answers
43 views

how to override core JS file in module

I am trying to override Magento_Braintree/js/view/payment/method-renderer/cc-form But i am not getting any progress. I have tried map 'Magento_Braintree/js/view/payment/method-renderer/cc-form': '...
0
votes
0answers
10 views

Adding 360 image iframe to carousel in Magento 1.9 - need help to show

I am attempting to add a couple of new elements to a Magento 1.9 image carousel on the products page. Ideally I would like to add at the end of the foreach loop but whatever I do it just keeps ...
0
votes
0answers
19 views

how to change region message in checkout Please enter a 2-character value for the Region

I have located so many files with this message, however, when changing it, it does not update on the front-end (checkout). Region-updater.js any help would be greatly appreciated.
0
votes
0answers
15 views

Execute savePayment on shipping change

I need to execute savePayment on shipping method change. Now, my store execute savePayment just on change payment method but I need that it execute on change shipping method. Help.
0
votes
0answers
19 views

JS errors when creating a custom grid table in magento2

I use this link to create a custom grid table https://webkul.com/blog/create-grid-edit-add-grid-row-and-installer-in-magento2/ and after that it does not go further the console gives a Javascript ...
0
votes
1answer
34 views

Cannot read property 'click' of undefined In magento 2 phtml file

Script in filename.phtml <script> require(['jquery', 'jquery/ui'], function($){ // $('.swatch-option')[0].css('color','red'); $('.swatch-...
0
votes
0answers
34 views

TypeError: require.exec is not a function error in js file

I am loading options with below code : first_select.load(url,function(){ first_select.change(); first_select.closest("li").removeClass("loading"); }); Now i am getting this error : ...
1
vote
1answer
38 views

How to define Custom js in Custom module Magento 2

app/code/{vendor}/{module}/view/frontend/requirejs-config.js var config = { map: { '*': { 'Magento_Swatches/js/swatch-renderer' : 'Wac_SwatchName/js/swatch-renderer', ...
0
votes
0answers
19 views

Magento 2 How to exclude Head Miscellaneous Scripts section from deferred?

I am using a free extension for defer javascript Magento 2 Defer Parsing of JavaScript, which is working fine. But when I am adding Miscellaneous Scripts in magento admin from head section which is ...
0
votes
0answers
47 views

Adding custom JS to existing module causing errors

So I've been trying to add some custom javascript to a module, however when the JS has added it works fine in itself, but it causes a lot of errors for a lot of different scripts, and I can't figure ...
2
votes
0answers
48 views

Cannot read property '$' of undefined Error while using the instantsearch.js file of Algolia. Magento2

I'm trying to get all the data from Algolia so fro that I need to use instantsearch.js file of Algolia and also need to use algoliaBundle.min.js file but when I tried to copy this file then it gives ...
4
votes
1answer
64 views

Custom JS is not include undefined error magento 2

requirejs-config.js file path isCodility/Customers/view/frontend/requirejs-config.js` and code is var config = { paths: { 'customhighcharts': 'Codility_Dashboard/js/customhighcharts' }, ...
1
vote
2answers
34 views

How load only the required JS based on page?

I created a cms blank page and i found that it loads 179 js scripts, that slow down page loading. I assume that the problem is the theme i'm using. I want that pages loads only the stricly necessary ...
0
votes
0answers
34 views

Magento 1.9.3.8 - Uncaught TypeError: Cannot read property 'get' of undefined

I always get this JS error but I read something that can solve it by un-commenting a statement in a layout.xml, Is there somebody who can tell me about it more specifically? Unfortunately my store ...
0
votes
0answers
13 views

How can i change a plugin di.xml with javascript?

How can I override a custom plugin di.xml with javascript in Magento 2? If I click "x" button use di.xml else click "y" button use di2.xml? di.xml content <?xml version="1.0"?> <config ...
1
vote
0answers
21 views

How to get validator error or cannot add product to cart [closed]

I'm using Magento 1.9 (CE) and I cant add the product to cart due to validator error. There's no message, it just returns false. If I'll try to submit the form with product manually it'll add to cart. ...
0
votes
1answer
12 views

Extend/Override Javascript Included from Layout (head->link)

I want to extend: vendor/magento/module-catalog/view/adminhtml/web/js/edit-tree.js Which is loaded by layout: vendor/magento/module-catalog/view/adminhtml/layout/catalog_category_edit.xml:12 Why I ...
0
votes
0answers
35 views

How to get configurable product stock quantity inside swatches-product.js file

Need to add option data attribute for configurable products. Product.Config.prototype.loadOptions = function() { this.settings.each(function(element) { element.disabled = false; ...
0
votes
1answer
26 views

How to get rid of browser caching issue of javascript file in magento 2

After our magento 2 site is live whenever we are doing changes in JS file it doesn't reflect in customer browser as a result some of the pages breaks for those customer who doesn't flush his browser ...
1
vote
2answers
27 views

How to stop calling paypal objects file on home page?

We don’t want to make a call out to PayPal (https://www.paypalobjects.com/api/checkout.js) file when loading the homepage. We should only be making calls to PayPal on the cart page and checkout. ...
2
votes
1answer
31 views

admin area getting error 'require is not a function at editor.js:6' after upgrading magento 2 from 2.1.1 to 2.1.17

After upgrading Magento from version 2.1.1 to 2.1.17, I am facing this error Uncaught TypeError: require is not a function at editor.js:6 across admin area especially in edit pages when I look ...
1
vote
1answer
23 views

How to pass array value in url

Array :- foreach ($relatedProducts as $relatedProduct) { $_product = $objectManager->create('Magento\Catalog\Model\Product')->load($relatedProduct->getId()); $skus = $...
4
votes
0answers
75 views

Magento2: Local-Storage Mage-Storage and Mage-Cache Empty on every Reload

Many features in my web page break as when I investigated, I found out that many local storage keys don't even exist now which used to exist before. list of keys that don't exist: lo_session mage-...
5
votes
0answers
47 views

Magento2.3: Display Custom text on Shipping Address

I would like to add custom text whenever shipping country is Sweden, Ive created Magento_Checkout module in my custom theme and added a phtml file <div class="free-shipping-info" data-bind="...
0
votes
0answers
20 views

Magento 2: Failed to load resource: the server responded with a status of 404 (Not Found)

I am trying to override magento 2 core js ' require-config.js file at path Test/JsOverride/view/frontend/ var config = { "map": { "*": { "menu": "...
1
vote
1answer
29 views

Custom javascript is not loading through requirejs-config

I've been trying to add a custom script to my Magento stores, however I can't get it to load. I've created the js file in my web/js folder in my theme, and added it to the theme's requirejs file. It ...
0
votes
1answer
22 views

Why We Use RequireJS on Magento 2

Please tell me why we use requirejs and require-configjs files and purpose of these two files on magento 2.Complete Details if Possible.