Questions tagged [jquery]

Denotes questions related to the use of jQuery library in Magento.

240 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
3answers
359 views

How to add on scroll animation in magento 2 using AOS (Animation On Scroll) Jquery?

I have tried to add on scroll animation in my Magento 2 cms page. I used AOS Jquery for that. I have added the js and CSS file and initialize AOS through cms page but It will shows Uncaught ...
5
votes
0answers
472 views

How to apply custom validation in Magento 2 checkout Shipping Address form?

I want to apply some custom validation on shipping address form of Magento 2 Checkout. Normally i do it with JQuery but don't know how to apply it in Magento 2. The validation i want to implement are ...
4
votes
2answers
89 views

Menu that open by itself after clicking on the link of a parent category

When I click on parent category, the page load but the menu re-open if the pointer of the mouse is still present. What do you recommend so that the menu does not re-open immediately ? I found PHP of ...
4
votes
0answers
56 views

How to create a basic progress bar with ajax, when il click add to cart in Magento 2?

I try to make a basic progress bar with ajax , when I click button add to cart, but I don't know how catch the xhr on console,to put on alert() or prepend()function I follow a video example in ...
4
votes
0answers
102 views

Knockout.js in magento2

How to change the jquery into ko? define([ 'jquery' ], function ($) { "use strict"; $.widget('xxx.homePage', { options: { bindSubmit: true, ...
4
votes
1answer
1k views

Magento 2.2.1 Checkout page broken and Js fail to load error

I have installed Magento 2.2.1 and set up my custom theme but checkout page looks broken and consoles showing errors: Not sure how to resolve this issue. Need help how can this be resolved. How ...
4
votes
1answer
171 views

Magento 2.1 : Calendar Frontend

I have some data on front-end , which I want to show on specific days in the calendar. I got this code to show the calendar on the front end . <?php $a = 'some text'; $b = 'some ...
3
votes
0answers
80 views

Is it safe to disable JQMIGRATE?

Seems like it is complaining about using a deprecated pseudo-event. Also, If I remember correctly console.trace is used for debugging and should not be shown/needed on live site. The JQMIGATE code ...
3
votes
1answer
183 views

JQMIGRATE: jQuery.fn.andSelf() replaced by jQuery.fn.addBack()

JQMIGRATE: jQuery.fn.andSelf() replaced by jQuery.fn.addBack() error when first time lode the website after refreshing all ok every thing are working its in magento 2.2.6 please not provide solution ...
3
votes
0answers
330 views

Uncaught TypeError: $.initNamespaceStorage is not a function magento2

Some functionality is not working properly and it shows some errors in console Any help will be appreciated.
3
votes
0answers
870 views

mageInit KO binding not working for a custom jQuery widget

I can't get the mageInit binding to work on a custom jQuery widget which I have created. I have used it in my KO template like: <div data-bind="mageInit: {'mywidget':{'configuration-value':true}"&...
3
votes
0answers
41 views

Magento2 - Remove/edit classes from navigation

i have set up a new magento2 store and i added some jqery-ui items ( accordion and tabs) and for them to work, i included the jquery.css in my _extend.less inside my custom theme. Unfortunately now ...
3
votes
1answer
929 views

Magento 2.2.2 bootstrap.min.js:7 Uncaught TypeError: f[b] is not a function

I am Using Magento 2.2.2. I have inserted this code in the Block i.e Content>Block when wei click on the Ask an Expert image , The Modal popup should appear. But currently its not showing popup, the ...
3
votes
0answers
88 views

Initialise a Jquery Widget on Demand with Jquery

I have loaded my layered navigation over ajax to speed up my site load. The layered navigation also uses ajax and it's jQuery is normally initialised via RequireJS i believe with the below requireJS ...
3
votes
1answer
486 views

Datatables jquery plugin in Magento 2?

Datatable version 1.10.15 requirejs-config.js var config = { paths:{ 'dataTables': 'df_Comercial/js/datatables.min', }, map: { '*': { 'dataTables': '...
3
votes
1answer
2k views

Using jquery in phtml got an error: Uncaught ReferenceError: require is not defined

I use jquery in my phtml frontend page like this: <script> require(['jquery', 'jquery/ui'], function($){ var currentUrl = '<?= $itemEditUrl ?>'; $('#link-cusom-campaign')....
3
votes
2answers
2k views

Inserting Javascript codes in one CMS page of Magento 2.1

I am trying to add some javascript codes in one CMS page of a Magento 2.1 site. Here are what I did and the issues I am facing now: 1)at the "Layout Update XML" of the page, add the following jquery ...
3
votes
1answer
1k views

Magento 2 jQuery Modal Not displaying in center

I'm new to Magento 2. For homepage popup i have added below code <div id="popup-modal"> Test Data </div> <script> require(['jquery', 'Magento_Ui/js/modal/modal'], ...
2
votes
0answers
24 views

How to show all data in array using jquery. Magento 2

I'm getting all the Data from Array in Jquery when I console.log() it then it shows me all the data of the array but when I append the data with <div> then it only returns me the last value I ...
2
votes
0answers
19 views

Magento 1.x - Ajax auto choose product

I want after I have pasted sku or name product into the input seach, it will automatically check and notify. I am currently using autoComplete jQuery. But the problem is that if it doesn't show drop ...
2
votes
1answer
27 views

make sticky header without custom js code

I tried to make the header sticky using the default jquery code: $('.page-header').mage('sticky', { container: '.page-wrapper' }); I added this piece of code into the theme.js file in the ...
2
votes
0answers
23 views

Customize native loader

I would like to challenge the template structure of Magento 2 loader which is declared in the lib/web/mage/loader.js but I can't find where this widget is calling by Magento to override the javascript ...
2
votes
1answer
37 views

Magento 2.1.7 - Unable to send form data to controller using AJAX

I am trying to fetch input value but I am unable to get values in the controller. Here is my code, Controller\Index\Index.php <?php namespace Crud\Crudatfrontend\Controller\Index; class Index ...
2
votes
0answers
49 views

Magento-2 jquery widget timing issue

I recently started using jquery widgets in magento and come to know that magento extends jquery-ui widgets through the use of widget factory and customises them according to need and then again return ...
2
votes
0answers
166 views

jQuery got no function after AJAX call

I'm having a problem in using horizontal navigation. When I sort something, at I changes show products with ajax the navigation isn't functional anymore. The click function in jQuery is still working ...
2
votes
1answer
287 views

Magento 2 TypeError Undefined products images not displaying / js not loading

At home page, product category view and product detailed view page images are not loading / displaying at firefox and less frequently at chrome. I am using magento 2.2.6 upgraded from 2.2.2 and porto ...
2
votes
0answers
33 views

Need to Initialization js while ajax response magento 2

Need to Initialization js for particular div when the div append ajax response magento 2. i have append the div in ajax response and also i need initialize js for that div. How to do that
2
votes
0answers
71 views

Custom popup in magento2

I have created a custom popup in list page .. I need to open the popup after 4 sec of every product addtocart. And auto close the popup after 4 sec. some time the popup suddenly closed within 4 sec.....
2
votes
0answers
598 views

Lazy load Js not working in Magento2.2.0/1/2 Version

I have https://www.magebees.com/lazy-load-images-extension-for-magento-2.html this one extension, but not working properly- js errors like window undefined..
2
votes
0answers
364 views

Add modal popup on multiple list elements

I would like to add modal functionality in a list of images wrapped in a div. It should work like so: when i click on a span element the next image should show in a modal. Html example below. <?...
2
votes
3answers
273 views

Whats the best way to remove Out of Stock text

I'm having trouble displaying the out of stock size without text "Out of Stock". Example: And here is how its showing up in DOM: <span class="option out-of-stock" value="370">25 (Out of ...
2
votes
0answers
761 views

How to update product quantity on check out page using Ajax in Magento

I want to provide functionality to update product quantity on checkout page of magento. so if user want to update the product quantity he can do it on without reloading checkout page. I want to ...
2
votes
1answer
1k views

Magento 2 : How to Implement Swiper Plugin

I'm trying to convert html template to Magento 2.1.3. I started my conversion using blank-sass from Snowdog. Some CSS was sucessfully implemented but I can't figure out many points. One of them is how ...
2
votes
0answers
388 views

Magento 2 QuickSearch widget

Does anyone have any experience with Magento 2 QuickSearch widget so perhaps they can provide a code sample (how to use it in module)? I have managed to include it to my js file, but i can not figure ...
2
votes
1answer
727 views

Magento 2 adding jquery in home page

I have added 'jquery-1.10.2.min.js' in app\code\Vendor\Module\view\frontend\web\js\default.xml file for showing a pop up on clicking Add to Wishlist button for product in home page. But on including ...
2
votes
2answers
601 views

Get customer chosen shipping method with jQuery

How could i find out the shipping method that the customer has chosen right after click of change? I have tried to get shipping methods id or value that customer has chosen when he/she has clicked ...
2
votes
0answers
435 views

Add full version of jquery mobile to magento2

Magento2 loads by default a custom build of jquery mobile library: deps: [ "jquery/jquery.mobile.custom", If I try to add the full version of the mobile library (require it in my theme): var ...
2
votes
1answer
563 views

Update price without refresh the page

I am working on magento2 customization calculation functionality. In this i have width and gather two field is there in text field I have to calculation with product price eg. pricewidthgather like ...
2
votes
0answers
372 views

Magento call jquery-ui progressbar after prototype ajax request successfull

I have done ajax add to cart product from product page, I am able to update the top cart contents successfully on Prototype ajax request success, but when I try to initialize the jquery progressbar(...
2
votes
0answers
395 views

Different CSS Styles for Menu Icon

Is it possible to tell Magento to do pick-up different CSS styles for something that appears throughout (such as the header?). For example, a website I am working on features a 'MENU' icon over an ...
2
votes
2answers
441 views

Header static block/widget with image switch on browser refresh

I have 4 season sets of images. winter-images, spring-images, summer-images and autumn-images. Every set has 5 images which has to switch on browser refresh. I want to have them in 4 separate static ...
1
vote
0answers
24 views

Magento 2.3.1 js error 500

In Magento 2.3.1 everything I put a product in Wishlist I get this error in console of all browsers: GET https://mystore.com/el/customer/section/load/?sections=customer%2Ccompare-products%2Clast-...
1
vote
0answers
266 views

Magento-2.2.7 “JQMIGRATE: jQuery.attrFn is deprecated” error in console

This error occurs in browser console once in every 6-8 times and jQuery doesn't work a all on the page. when I reload the page everything works fine.
1
vote
2answers
62 views

Magento 2 Execute jQuery when minicart is done loading

I'm having the problem currently where I need to run some jQuery on my Minicart. However, I can't select anything from the Minicart because the jQuery is executing before the Minicart is actually ...
1
vote
1answer
25 views

Magento theme displays errors and responsive display after refresh

We have a Magento webshop (1.9.3.2) with Ultimo theme, which appears to have some strange problem in a few browsers - we've discovered it's only on Chrome and Opera so far. When you first watch the ...
1
vote
0answers
981 views

magento 2 Uncaught TypeError: Cannot read property 'version' of undefined

I got below error randomly in front-end and when all modal popup not working when below error occurs. Uncaught TypeError: Cannot read property 'version' of undefined I have override admin product-...
1
vote
1answer
94 views

Uncaught Error: Mismatched anonymous define() magento 2.2.4

Below is the console erros is getting in frontend. Checked .htaccess in pub, pub/static and root all .htaccess are identical to Magento 2.2.4 version. js bundling/minification is enabled and ran ...
1
vote
0answers
141 views

How to change product price using drop down option in Magento 2?

I want to change product price when drop down option is change. Here drop down is dynamic means you can add N number of drop down and it's options from admin side. (Note: This is not a product custom ...
1
vote
1answer
21 views

Custom Page in Magento2

I am new to Magento 2. We are currently in the process of migrating from Magento 1 and I have been tasked with updating our custom pages to work in Magento 2. I have a page (using the page editor in ...
1
vote
0answers
28 views

how to validate before save stocktaking in magento 2 backend

Help me ! i saved the qty successfully using ajax popup, but i want hide 2 button in popup Close Save When you click the save button -> save When you click the save Close-> not save My jquery ...