Questions tagged [jquery]

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

Filter by
Sorted by
Tagged with
26
votes
2answers
42k views

How to use jquery library in Magento 2?

I am creating a Magento theme where I need to include jQuery. When I add this <link src="js/jquery-1.7.1.js"/> in head. It is working but Magento javascript functions are not working. How to ...
4
votes
1answer
3k views

Unable to use jQuery

Alright, I am trying to do a very simple thing: use jQuery in my myScript.js file. I'm on Magento 1.9.0.1. The theme I am building is based on the built-in rwd theme, which by default loads jQuery 1....
10
votes
5answers
22k views

How to add Jquery in Magento?

In my current project in about us page I need to add tabs to switch between different section I know this can be done by Jquery tabs but I don't know how to do this when integrating with magento.
3
votes
1answer
1k views

Call to a member function getAccountNo() on null Magento 2

I'm extending shipping method section in checkout page, and it's showing well. But it's throwing error while clicking next button after filling shipping address and shipping method information in ...
13
votes
2answers
13k views

How to add bootstrap.js in magento2

I m trying to include bootstrap js on my magento2 theme. But the problem is when i include bootstrap js on my theme. That time console is giving error that bootstrap require jQuery. Then how can i ...
16
votes
4answers
19k views

Adding a jQuery Library to Magento 2

How can a third party developer add a jQuery library to Magento 2? While Magento 2 includes a version of jQuery in their frontend themes, the jQuery object is not immediately available in the global ...
0
votes
2answers
3k views

Magento 2 & JQuery.UI.Autocomplete

I would like to use JQuery.UI.Autocomplete component in my module for Magento 2. Also, I am using KO.js for the user interface of my application. So, I have added a custom binding for KO: define([ '...
7
votes
2answers
2k views

Add jQuery Datatables in magento 2

I am trying to use the jquery DataTables in magento-2 frontend using the requirejs. I can see the datables.min.js file in the net panel, but somehow it give the following error. My reuirejs-config....
6
votes
3answers
6k views

Magento 2 - Ajax is not calling Controller

I tried to make a simple ajax-call to my controller. Somehow I don't get a valid response. MyCompany/MyModule/Index/GetAjax.php namespace MyCompany\MyModule\Controller\Index; class GetAjax extends ...
2
votes
1answer
4k views

jQuery ajax data to controller

I am trying to make my first ajax request in magento to controller file but can not get it working. My .js file is: jQuery.ajax({ type: 'post', url: 'vendor_module/index/...
2
votes
2answers
3k views

Fixed Headers in Magento

I want to fix my header for my magento site. Please get me some solutions so that I will be helpful
1
vote
2answers
5k views

Remove Conflict between JQuery and Prototype.js in magento 1.9.1

I have included all the js library in page.xml of my magento. <action method="addJs"><script>lib/jquery/jquery-1.10.2.min.js</script></action> <action method="...
1
vote
1answer
1k 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 ...
4
votes
2answers
6k views

Magento2 adding 3rd party jQuery files to module

I am trying to add in some 3rd party jQuery code to my Magento2 module. I want to have my own custom js file that will use the 3rd party code. Before I was adding the code into the header instead of ...
2
votes
2answers
4k views

How to change jQuery version in Magento2

Magento 2.1.2 bundled with jQuery 1.11. How it possible to replace it with jQuery 2.1?
1
vote
1answer
1k views

Validation Error with jQuery-UI Autocomplete and KnockoutJs - Magento 2

The Problem: I've implemented jQuery-ui Autocomplete with Knockout Js in Checkout Page but some input fields that are binded to my Component throw a validation error ("Required Field") when i update ...
1
vote
4answers
165 views

ReferenceError: jQuery is not defined error owl Carousel slider

I am trying to use slider in my magneto custom module I did Following steps: 1 create a file requirejs-config.js var config = { map: { '*': { my: 'Vendor_Module/js/owl....
1
vote
2answers
185 views

I want to refresh the page automatically if users clicks on CHECK button

I want to refresh the product page automatically if the user clicks on "CHECK" button of zipcode field. I want to refresh the page automatically every time user click on CHECK button of zipcode or ...
1
vote
1answer
1k views

Loading jQuery in Magento [duplicate]

I'm trying to implement an owl-carousel in my Magento webshop. I've loaded the .js file and the stylesheet. Jquery is (I believe) loaded from the template. When I use to code to activate the carousel ...
0
votes
1answer
1k views

Jquery Conflict Issue Magento 1.9

i have added custom slider with for products. I added Jquery files. When I add jQuery files in XML then slider working but Add to Cart Button not working. When I remove jQuery files then, Slider ...
17
votes
3answers
6k views

Magento 2 add custom product attribute validation from install script

[ 'type' => 'int', 'backend' => '', 'frontend' => '', 'label' => 'XXXX', 'input' => 'text', 'frontend_class' => 'validate-greater-than-zero', 'source' => '', 'global' =>...
2
votes
2answers
11k views

Magento 2: How to defaultly open “content 2” tab?

I am using accordion for tab open and close.How to open default "content 2" tab? <div class="block filter" id="layered-filter-block" data-mage-init='{"collapsible":{"openedState": "active", "...
5
votes
3answers
15k views

Magento2 : ReferenceError: jQuery is not defined

I am trying to add custom jquery code into my module but it is not working. app/code/Custom/Module/view/frontend/web/js/my.js jQuery.noConflict(); jQuery(document).ready(function(){ alert('ok'); ...
6
votes
4answers
14k views

how to implement Loader widget in magento2

I want to implement loader widget in magento 2, In my form i have placed one button <div style="display:inline; float:right; width:100%; margin-bottom:5px;"> <button style="" class="...
5
votes
2answers
6k views

How to add js libraries that require Jquery to magento 2 using requireJs

I am having a bit of strange behaviour with Magento 2 require. What I trying to do is to use glide.js to load carousel image. I create custom.js and here is my code. require(['jquery', 'lib/glide'], ...
5
votes
2answers
2k views

My js file is not loaded in Magento 2

My steps: 1) Load my file slider.js to: app/design/frontend/Vendorname/default/web/js. 2) Create requirejs-config.js to: app/design/frontend/Vendorname/default var config = { paths: { ...
4
votes
2answers
3k views

How to pass phtml variable in js file in magento2 [duplicate]

This is my phtml file .... <?php $currentCategory = $block->getCurrentCategory(); //echo $currentCategory; ?> I want to set $currentCategory value in js file and display in alert ......
3
votes
3answers
11k views

jquery not defined error in magento 2

I am trying to bring banner scroll in magento2. I am using owl carousel for this purpose. Everything have done and implemented and is showing in firefox without any errors. But when checked in chrome, ...
12
votes
1answer
6k views

magento2: how validation work in magento2

In magento1 we can check validation like this: var formToValidate = $('form-validate'); var validator = new Validation(formToValidate); if(validator.validate()) { // Here we can code ...
5
votes
2answers
5k views

Issue with jQuery usage in Magento 2

Currently I have a custom block loaded almost last on the page containing: <script type="text/javascript" src="/test.js"></script> This script is pretty much the usual stuff, just ...
2
votes
2answers
2k views

Magento 2: Checkout button on product page

Is there a way to add a 'Add to Cart and Checkout' button to the product page, so that the product is added to the cart and then takes the user straight to the checkout?
2
votes
2answers
9k views

MIME type ('text/html') is not executable and strict MIME type checking is enabled

In magento when I add to cart the product I show below error: "Refused to execute script from 'http://www.example.com/ajaxcartsuper/ajaxcart/add/uenc/aHR0cDovL215ZmF…r_attribute%5B139%5D=27&qty=1&...
2
votes
2answers
3k views

Magento2 catch ajax complete, add to cart

I'm building an custom mini-cart. I want it to update itself when an article is added to the cart. I'm trying to do this by jQuery with catching the ajax complete, but can't get it to work. Can anyone ...
1
vote
1answer
461 views

Magento 2: colorbox jquery not working

I am working on magento 2 and i want to open popup in my product detail page. But i have found problem with jquery issue and its not come every time. Here is my requirejs-config.js var config = { ...
1
vote
2answers
3k views

jQuery not working in checkout page - Magento 2

I am customizing checkout page. I try set value in form field by using Jquery but did not work. for making test I will try to hide all input elements in checkout page such a simple task but did not ...
0
votes
1answer
3k views

How to save a image upload to a folder in magento2? [duplicate]

Created a custom tab on admin product edit page. Here added a image upload section. I need to save the uploaded image to a folder.
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 ...
3
votes
4answers
4k views

jquery fancybox for magento 2

Its working in my localhost, but when use same code in magento 2 its not working any suggestions please <!DOCTYPE html> <html> <head> <title>fancyBox - Fancy jQuery ...
3
votes
2answers
977 views

Block with jQuery autocomplete in checkout page

How can I add jQuery autocomplete to checkout custom block? Part of my js file code: if (...) { $(".hello").not(".red").hide(); $(".red").show(); var availableTags = [ "ActionScript"...
3
votes
1answer
3k views

Conflict with using JQuery in Magento [duplicate]

I want to use JQuery in magento. When I included JQuery in the code, Prototype is throwing errors at this line. element.attachEvent("ondataavailable", responder); Can anyone help me?
3
votes
2answers
3k views

Custom AJAX discount-form not processing coupons

Running Magento 1.9.0.1 CE I've created an AJAX version of the discount-form used in Magento to process coupons in Magento with the help of this tutorial: http://www.lelandcope.com/2012/04/how-to-...
3
votes
2answers
4k views

On hover instead of 'click' for mini cart and top account buttons in Magento RWD theme

Where do i have to change the jQuery functionality to show the drop downs from the 'mini cart' and the 'top-account' on hover instead of click on the desktop versions? Thanks!
2
votes
3answers
433 views

<sequence> not working?

I've made a script in a custom module that is dependent on customer-data.js, a .js file initiated by Magento_Customer. So, what I did in my module.xml: <config xmlns:xsi="http://www.w3.org/2001/...
2
votes
1answer
41 views

Magento 2: Ajax without effect

My problem is as follow, my script except ajax in working (no problem with giving value or console.log) but my ajax doesn't give me the result expected (remove hidden class and fill a drop list with ...
2
votes
1answer
263 views

Magento 2.2.6: Product collection does not apply the filter

EDIT: I have seen that in magento 2 the ListProduct page is cached, for this reason once loaded it does not enter. Is there any way to modify the query returned by ListProduct? I extend the class: ...
2
votes
2answers
189 views

How to add custom field in registration form and add jquery validation in Magento2.2.5?

How to add custom field in registration form and save in database and add jquery validation in Magento2.2.5? Any help would be appreciated
2
votes
1answer
38 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
3answers
4k views

Magento 2, Cannot read property 'ui' of undefined

I don't get why adding my custom js file causes below issue. Please help understand the cause. Let me know if more details should be provided here. Is it dependency issue? edit: My requirejs-config....
2
votes
1answer
523 views

Uncaught Error: Mismatched anonymous when calling JQuery in Magento 2 frontend

i use jquery in front-end for ajax in phtml page, but i'm getting this error: Uncaught Error: Mismatched anonymous define() module: function ($, _, template) here's my code: <script> ...
2
votes
1answer
3k views

Uncaught Error: Mismatched anonymous define() module in magento 2 .?

I have use mCustomScrollbar jquery plugin but there some error have come & error like: Uncaught Error: Mismatched anonymous define() module.. Help appreciated. Thanks. My mCustomScrollbar ...