We’re rewarding the question askers & reputations are being recalculated! Read more.

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.

630 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

check whether a product contains specific attribute in checkout tabs

I am new in Magento and i am trying to add a special validation in the checkout page of magento2. for that, I created one more tab in checkout page. I need to show that custom tab only when cart ...
0
votes
0answers
10 views

Magento 2 mixin error

I didn't use mixin in my custom theme or anything. But I get the below error. TypeError: mixin is not a function My require-config.js is below. var config = { paths: { 'owl.carousel': '...
0
votes
0answers
24 views

Getting console error how can i solve this?

Getting console error how can i solve this?? random errors coming Failed to load resource: net::ERR_CONNECTION_TIMED_OUT require.js:141 Uncaught Error: Script error for: Magento_Variable/js/...
0
votes
1answer
30 views

Uncaught TypeError: Cannot read property 'innerHTML' of null

We have tried to do a checkout on our website but its not working. When looking into the console, it says the below error Uncaught TypeError: Cannot read property 'innerHTML' of null and its ...
0
votes
0answers
28 views

How can I add critical JS on Magento 2.3.3?

Magento 2.3.3 has "Move JS code to the bottom of the page" function which moves all JS code to bottom of the page. I need some JS code(Seal Verification Code which showing verification icon) not ...
0
votes
0answers
22 views

Uncaught (in promise) ReferenceError: object is not defined on checkout page

JS object is not defined on the checkout page. Already included the script on the checkout page. Exactly the same thing is working on a simple Html page. but creating some issue on magento2.
0
votes
1answer
17 views

Magento2.3: Javascript is not loading in server but working in localhost

I'm facing a strange issue. I have main.js file in my theme (that is extended luma theme), there I have included javascript and jquery of megamenu, add to compare, etc. Now, the issue I'm facing is ...
0
votes
0answers
52 views

Magento 2.2 display swatch image on Product Page

Magento 2.2.2 I have in my view.phtml the following code /app/design/frontend/mytheme/shop/Magento_Catalog/templates/product view.phtml $img1 = $products->getResource()->getAttribute('...
0
votes
0answers
59 views

Disable Javascript Minify Only for Admin Magento 2

I am trying to Disable the JS Minify for admin part only, is it possible to achieve that ? This link How to disable Js merge for admin is for disabling merge/bundling js . But i want the disable the ...
0
votes
0answers
17 views

Magento 2.3.2 Enterprise Banner Slider Issue

I am experiencing that the default banner slider is not compatible with the mobile devices in Magento 2.3.2 enterprise version. Slider is working fine for the desktop. Can anyone help me to understand ...
0
votes
0answers
30 views

Magento 2 rewrite widget function with mixin return an error

I have to add few lines on js functions but mixin not working. app/design/frontend/Konect/base/Magento_ProductVideo/requirejs-config.js var config = { config: { mixins: { '...
0
votes
0answers
15 views

Magento2: gZip compress third party JS/CSS/Image files

I want to gZip compress third party JS/CSS/Images files. Example https://www.google-analytics.com/analytics.js Please help me in this.
0
votes
2answers
25 views

How to add custom JS file?

I have created a custom module for Megamenu. I have js file which needs to be added to this module. Some of my queries are: Can I add the js file directly on my module?. If yes, how to do it? Do I ...
0
votes
0answers
41 views

How Can I add Any jQuery Plugin in Magento 2.3.0

I am trying to add owl Carousel js file in app/design/frontend/My/theme/web/js/carousel.min.js but I am unable to add it to my site header.
0
votes
0answers
28 views

Show div based on drop down value

Somethings missing and I can't figure out what. I just need to show a div when the drop down Canada is selected. JS code is at the bottom of this. Any ideas? Thanks <div class="field" data-bind="...
0
votes
0answers
18 views

Add custom checkout funnel tracking to onepage checkout

I want to build a custom analytics module for yet another analytics service. The service tracks standard checkout funnel - user enters an address, user select shipping option, user click the pay and ...
0
votes
0answers
14 views

The owl carousel is initialized before the module instagram and does not see the items

I have a block that displays pictures from instagram, he gets them using the library. https://www.mageplaza.com/magento-2-instagram-feed I have 6 elements in a row, I want to use them in a carousel ...
0
votes
0answers
14 views

Magento 2.3.2 No Conversion tracking data

I have been having issues with Magento 2.3.2 conversion tracking in Google analytics. I have tried many different free extensions but still not having any luck. We are using magento native checkout ...
0
votes
0answers
19 views

How to resolve require is undefined issue (caught ReferenceError: require is not defined)

I am getting an issue on a single page (caught ReferenceError: require is not defined) on the below code. Please help me to resolve this issue. I am not sure where I am getting this issue I inspected ...
0
votes
0answers
13 views

Uncaught ReferenceError: ConfigurableMediaImages is not defined error Magento 1.9.4.2

I have been looking to incorporate infinite scrolling into my site. So, when I came across the InfiniteScroll Magento Plugin by Strategery-Inc I was excited to give it a go. However, I get the error: ...
0
votes
1answer
28 views

Magento 1 - Jquery datepicker error with merged JS

In magento 1 when merged javascript files is set to "yes" I encountered this error : When merged javascript files is set to "No" there was no problem with jquery datepicker. Do you have any idea ...
0
votes
1answer
47 views

Magento 2 with gatsby grapgql for product view page?

I am using gatsby js and successfully got the product list in index.js But I need to show the detail of product on click. So I used the below code in gatsby-node.js file. const path = require('path')...
0
votes
1answer
59 views

Magento 2 with Gatsby and GraphQl issue

I am trying to integrate the magento2.3.2 with gatsby js and Graphql. For reference please check this link https://www.gatsbyjs.org/packages/gatsby-source-magento2/ I have integrated everything but I ...
0
votes
0answers
19 views

How to restrict shipping method by regoin of selected in shiiping address section?

I have created a new shipping method module. I have to enable this method by the user-selected state. If the state of the selection is Gauteng I need this method to enabled or show. I have tried it ...
0
votes
0answers
61 views

Error while using croppie.js library in magento 2

Trying to use the croppie library on product detail page and sometime it works perfectly but most of the time it throws one of these errors. TypeError: priceBoxes.priceBox is not a function ...
0
votes
2answers
22 views

Magento 2 .focus() not working in template

I have this template: CODE PHTML: <div> Content // this line is OK </div> <script type="text/javascript"> require(['jquery'],function($){ $(window).load(function()...
0
votes
0answers
32 views

Error 500 some JS Files Magento 2

My theme (Claue of MGS) has been working very good. I updated my Magento version to 2.3.1, after that it started to generated some few errors that i've been solved. Now i have this problem: My chrome ...
0
votes
2answers
27 views

Include Cache in Magento2 module with using block

I have a block where I use as a slider in my home page, but it is not curling and I need it to do. The module I use is the Slider. Would there be a way for me to force caching the module?
0
votes
0answers
26 views

Products not loading on Load More in magento 2.3

The load more button is not working for loading products as shown here. https://prnt.sc/p45em5 When i click on load more it shows Loading. https://prnt.sc/p45f11 But then again it show load ...
0
votes
1answer
14 views

How to add classes input focused on checkout and product review forms?

If an input is in focus or has a value, I want to add a class to all inputs parent .field div. For example on the product page review form or on the checkout page shipping form. If the input is in ...
0
votes
0answers
29 views

Magento1.9 - Failed to find a valid digest in the 'integrity'(PCI compliance)

I have generated the SHA-256 and added in the integrity tag like below. <script type="text/javascript" integrity="sha256-65DEQpj8HBSb+/YImG+9LCeuQeRkm5NMpJWTH6hSuFZ+" src="example.com/media/js/...
0
votes
0answers
7 views

JS component returning object does not run object's function where key matches component name

According to Magento 2 documentation, when building a JavaScript component: If an object is returned, the initializer tries to find the key. If the corresponding value is a function, the ...
0
votes
0answers
13 views

Error during checkout when attempting to lookup registered user's email address

Running Magento v2.2.7 and experiencing a Javascript error during checkout where the user is presented with the option to log in as a registered customer. The customer populates their email address ...
0
votes
0answers
39 views

CDN add white space to main product image view magento 2.2.9

Any help will be great. When I use CDN in Magento for media, Magento adds white space to main product image. How can I resolve this issue? I am using custom theme Porto v318, varnish, nginx and ...
0
votes
0answers
48 views

Magento 2 - Format Price in Product detail page with locale currency symbol

I need to format my custom price on product detail page. I've already refer this KO Template and Using Javascript question but both have same solution of using quote.getPriceFormat() for formatting. ...
0
votes
1answer
25 views

Edit error message html : Magento 2

Where can I find HTML to add role="alert" to error messages in magento. For example, when a user provides a wrong zip code on checkout page this error message shows up. <div for="postcode" ...
0
votes
0answers
43 views

Magento 2 - Find Captcha For Defering

There is a way to find where are called this js ? https://www.gstatic.com/recaptcha/api2/v1565591531251/recaptcha__en.js (215.3KiB) https://www.gstatic.com/recaptcha/api2/v1565591531251/recaptcha__en....
0
votes
0answers
12 views

Bypass Checkout Step Navigator

I am implementing a 3rd party payment provider and for some reason, after verifying a payment in a mobile app, payment details (customer name, payment nonce etc) are being added as if they were GET ...
0
votes
0answers
11 views

Get Admin (Backend) URL with Key in Javascript

I'm creating a Magento 2 module where the user can scan a bardcode with a barcode scanner and it'll take them directly to the order shipment page at the following URL, e.g: /admin/admin/...
0
votes
1answer
55 views

Magento 2 : Script from Javascript is load but doesn't execute

Sorry I have kind of strange problem with Magento 2 I am not use to Magento I made a script which should be executed in the Ulimo template in the header of my website, on the network console the ...
0
votes
0answers
29 views

Magento 2: Simple case scenario, what to use? RequireJs , UI, JavaScript ? help from a backend developer

I have been doing a magento 2 course and it's more centered around backend development, but I would like to know what to apply for a simple case scenario. Case scenario : When I visit a specific url, ...
0
votes
0answers
18 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
17 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
17 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
0answers
25 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
9 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
1answer
44 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....
0
votes
0answers
15 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
16 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. ...