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.

734 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
734 views

Extend or override blanks theme js

I have a custom theme which inherits from blank and I would like to override navigation-menu.js options how would I do that?
1
vote
1answer
296 views

IE Error “Please choose to register or to checkout as guest”

As the title says I'm only getting this error in IE. Anyway to fix this? I removed the instance from the .js and the popup disappears but does not allow checkout. Below is the code //Clear ...
1
vote
0answers
142 views

Make order list refresh in each 5 minute in magento admin

Is this possible in magento admin to make order list refresh if system is idle for 5 minute ??? my client want to make order list refresh in each 5 minute because he don't want to make page refresh ...
1
vote
0answers
476 views

How to implement or extend product gallery widget

In template of module product-video. Widget productGallery called by data-mage-init attribute with template option pass through <div id="<?php /* @escapeNotVerified */ echo $block->getHtmlId(...
1
vote
1answer
449 views

Magento 2 Replace a default JS

here i am replacing configurable.js with my own module. but its not working, and the default one is loading. do i need to initialize it as well ? here is the code path : app/code/ABC/Module/view/...
1
vote
0answers
747 views

How to fix the “payment transaction failure” issue in onepage?

After I installed the following patches: SUPEE-6285-1.9.1v2, SUPEE-6482-1.9.1.1, SUPEE-6788-1.9.1.1, SUPEE-7405-1.9.1.1, my website's onepage checkout payment is not working. Entered debit Card/...
1
vote
2answers
423 views

magento2 new custom theme no CSS or JS

After creating a new theme in app\design\frontend\ appears in my back end under design. When I change it to my custom theme, CSS or JS is NOT loading. I tried running the following command: php ...
1
vote
1answer
241 views

Magento API calling using HTML and javascript

I'm new to Magento and I'm developing a PhoneGap app using HTML5, CSS and Javascript. I searched many places and read Magento documentations, but couldn't get any example for authenticating, calling, ...
1
vote
1answer
550 views

Load Google Maps External Javascript Before Skin Javascript

I'm trying to add the Google Maps Javascript API to my Magento module. The problem I'm having is that the core/text block that I am including, that contains the external Javascript inclusion tag, ...
1
vote
1answer
439 views

JavaScript HTML5 Canvas Snow in 3D in magento

I'm trying to have a snow effect on my magento site. I got a code from seb.ly which i tried on a normal html5 website and it worked, but i added it on my magento page it didn't work. I added it to ...
1
vote
0answers
186 views

Random js error on checkout

I've noticed a strange random JS error on onepagecheckout. Randomly I read this error in console and executions of submit order stops > POST /onestepcheckout/index/savePost/ 503 (OK) send @ >...
1
vote
1answer
44 views

Problems with my admin interface

First of I would like to apologize if there is some rule of this forum I am not following. This is my first post but I am getting desperate, so, here I am. I already posted this on: https://community....
1
vote
0answers
81 views

Top Category links disabling click

Currently my template is using Mega Menu. /RWD/ If 'casting supplies' is clicked on an iPad it will go to the category page and not just drop down the menu. How do I change it so that when 'Casting ...
1
vote
0answers
228 views

Changing color on frontend sets price to zero

I have a configurable product with a few simple products assigned to it. On the frontend I see the price of the product correctly. In the dropdown box with different colors (underlying simple products)...
1
vote
1answer
445 views

Zoom in/out feature on magento banner

I have a magento theme installed which comes with a banner. But I'm trying to add more functionality to the banner to make it catchy for customers. I want the banners to zoom in or out when any image ...
1
vote
0answers
203 views

Magento WidgetInstance is not defined / Unexpected Identifier

Magento is throwing the following error in console when we load the CMS->Widget page there is also an error which I think is related, but what I haven't been able to solve. Uncaught SyntaxError: ...
1
vote
0answers
2k views

Adding an Email Confirmation to the Registration page

So I've been trying to add "Confirm Email" field to my registration page. I'm using these two pages as references: http://magentopaper.blogspot.com/2011/09/how-to-add-confirmation-email-field-in.html ...
1
vote
1answer
123 views

Mobile Device Popup in Magento

I have Android and IOs apps for my website and for promotion of my apps I added banners in website but I want some thing different. When someone visits my website a pop-up appears and ask them to ...
1
vote
1answer
418 views

Getting error on custom add to cart Magento

I am trying to submit custom add to cart on product page with configurable product options but i am getting error with that.My code looks like this : <script> jQuery("#submit").click(function (...
1
vote
1answer
582 views

Add active class to checkout progress

I am trying to add an active class to the opc progress block. I tried modifying the gotoSection function both in opcheckout.js and opcheckout_rwd.js but can't figure out how to change it to update the ...
1
vote
0answers
89 views

Using the built-in price update javascript for custom entity options

Since none of the Magento built-in product types suit my needs, I am using custom entities to represent product options on the product page. These are not custom options, attributes, configurable ...
1
vote
2answers
2k views

Adding custom js and css to Product grid in Magento 2

Can we add custom JavaScript and CSS to the Product grid. I've created a product_listing.xml within my own module, and it's working, but can we add custom JS and CSS to product_listing.xml like we do ...
0
votes
1answer
9 views

PWA for Magento2 - best option now?

We would like to develop a PWA storefront with Nuxt.js. Vue Storefront for Magento 2 doesn't utilize Nuxt.js and it will be many months (or longer) before Vue Storefront Next (the version built with ...
0
votes
1answer
12 views

How to use reactjs with magento 2?

I want to use reactjs in my magento 2 module for designing or developing PWA. edit:- how to integrate jqery with magento 2
0
votes
0answers
7 views

categories link opens with mouseover whereas in mobile menu its works onClick i want a onClick drop down on desktop view as well in side menu

(function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define([ 'jquery' ], factory); } else { factory(window.jQuery); } }(function ($) { '...
0
votes
0answers
10 views

Magento 2.3.4: How to address "Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline

Google's web.dev is penalizing the site by displaying this error. Can anyone please suggest what can be done to eliminate these render-blocking resources?
0
votes
1answer
19 views

How to add custom inline javascript to Magento head?

I want to add this javascript to the head of all Product Pages in Magento 2. Problem is, I'm not sure where to begin with that. I know, there's built in Google Analytics settings in Magento 2, however,...
0
votes
1answer
19 views

JS VarienForm in Magento 2

Is there a way to update this code to work with Magento2? I believe VarienForm has been depreciated in Magento2 but I can't find a similar JS constructor to get the object. var AddToCartForm = new ...
0
votes
0answers
8 views

How to rewrite Js widget which doesn't have return $.mage.widgetName

I'm trying to rewrite JS widget using mixin but getting error Uncaught TypeError: base is not a constructor. If at the end of this widget add return $.mage.widgetName, everything works fine. Can I fix ...
0
votes
0answers
22 views

Magento 2 checkout loader is stuck

I've seen this question a couple of times, but i wasn't able to solve my problem. My checkout page loads fine but the "loader" gif doesn't go away and I can't interact. Usually refreshing ...
0
votes
1answer
18 views

Javascript error productSidebar.js Magento 2.3.3

i'm using Magento 2.3.3, and in my catalog's console i found this error in pub/static/ there's no a folder named "version.." but if you skip that folder you can find directly "frontend/AtelierVM/.../...
0
votes
0answers
12 views

Magento 2 Add js code only for checkout step 2

I want to add a piece of javascript code only for checkout step 2 (payment page). What I have tried so far? Loaded stepNavigator and checked if this returns true. stepNavigator.isProcessed('payment'...
0
votes
0answers
11 views

Magento 2.3.4: How to remove unnecessary script?

I tried to bundle the script using some known commands, but still having to much scripts. Help me too boost my site. some of google
0
votes
0answers
11 views

(Magento 2.3.5-p1) “A technical problem with the server created an error” when editing a category description that has links or HTML comments inside

I created a category description with a style element and some ordinary block-level elements like div and ul, and that worked out fine; then I tried to turn some of the text into links, and whether ...
0
votes
1answer
23 views

How to add a required checkbox to checkout page (policy check)

I know that there is basic functionality, but it does not suit me. How to display my template under the form with the link to the privacy-policy page? Or tell me how to do it right. I need a ...
0
votes
1answer
14 views

How to add a green border if validation is completed when submitting the form

Magento 2 has basic validation if the field is not valid. How to add custom validation to the checkout page which will add a green border and an inscription that notifies the user of a successful ...
0
votes
2answers
23 views

How to Pass Parameters in JS Magento2

I have created one module where I want to pass Parameters using JS. So I have followed as per below. app/code/namespace/modulename/view/frontend/templates/index.phtml <div class="example-...
0
votes
0answers
35 views

How to remake js code on jquery ui widget

I have a simple code that animates the appearance of a mini-cart modal window. <script type="text/javascript"> require(['jquery'], function($){ $(document).ready(function(){ ...
0
votes
0answers
6 views

How to create admin form and action for edit and delete in magento 2

I am developing one module for post data to be displayed on front-end and all posts can be add,edit,delete by admin. I want to use UI Component for that, so can anyone can have idea about how to ...
0
votes
0answers
14 views

Magento2 language switcher redirect to 404 or random product page

I have a problem with Magento 2. Language switcher only on mobile in production redirect on the random page or in 404
0
votes
0answers
8 views

how to use library js in child module for current module magento 2

question 1:how to use library js in child module for current module Magento 2? question 2: how to check? if(child module not exist) { use library js in current module } else { use library js ...
0
votes
0answers
14 views

Magento 2.3.4. This JavaScript error “Uncaught TypeError: Cannot set property 'status' of undefined” appears only on the configurable products

This error originates from the line data[l].status = 1,. Could you please someone point out what is wrong with this line? t(n).on("load", function() { **data[l].status = 1,** ...
0
votes
0answers
3 views

simple products dynamics price display base on tier pricing and quantity

Is there any reference that I can follow, so that my magento can update the price base on customer input quantity VS tier pricing. qty 1 = 10 each qty 3 = 8 each qty 10 = 5 each let say I have above ...
0
votes
0answers
6 views

Determine what Javascript is being run to implement a specific feature

I am looking to replicate a specific interactive frontend feature which is running on Magento 1, in Mageneto 2. I have no access to the Magento 1 admin to determine what extension is being used. I ...
0
votes
0answers
28 views

Magento 2.3.4 theme use different logo file for mobile and larger screens

I need to use 2 different logo files, one for mobile and one for desktop view. I have one single custom theme (parent is luma) and I am wondering how to achieve this by using jquery and/or CSS. Is ...
0
votes
0answers
10 views

How to calculate the amount based on the number of elements on the checkout in the sidebar using knockout

In the block Your Order sidebar there is a block with the elements that are in the basket It has 2 fields price and quantity How to add one additional to these two fields, which is responsible for ...
0
votes
2answers
30 views

how to overwrite a JS file in magento?

I want to replace this JS. \vendor\magento\module-catalog\view\base\web\js\price-options.js I did try override by \app\design\frontend\(vendor)\(theme)\Magento_Catalog\view\base\web\js\price-...
0
votes
2answers
22 views

Magento2.3.2 js and css not getting applied on frontend

I have a site in magento 2.3.2. My code is getting fetched from var/view_processed instead of directly from app/code and app/design. See https://prnt.sc/slkvss The css and css also not getting ...
0
votes
0answers
18 views

Magento 2 - How to use Ajax Auto completer?

I'm working on migration from Magento 1.9.* to Magento 2.3.* , in one of my phtml code I have this javascript Ajax.Autocompleter function, as I know this function is not available in Magento 2.3, how ...
0
votes
0answers
16 views

Cannot read property 'version' of undefined error while hard refreshing the page in magento 2

Whenever I am hard-refreshing the page, it displaying the below js error. jquery-ui.js:37 Uncaught TypeError: Cannot read property 'version' of undefined at jquery-ui.js:37 at mixins.js:87 at Array....

1
5 6
7
8 9
15