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
0answers
5 views

Implementation of the transition to the selected photo in fotorama thumb by link

How to add a checkbox to photos in the admin panel. if the checkbox is selected then on the product page, when click on the link, the gallery with photos will go to the selected photo. How to ...
0
votes
1answer
18 views

The undefined / null data comes in the shipping field

On the second step of the checkout, there is delivery data on the right, null data comes to the name of the type shipping. I also use the module Shipping Table Rates by Amasty 1.6.4 After turning on ...
0
votes
0answers
19 views

Magento 2 Import CSV File upload option dissapearing

Magento 2.2.2 I am trying to upload a csv file for an import. However when I select Entity Product the option for uploading the csv in admin dissapears. I have tried resetting permission for ...
0
votes
0answers
21 views

How to rewrite jquery code in jquery ui widget

How to remake this code in ui jquery widget? There is such jquery code. When you select an item using the checkbox, the item is cloned and added to another block. Tell me how to rewrite it in jquery ...
1
vote
0answers
14 views

Magento 2 : Cart keeps returning original quantity

I am trying to update the value of the qty in the shopping cart page with a Knockout on click, but it seems to revert the value to it's original state. This is the script for the button : <td ...
1
vote
0answers
34 views

Magento 2 : Firefox javascript update not working

I am trying to create buttons to either add or remove 1 item of a certain type from the shopping cart. In my search I found some code online that works great for Chrome but appears to not work on ...
0
votes
0answers
10 views

Scroll top to PhoneNumber field in one-page checkout when place order button is clicked in magento 2?

I am validating OTP for the phone number field in Magento 2 one-page checkout. (ref link). If the phone number is not verified I need to scroll top to the that field when the place order button is ...
0
votes
0answers
32 views

TypeError: settings.$elementF.fotorama is not a function in gallery.js in magento 2.2.2

I have installed the porto theme but I got error in chrome.its working good in firefox. require-config.js var config = { deps: ['jquery'], map:{ '*':{ 'fotorama/fotorama'...
0
votes
0answers
17 views

Magento place order redirects to shopping cart

Order registration in Magento 1.9.4.3 is not allowed. After press the Order Place button, Error 503 is shown on the Google Chrome Console, the user will be redirected to the shopping cart page. Of ...
0
votes
1answer
32 views

Magento 2 how to add external css and js library with RequireJS?

I'm struggling trying to add this js library AOS This is what I've tried to add both, css and js: in Theme/Magento_Theme/layout/cms_index_index.xml i have this code: <?xml version="1.0"?> &...
1
vote
0answers
13 views

Production Mode - CSS/JS missing when reloading with CTRL + Shift + R

Hello everyone, As the title suggests, I'm currently having some problems with a Magento 2 site, running in production mode, and it's static content / caching. The website loads just fine, but when I ...
0
votes
2answers
28 views

Magento2: Css loading issue on admin login page

On the Admin Login css/js is not loading, I don't have this problem anywhere else on my site. How can i solve this? I did bin/magento setup:static-content:deploy bin/magento, bin/magento ...
0
votes
0answers
11 views

Update Magento 2 jquery-ui.js version in Custom Theme

Is there a way to override Magento 2 lib\web\jquery\jquery-ui.js version in my Custom Theme? I want to upgrade it to version 1.12.1.
0
votes
2answers
43 views

Help in remaking the code on the widget

The challenge is that I have checkboxes on the page. This code finds all the checkboxes on the page and if the checkbox is selected, it adds it to a separate block. I want to limit the amount that can ...
1
vote
1answer
23 views

2.3.3: How would I stop the anchor/scroll on the product details tabs?

I would like to prevent the horrible snapping of the product details tabs and can't seem to figure out where it is coming from? I tried removing the link in the details.phtml and it still snaps so I'm ...
0
votes
1answer
36 views

Magento 2 how to add Materialize javascript in Magento 2?

I have tried to add materialize js to Magento 2 but it does not work. I have my materialize js in theme/web/js. then I have the requirejs-config.js in theme/ this is the code: var config = { //...
0
votes
0answers
25 views

Magento2: How to show Open street map on category page

I am trying to place the OSM map on the category page with the location marker. For this purpose, I have created a template module, but it is not loading a map on the page. On the page is just a gray ...
0
votes
0answers
19 views

Non - AMD Module - JSPDF - Magento 2

We are trying to implement JSPDF on our product pages. We have created a module to load the JS on these pages but we are coming up short. We are getting constructor errors or not defined errors ...
0
votes
0answers
14 views

submitAndReloadArea function location

I'm trying to add js code to the function that add an order comment protected function _prepareLayout() { $onclick = "submitAndReloadArea($('order_history_block').parentNode, '" . $this->...
0
votes
0answers
21 views

JS Problem in magento 2

I have a problem with magento 2 and I can not even mehcer in the administrative area of ​​the site .. so any editing would have to be by ssh or direct file editing PS: I'm very beginner
1
vote
1answer
27 views

Magento 2.3 : I want to add my third party js link in layout.xml file .?

Can anyone tell me how to add third party js link in magento2.3. I want to add this in my layout.xml file and use in template file. The resource from “http://127.0.0.1/magento2/pub/static/...
1
vote
0answers
17 views

eliminate render blocking resource in magento 1.9

how to eliminate render blocking resource, please give some solution. and in below URL https://example.com/media/css_secure/A.67235d48adca9db7ca959bc3a5076d7a.css.pagespeed.cf.Zdz540Fens.css what is ...
0
votes
0answers
14 views

Uncaught TypeError: Cannot read property 'innerHTML' of null at DisplayCart (?page=2:140) at ?page=2:133

Uncaught TypeError: Cannot read property 'innerHTML' of null at DisplayCart (?page=2:140) at ?page=2:133 Getting this error and code is here below. DisplayCart(cart); function DisplayCart(cart){ ...
0
votes
1answer
25 views

how to add custom js to end of footer on every page

I want to add a custom js file to all pages before the footer i want to pass script through phtml Is it possible to do this?
0
votes
2answers
29 views

Magento 2 How to show success message after product add to cart on home page?

How to show success message after product add to cart on home page like this "You added product-name to your shopping cart." I am using that code on template file - <form data-role="tocart-...
3
votes
1answer
47 views

Magento 2 Product detail page tab not working

I have facing one issue some time in a site that in product detail page description, more information tabs are not working and it will generate an error in console. Here is console log error jquery....
0
votes
0answers
17 views

Loading js in adminhtml after the page is totally rendered

I'm using custom module to work in Magento 2 admin catalog page to implement some js stuffs. My js is working but it loads before the dom loads in adminhtml. require(['jquery','domReady!'], function ...
1
vote
0answers
20 views

what is media/js folder in Magento 1.9

what is the media/js folder in Magento 1.9? In the w3c validator, it is showing error. How to resolve those errors that are showing in the w3c validator. Please help
0
votes
0answers
30 views

Javascript problem When changing production mode

I have this console error that occurs only when setting to production and nothing works as expected in storefront view. It works fine when the mode is set to the developer and no console errors are ...
1
vote
3answers
33 views

Where / how do versions work with pub static content?

I am debugging a JavaScript problem and I am confused as to how the static files and versions work... I see the following in a stacktrace and can open this in a new tab: https://example.com/static/...
1
vote
1answer
30 views

Implementation of sending selected items along with feedback form

Tell me how to implement the functionality of such a sample. On a separate page there is a form with any fields 2 or more and a submit button. I will use this example to implement. https://magento....
1
vote
1answer
39 views

Disable (product data items) tabs in Product page

I want to disable tabs in product pages, i mean not display product data items (description, more information,Ratings) as tabs. So I override web/css/source/sections.less And remove tabs and ...
0
votes
0answers
7 views

Loading custom js file at the end of set of customer data local storage Magento 2

I need customer information data from local storage in my custom js. But till I fetch the customer data from local storage, customer data in local storage hasn't set. define( ['jquery', '...
0
votes
0answers
23 views

After upgraded Magento 2.1.8 to 2.3.3 all JS code not working on frontend

Hello, Guys! How i can fix problem with JS code on frontend? bin/magento static content deploy s:s:d -f I see that require.js file no generated in directory pub/. Maybe someone means what is ...
1
vote
0answers
22 views

Magento 2 not working on Samsung Internet

Currently experiencing an issue with Magento 2 on the Samsung Internet browser. This occurs on most pages, though it's more prominent (and a bigger problem) on the checkout. The checkout takes ...
0
votes
0answers
10 views

Uncaught Error: Mismatched anonymous define() module: false

In my console I am getting error like this http://requirejs.org/docs/errors.html#mismatch at makeError (37029b3050833534d7f0340a91b8193d.min.js:16) at intakeDefines (...
1
vote
1answer
37 views

Magento 2.3.1 Category Page is not loading in Magento admin panel

My Magento version is 2.3.1. all pages in the admin panel working correctly. but my category page is not loading shows console error. I am already trying some solution like delete pub/static ...
1
vote
0answers
52 views

Executing Jasmine tests for frontend theme's

I can't get some of the Jasmine tests for the frontend (blank and luma themes) to work. I have generated the static files as described in the documentation. $ bin/magento setup:static-content:deploy ...
1
vote
0answers
34 views

Show all error messages in one place in one page checkout

I want to show validation messages in one place. for example. <div class="checkout-error-message"> * Please fill address field * Please fill email field * Please check agreement and term </...
1
vote
0answers
19 views

Fire JS script in observer

How can i fire this JS with an observer every time a user is adding, updating or deleting a product from the cart ? <script type="text/javascript"> _paq.push(['addEcommerceItem', "{{...
1
vote
0answers
11 views

How to list all JS outputed via module?

I want to have all the JS outputted as it's in the HTML, so if the bundle, minify and CDN are enabled or not I would like to get the URL listed via my module. How could I do that?
1
vote
1answer
39 views

How to remove tooltip from email field on checkout

Tell me how to remove tooltip from the checkout email field. I tried this way app/code/Dv/Tooltip/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\...
2
votes
1answer
117 views

Magento 2 after running upgrade command images, css & js deleted

Whenever I run upgrade command in Magento 2, some of my CSS and JS and Images files deleted automatically, sometimes deleted from third party modules, and sometimes deleted from magento vendor folder. ...
0
votes
0answers
20 views

Magento2: How to use checkbox in model popup in js?

I have created a model popup, that will appear when user click on add to cart. Now I want to add check box to accept user acceptance by click on checkbox. Can someone please help to to do this .
0
votes
0answers
33 views

Separation of bundle configurations and display of different content

Tell me how to solve the problem. I have a form in which data about bundle product configurations comes. The code that downloads this in the .phtml file is: <?php /** @var $block Magento\...
0
votes
2answers
51 views

get product id from item id in magento 2

I am trying to retrive product id from item id. i created first js function in sidebar.js: define([ 'jquery', 'Magento_Customer/js/model/authentication-popup', 'Magento_Customer/js/customer-data', '...
3
votes
0answers
32 views

How to create a swipe megamenu for mobile view?

I have created a custom module for Megamenu. In desktop view it looks good and working fine. In mobile view, I want to implement a functionality but I'm not sure how to do that. The functionality ...
2
votes
0answers
17 views

How to get the shipping rates via AJAX?

When I update the product qty in the cart page I want to have the shipping rates estimated again via AJAX, how could I call this JS method in order to do that?
1
vote
0answers
13 views

How to integrate ReactJS with Magento 2 frontend [closed]

For example I have to build a contact form in header. I want to create a module and then call that module in header
1
vote
0answers
46 views

Advanced JS Bundling - What to include/exclude

So, I've been doing an advanced js bundling for my website and I've read a lot of information about it. I've decided to use m2 dev tools to help me do it, however, I've some doubts with the result I ...