Questions tagged [jquery]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

Magento 2:- How to create Vertical or Horizontal tagging with Tabs widget

I tried to create tabbing using Tabs widget but It does not display what i want. I follow this Link:- Tab widget and Building Tabbed Interface with Magento 2 Javascript UI Widget/Modal/view/frontend/...
0
votes
1answer
1k views

jQuery version update at M2

I want to upgrade magento 2 jQuery version from 1.9 to 3 do you think is an good idea? how i do it for upgrade jquery build-in file who come with magento 2 ?
0
votes
1answer
1k views

magento 2: Slick JS does not work when loaded from require JS

There is no error in console and when I tried to put the log "Slick is on "on the on-init function, it displayed correctly. My theme require-config js : var config = { deps: [ "js/mainsite", ...
0
votes
1answer
12 views

jQuery function call on focus out for form field not working

I have created a Magento admin form with following fields. $skuField = $fieldset->addField( 'sku', 'text', [ 'name' => 'sku', 'label' => __(...
0
votes
2answers
899 views

jQuery multiple input types in one form

I got multiple input types in my form based on positions. <input type="file" name="file" id="file" data-positionid="<?php echo $positionId; ?>" class="inputfile" /> Now i want on change ...
2
votes
1answer
2k views

Slick slider is not working properly in Magento2.3

I would like to use slick slider concept for compare products so I have implemented it on my Magento site. But It's not working as expected though the script has been loaded. I'm not sure where am I ...
1
vote
1answer
1k views

How to Auto Select Color Option for Products with Only One Color (configurable product)?

I have some configurable products with a custom color swatches attribute. Lot of them have just one color options, so i 'd like to mark the option as selected in the product page. I added a custom js ...
0
votes
1answer
789 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
21 views

Magento2: Sometime js load sometime js not load properly

I got the JS error in console. Sometime when page load got the JS error and Sometime when page load it is working. I don't know what's the exact issue. I disabled all 3rd party extension after that ...
0
votes
0answers
15 views

Make product data tabs collapsed by default

I want all product data tabs on the product details page to be collapsed by default. I edited this line in app/design/frontend/<Namespace>/<theme>/Magento_Catalog/templates/product/view/...
4
votes
2answers
2k views

add custom js to the certain input element on the checkout page

My final goal adds custom js to the certain input element on the checkout page what i tried To get element with uiRegistry and on redner add needed code, but failed, i can work with tjis element ...
6
votes
1answer
2k 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 ...
0
votes
1answer
3k views

Magento 2.3 - Uncaught TypeError: Cannot read property 'version' of undefined [closed]

Installed Magento 2.3.1 with sample data there are no js errors on the console. After changing the theme to Ves Need from Venustheme. http://www.venustheme.com/theme/ves-need/ On hard refresh, the ...
1
vote
1answer
30 views

Magento 2 Console Error Uncaught TypeError

I have Update Magento version 2.3.4 to 2.4 and now on the product page these errors are coming. Uncaught TypeError: Cannot set property 'migrateVersion' of undefined Uncaught TypeError: Cannot set ...
2
votes
0answers
15 views

Magento 2 How to remove Field required validation, if form Div is Hidden

Magento 2 How to remove --data-mage-init='{"validation":{}}-- when div is hidden, I hide div when select box value is not equal to 0 using Script <div class="row"> <...
1
vote
1answer
2k views

Adding to cart breaks fotorama on page reload

Fotorama works normally until I click add to basket. After the page reloads this then shows collapsed (as per the image) and logs a couple of errors to console. fotorama.js:99 Uncaught Fotorama ...
2
votes
0answers
93 views

How to add “httponly” attribute set on existing cookie ? (Magento 1)

In Magento 1 I can see many of the cookie are without Secure flag and HttpOnly set on website. Is their any way to set Secure flag and HttpOnly set on all server Cookie ? I need to make all server ...
0
votes
0answers
11 views

how to refresh admin side edit page block after inserting image of custom module using AJAX in magento1.9

I have create one custom module to insert image from admin side in custom database same as catalog product in magento1.9 below is my controller function for insert image in custom database. this ...
0
votes
0answers
20 views

How to reload block using ajax in magento 1.9

Below is my controllers/adminhtml/vendorproductcontroller.php to save image. public function imagesaveAction(){ $data = $this->getRequest()->getPost(); $id = $data['...
0
votes
2answers
622 views

Change Product Page Fotorama On Element Click

I'm trying to change to a specific image in the product gallery when the user clicks a button to customize their item. So far I have the following code: require( ['jquery', 'jquery/ui', 'mage/...
0
votes
0answers
35 views

Uncaught TypeError: Cannot read property 'offset' of undefined JAVASCRIPT

PLEASE HELP ME GUYS I try to Smooth Auto-Scroll to Next Panel via Mouse Wheel but get some error anyone plz help me how to fix it ''''''''''''''''''''''''''''''' my code function scrollThere(...
1
vote
1answer
198 views

How to call javascript function from Observer file in Magento 2

I have created a custom js file in my custom module. app\code\Vendor\Module\view\frontend\layout\default.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/...
0
votes
2answers
21 views

Magento 2 jquery and checkout

In magento 2 (checkout) I need to hide and show some fields. <div class="field" data-bind="visible: visible, attr: {'name': element.dataScope}, css: additionalClasses" name=&...
0
votes
1answer
883 views

Product detail page image not loading on front end

Product detail page images are not loading. The pointer is just spinning. I have read lots of threads. Clear cache, reindexed, change permissions. Finally, I got a problem. but unable to fix it. :-/ ...
0
votes
0answers
12 views

Magento2 add cart value change the QTY instead of updating

Currently the default behaviour is if i have item X in the cart with qty 5, if i put 8 in the qty box and add to cart the new qty is 13 - the expected behaviour we need to for the cart to change to 8 ...
0
votes
0answers
18 views

How to write magento javascript mixin for widget returned as an object?

I need to write magento javascript mixin for the menu.js part which is returned as the object of two multiple widgets. Actual location of the file is lib\web\mage\menu.js which further extends the ...
0
votes
1answer
32 views

jQuery onchnage function call in magento 2.3

How to use custom js in Magento 2.3 add jquery jQuery('.customdrop select').on('change',function(){ console.log(jQuery('.customdrop select').find(":selected").text)); if (jQuery('....
0
votes
0answers
10 views

checkout shipping page add custom field in magento 2.3.5

Now i added custom field checkout shipping page but issue add custom module custom.js and define layout checkout_index_index.xml but it's not working checkout_index_index.xml <page xmlns:xsi=&...
0
votes
1answer
2k views

Lots of jQuery conflicts on Magento 2

I'm working on a new Magento 2 installation with the Porto theme and have noticed that when you first visit the site or have the browser cache disabled you get a lot of of jQuery conflict errors. ...
1
vote
1answer
3k views

Sending variable to a bootstrap modal

I have seen this asked before but a lot of the answers I found where people looking to get a variable into a modal to query a database. However thats not what I want. I just want to send a variable ...
0
votes
1answer
2k views

Getting jQuery.browser is deprecated error in console magento 2.1.5

I keep on getting this error in my console, JQMIGRATE: jQuery.browser is deprecated migrateWarn @ jquery-migrate.js:41 get @ jquery-migrate.js:58 (anonymous) @ jquery.ba-hashchange.min.js:9 (...
1
vote
1answer
1k views

Magento 2: How to use event trigger on the checkout page?

How to use event trigger when change "State/Province " drop-down on the checkout page? I'm trying to page reload when user change Region from "State/Province" dropdown in the checkout page. First, ...
0
votes
1answer
30 views

How to fix XSS in website in url ? Magento 1

I can see that browsing url like this https://www.anywebsite.com/?p=%3Cscript%3Ealert(document.cookie)%3C/script%3E shows alert into browser window. Is their any way to prevent it ? its XSS.
0
votes
0answers
7 views

Step By Step Testimonial Wizard Using jQuery and CSS | Multi Step Progress Wizard

I am trying to be something like this but there are some issues coming in it, can you help me to fulfill this. Error Link https://prnt.sc/um895k My jQuery code jQuery(document).ready(function(){ $(&...
0
votes
0answers
24 views

Please enter a value between NaN and NaN Magento 2

I added a range price slider to my product checkout. Now adding the product works fine. So basically I have a Select input where it contains a dropdown of the price value but I hidden it and made the ...
0
votes
1answer
2k views

QuickSearch widget Magento 2. How to make closed search

I read a lot documentation and see code search. But don't understand how make an opening search by clicking on the icon. Mobile version have opening search by clicking on the icon. How make same for ...
0
votes
0answers
5 views

How to enable add to cart button duplicated on product page due to bootstrap4 display classes

im facing an issue in a theme for magento 2.3 im creating for the company i work for. Here's the situation: I'm using bootstrap4 grid css so i can take advantage of the layout features plus class ...
2
votes
2answers
793 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 ...
0
votes
0answers
19 views

Download or save page as HTML on Button click

I want to download or save the page as an HTML when someone clicks on the Download button or link. Please check the below code. <button class='download'>Download</button> <a href='#' ...
0
votes
0answers
61 views

While opening coupon code and trying to go next page it gives Jquery Validate error in Magento 2?

I have created some steps between address and payment form in Magento 2. When i open the coupon code and want to go on next step ( Payment Page Step ) It gives me an error Cannot read property '...
3
votes
1answer
867 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
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')....
0
votes
2answers
1k views

Owl Carousel not working in Chrome

I've got a carousel (Owl Carousel) on my home page that doesn't work on Chrome but does work in other browsers. I believe it is something to do with Jquey loading after the carousel but I'm not 100%. ...
0
votes
1answer
21 views

When click Image and show clicking Image in popup in magento 2

How to create, When click Image and show clicking Image in popup. This is my code :- echo "<td>"?><img src="<?php echo $this->getMediaUrl() .'brand'. $data->...
1
vote
1answer
5k views

Blocked a frame with origin from accessing a cross-origin frame

when I want to go onclick to next page's specific div it shows this error . jquery.js:3123 Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a ...
0
votes
0answers
22 views

Magento2 How to add custom js for checkout billing address only

Does anyone know how i can add custom js for billing address form only ? i need to get default selected country from billing address
0
votes
0answers
25 views

magento 2.3 call updatePrice or reloadPrice on click event

I've added a checkbox on my product page so when the user clicks on it, the product price gets changed. In order for this to work, the click event should call reloadPrice(), a javascript method ...
2
votes
2answers
84 views

Magento2.3 : Pagination - jump to top of pagination at PLP page

I have a problem with Buttons in Pagination. If the user clicks the button, it reloads the page with loader and settles down at the current page scroll position. Is there any method to force the ...
1
vote
2answers
1k views

Show div after delay on Magento 2 with JQuery

I need to show this div after 3 seconds on my page. <div id="cratepop"> <br> <center><img src="/shoppingcart.png"></center> <br> </div> ...
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 ...

1
2 3 4 5
15