Questions tagged [jquery]

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

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....
25
votes
3answers
38k 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 ...
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.
12
votes
2answers
12k 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 ...
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 ...
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....
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/...
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
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
4
votes
2answers
5k 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
3k 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
922 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
2answers
172 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
10k 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
14k 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'); ...
3
votes
1answer
5k views

Magento 2: How to add popup on button click in admin?

Can you explain how to add popup(modal window) on button click in the adminhtml? I already create some phtml <div id="messages"> <div class="messages"> <?php foreach ($this->...
6
votes
4answers
13k 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="...
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 ...
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
2k 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 ......
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 ...
4
votes
1answer
816 views

magento 2 Add to cart popup is not working after load the product using infinite ajax scroll [closed]

I have used infinite ajax scrolling on product listing page.Its working but there are one issue. Add to cart popup is not working after load product using infinite ajax scrolling. Please check ...
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?
1
vote
2answers
8k 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&...
1
vote
1answer
832 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 ...
1
vote
1answer
442 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
2k 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
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
935 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
2answers
3k 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!
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
5answers
3k 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 ...
2
votes
1answer
483 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
220 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
3answers
353 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
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 ...
1
vote
4answers
82 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
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....
1
vote
2answers
2k views

Jquery-Ui Autocomplete with KnockoutJs Magento 2

The Context: I'm implementing an autocomplete functionality in checkout page and i've added two inputs (ccity and ccity_id). I need ccity_id to be hidden while storing the value of the selected label ...
1
vote
2answers
1k views

jQuery conflict in the product view page

I implement jquery lazyloads to load product images on scrolling.. I added the following codes to view.phtml <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></...
1
vote
1answer
487 views

How to use 2 third party jquery plugins in one custom module Magento 2

Slick for slider. Fancybox for Custom HTml forms ( SignIn,signUp ...) In /var/www/html/magento2/app/code/Custommodule/ReviewRating/view/frontend/requirejs-config.js var config = { deps: [ "...