Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
3answers
34 views

How remove 0 after decimal in js [on hold]

i am getting this value 7,785.00 i want remove .00 using js
0
votes
1answer
18 views

How get Parent child div valule

want to get <span class="price">Rs.5,190.00</span> using jquery, below is html <div id="checkout-review" class="onepagecheckout_block"> <div class="op_block_title"><i ...
0
votes
0answers
29 views

How to get active slide id in jQuery

How to get active slide id in jQuery. <?php /** * Copyright 2016 aheadWorks. All rights reserved. * See LICENSE.txt for license details. */ // @codingStandardsIgnoreFile /** @var $block \...
0
votes
1answer
17 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
9 views

Magento 2 Jquery Value Not actualy setting in form submit request

I am trying to set 2 values dynamically when a custom field is entered in the custom registration form. Here is my custom js : require(['jquery','mage/url'],function($,urlBuilder) { var ...
-1
votes
0answers
17 views

Copy to clipboard button in magento 1 [migrated]

Is there any way to create a copy to clipboard button on Safari? This is my code, but it does not work in Safari. <input type="text" id="copy"/> <button class="copy-button" id="button-copy"&...
0
votes
2answers
16 views

Inline call of jQuery tabs doesn't work

Here's my problem. I have a tabs block which load perfectly when I put this script in phtml require([ 'jquery', 'jquery/ui' ], function($) { $("...
2
votes
1answer
45 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: ...
0
votes
0answers
15 views

Magento 2 How to set dropdown attribute value on product page using JS Frontend

Please see the attached screenshot: Here, How can I set the value of SIZE while loading page? Do we have to initialize any configurable swatches option JS? Please suggest & guide me if you face ...
0
votes
1answer
10 views

How can scroll screen to clicked div in mobile view

Open link in mobile or in >600px device : http://dev.mpex.com/ee14/team-2018 Click on any team image. after open description cursor goes to top. we need to keep on clicked image. when I click to this ...
0
votes
1answer
25 views

Magento 2 How to add custom validation rules and apply them?

I'm trying to modify some validation rules for the State input in shipping address. I want to add an error message if user selects 'Texas'. I created a mixin for Magento_Ui/js/lib/validation/rules in ...
0
votes
2answers
23 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
28 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 ...
1
vote
0answers
18 views

Toggle switch to change between Incl. and Exc. TAX with ajax continious loading

I've coded up a quick toggle switch which will change the price display between Including and Excluding tax using "display: none" with jQuery hide and show but i'm having problems with an Ajax ...
0
votes
1answer
15 views

using javascript in .html form Magento2

i have a custom form.html that displays at checkout. i want to have a javascript tag - when the form load just show an alert testing purposes. code i used below, "<script type="text/javascript"&...
0
votes
1answer
28 views

call custom phtml with Ajax or Knockout in magento admin order detail page

anyone know how we can call custom phtml in order detail page admin side.
3
votes
0answers
83 views

Knockout.js in magento2

How to change the jquery into ko? define([ 'jquery' ], function ($) { "use strict"; $.widget('xxx.homePage', { options: { bindSubmit: true, ...
2
votes
0answers
21 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
0
votes
1answer
25 views

home page in magento2

I have created home.js file using require-config.js for HomePage. And init that home.js file in home.phtml file for Home Page. But i need to get the function that inside the home.js file into size....
0
votes
1answer
13 views

How to add a custom jquery file for custom shipping additional file in magento 2

I have created a custom shipping method + shipping form like below. I want to add click event for the check box. I tried this code in my phtml file. <script> require( [ 'jquery', ...
0
votes
0answers
28 views

Js error when first time loading site magento 2 in chrome browser

Js error when first time loading site magento 2 in chrome browser. Firefox, and explorer no problem. One of the problem is here. http://prntscr.com/kso59y
0
votes
0answers
30 views

jquery ajax not working in magento2

I am working on a simple custom module, where user can input height and the weight/BMI will be shown as output on form submit. The page where user enters input is Calculation Page while output is ...
1
vote
0answers
37 views

Issues creating a widget with repeated functionality in Javascript

Have a controller class setup as a widget. Labeled here as "buttonController". I'm trying to call and instantiate an instance of the controller widget per each button. Everything seemingly works, ...
0
votes
0answers
43 views

Magento 1.9.2. - Update in real time Tier Price when i change quantity

I'm trying this code because I want to see the price of the product change dynamically when in the input field of the quantity exchange the number (this only for the products that have the tier price)....
0
votes
2answers
133 views

Magento 2 : How to override fotorama.js in magento custom theme

I need to show gallery arrow always visible on product gallery page. I tried in gallery.phtml variable arrows="always", but its not working. I want to show both arrow always visible on product ...
1
vote
1answer
30 views

RequireJs and Custom JS file blur

this is my simple requirejs-config.js file var config = { deps: ['js/custom'] }; and this is my custom.js file define([ "jquery", "domReady!" ], function($) { "use ...
0
votes
0answers
18 views

Clear GRID Serializer Values in hidden field

I have a working Grid Serializer. Now I want to clear the Grid Serializer values without refreshing page. So, I added a jquery script to clear the hidden field: $("input[name='links[products]']")....
0
votes
2answers
42 views

Displaying a message when hover on a readonly attribute!

I'm trying to display message on hover over a readonly select in a product page, ( Magento 2.2.4, Php 7) Here's my attempt: CSS: #select_801[readonly]{ background: #eee; pointer-events: none; ...
1
vote
2answers
49 views

Open Tab on page load in magento 2

I have code like below in my html file <div class="payment-option _collapsible opc-payment-additional discount-code" data-bind="mageInit: {'collapsible':{'openedState': '_active'}}"> ...
0
votes
0answers
34 views

How to solve jquery issues in Magento 2?

I am using Magento 2.2.3 and I have created customtheme But in my website scripts are not working properly.It gives me below error: ReferenceError: jQuery is not defined I have added requirejs-...
0
votes
2answers
109 views

Javascript function in phtml files

I am using onclick function in my template file, here is my html <div class="input-box"> <input type="checkbox" name="change_password" id="change_password" value="1" onclick="...
0
votes
2answers
85 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%. ...
2
votes
1answer
37 views

How can we load js to a custom module created?

Can you please suggest us how to load js into the custom module created? We are facing issues in loading the js to our custom module created
3
votes
0answers
125 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
27 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 ...
0
votes
0answers
22 views

Magento 2 adding textbox to modal widget

I want a text box in my modal widget in custom js file and get the value of that text box on button click of that modal. require([ 'jquery', 'jquery/ui', 'Magento_Ui/js/modal/modal' ], ...
0
votes
0answers
46 views

Jquery ui tabs not loading without clearing browser cache

I have a problem, created a custom page in magento2 with custom jquery ui tabs but tabs not working properly. When i clear the browser cache tabs are loading fine but without again on page refresh ...
0
votes
1answer
18 views

JQuery message im magento 1, need to be adjusted for non-repetition and translation-ready

I have two issues in this code: 1: if I keep clicking on the radio button the message will be repeated. 2: I cannot translate the message to other language. Here is my jquery code: <script ...
1
vote
0answers
52 views

Magento 2: Browser console error on hard refresh

I am facing some weird issue with Magento 2.2.5 version. When I first-time open website, I am getting lots of js errors. (Screenshot attached) After this, when I only press F5 button (normal refresh) ...
0
votes
0answers
44 views

Magento-2 : Upgrade elasticsearch query from 5.x to 6.x

I have Magento-2 Elasticsearch custom module which is working with Magento-2 + Elasticsearch-5.x Now I am upgrading module with Elasticsearch-6.x. My module has search result popup which is showing ...
0
votes
1answer
40 views

Magento 1.7 custom options not updating price

On a Magento 1.7 website the product option price is not longer updating the main price. I updated the prototype.js file which I though was causing the issue but still no luck. When I inspect the code ...
0
votes
0answers
17 views

How to load entered customer card number from database to frontend

I have customized my sign up form by adding an extra field to add his shopping card number, however I want this card number to be loaded for the box each time he is logged on. following I have stated ...
0
votes
1answer
234 views

Magento 2 checkout page how to get country_id from selected shipping addresses?

How to get country id/country name from selected shipping address in the checkout page. lets assume if the customer has multiple shipping addresses, based on the shipping address choose, if country ...
1
vote
1answer
39 views

Magento2: Update Qty of product in bundle

I am updating the quantity of a radio button in a bundle via jQuery: $ ('input. Qty'). Val (4) Unfortunately the product summary does not change. When I put the value ("4") in the same input field ...
0
votes
0answers
62 views

JQMIGRATE: 'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'

I'm using Jquery version "v1.12.4" and Jquery migrate version "v1.2.1" on our Magento (Version: 2.2.3) site. I'm getting the below console warning: JQMIGRATE: 'hover' pseudo-event is deprecated, use '...
0
votes
0answers
35 views

Sometimes on magento 2 - jquery-migrate.js is not loading

I'm having some strange issue with the website, it takes too much time to load. Sometimes jquery-migrate.js is not loading, which is making issue with the slider. Store URL- http://megabooklet.com/...
1
vote
0answers
28 views

Is the JQMIGRATE necessary for Magento 2?

Just out of curiosity: Is the JQMIGRATE necessary for Magento 2? Because it is complaining about using a deprecated psuedo event. Please see the below screenshot. If it's not necessary for Magento ...
3
votes
7answers
404 views

jQuery not working for custom checkbox on checkout page

I am looking to create a custom checkbox field on the checkout process that a customer can click to define if they are a business customer or a consumer. To do so I made a module with the file ...
1
vote
0answers
69 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 ...
1
vote
1answer
39 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 adtocart. And auto close the popup after 4 sec. some time the popup suddenly closed within 4 sec......