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.

647 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
21 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
54 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
9 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
43 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
58 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
27 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
49 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
14 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
12 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
60 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
18 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
30 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
12 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
48 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
17 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
17 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
44 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.
0
votes
0answers
23 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
0answers
21 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
20 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
55 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
0answers
128 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 : ...
0
votes
1answer
60 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
59 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 ...
0
votes
0answers
172 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 ...
0
votes
1answer
15 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
41 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
32 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 ...
0
votes
0answers
31 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": "...
0
votes
0answers
27 views

Why is guest customer billing information NULL - Magento 2 checkout and quote?

I'm trying to get guest customer billing information during the checkout session as I need to save it to the quote before redirecting to placeOrder but the billing information is always null. How do ...
0
votes
1answer
43 views

How to fix blank Minicart popup in custom navbar for Magento 2

I am creating a custom theme from the parent theme Luma. I've added this code to Magento_Theme/layout/default.xml to include the minicart. <block class="Magento\Checkout\Block\Cart\Sidebar" name="...
0
votes
2answers
123 views

menu.js:1 Uncaught TypeError: require is not a function

I am trying to add a jquery script to my site. I have updated the require-config so it has this- var config = { paths: { slick: 'js/slick.min', slaask: 'js/customscript', menu: 'js/menu....
0
votes
0answers
32 views

Social login popup on custom url

We have installed Mageplaza social login popup(https://github.com/mageplaza/magento-2-social-login). The extension opens the popup when clicked on "Signup/Login" button on the home page. We need a ...
0
votes
0answers
59 views

Magento 2.3.1 not allowing javascript code

I am setting up my store on latest Magento 2.3.1 CE edition. Apache version: Apache/2.4.39 PHP version: 7.2.18 MySQL version: 10.1.40-MariaDB. Also I am using Porto theme. There is a strange ...
0
votes
0answers
27 views

How to send a javascript variable to a PHP file in Magento project?

I have this file that contains a javascript variable: src/app/design/adminhtml/default/default/template/smv/order/sales/creditmemo/refund.phtml <p> <select name="creditmemo[reason]"> ...
0
votes
2answers
133 views

Magento2.3.0 :When merge and minify js and css after set production mode not working my admin panel and frontend css lacking

I am using Magento2.3.0 community version When merge and minify js and css after set production mode not working my admin panel and front end css lacking if any one know what is actual issue reply me ...
0
votes
0answers
68 views

Magento 2.3: How To Initialize Js…?

I'm new to Magento 2.3, I was trying to apply jQuery DataTable and it's done, after that, I want to add it's Button Extention, for that i need to add two more js,so i initialize it, now i'm getting ...
0
votes
0answers
25 views

Error displaying the product name in magento 1.x

I'm having an error displaying the product name. if it is "dog" English then it will appear in the frontend. If it is Vietnamese "dog" it will not display. I am doing it in js file. Other products ...
0
votes
1answer
116 views

Magento 2 | VueJs Framework

Is there a way to use VueJs Framework under Magento 2 ?
0
votes
0answers
16 views

Magento2 How do I see the raw files, I'm just on the admin

I'm very new to this, I'm doing this for a client. I see there is a content section where I can edit the blocks. I suppose I can edit the custom js to add a javascript file to call my API. I'm try to ...
0
votes
0answers
27 views

Magento 2 Assign customer group name to externally calling JavaScript file variable

PreRequisites: MageVersion - Magento 2.3.x External JavaScript - http://domain.com/external-js.js var mage_customer_group = ''; //other code related to the customer group Pages - Category page and ...
0
votes
0answers
49 views

Magento2 add js custom conversion tracking on thank you page on first time load

I'm editing a client's site and I need to add custom javascript for our purchase tracking, on a success or thank you page. Oh shopify we put it on the checkout input box custom script input window ...