Questions tagged [jquery]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

How to close the current tab in magento 2 custom page?

I have created one custom page .In this page one link is there ,while clicking the link I need to close the custom page .how can we achieve this?
0
votes
1answer
10 views

JavaScript Error (Uncaught TypeError: $.initNamespaceStorage is not a function)

We are running a Magento multi site and on ONE site only, I get this error Uncaught TypeError: $.initNamespaceStorage is not a function All sites use the same theme (just some differences between them....
0
votes
1answer
21 views

Input Select File should not allows to override the previous one. is it possible?

Drag and Drop file allows you to override the previous one - should this happen or should it say there's already a file in place? when select next new file.Is there any way to validate previous one ...
0
votes
1answer
27 views

Magento2 Ajax change store currency and refresh total on Checkout page when change address

I want to change the current store currency by ajax and refresh the total when changing the address on the checkout page. I have successfully changed store currency by below code: $this->...
1
vote
1answer
27 views

Magento 2: How to create popup alert in magento 2

I added a button in block which hits custom controller (I am not using any template) This is controller code: <?php namespace Vtn\UnexportedOrder\Controller\Adminhtml\Order; use Magento\Framework\...
1
vote
1answer
37 views

Magento 2 set child product image from URL

Magento 2.3.5 How to set child product image from URL for configurable product on the product detail page Example - product URL is - http://xyx.com/product.html#447=5439 dropdown is selecting ...
0
votes
0answers
17 views

Output finalPrice in swatches directly

I want to output the finalPrice in the swatches directly, so that customers can see what the options mean for the price. I am successful in outputting it, but somehow it doesn't index all the products....
0
votes
4answers
48 views

Magento 2 - How to use jQuery3?

I try to include jQuery 3 to my project so I can use it on some CMS sites. Attempt: THEME = app\design\frontend\company\fresh\ THEME\web\js\jQuery\jquery-3.6.0.js Copy pasted the code from here to ...
0
votes
2answers
21 views

JS file is not working

JS for my main page is working..for example, I am using main_file.js for my default loaded page. Which is actually working properly. but I have a search option on my default page which leads to some ...
0
votes
0answers
34 views

Javascript mixin issues - base is not a constructor

I ran into an interesting issue while trying to create a mixin for a 3rd party JS script. I created the mixin in the normal way with my requirejs-config.js like this: let config = { config: { ...
1
vote
1answer
37 views

Magento 2 DropdownDialog widget showing dropdown when the page load without onclick

I am using https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/widgets/widget_dialog.html if the page refreshes the drop-down popup come 1 second on the page, how to solve this issue on the ...
2
votes
1answer
37 views

Add custom popup using Modal

Want to open a popup by clicking the button in homepage. inside the popup form will be submitted using Ajax call
0
votes
1answer
55 views

Magento 2 How to get data from input fields with modal widget button

I want to get data from <input> and <textarea> fields and redirect to other URL controller but I'm stucking in writing logic for it Here is my phtml file <a class="action print&...
0
votes
0answers
17 views

Allow cookies popup display on every page- Default Magento2

Allow cookies popup display on every page. After allowing still getting cookie popup on every page. I am using chrome, Magento2.3.4-p2. Browser save cookie data settings are already enabled. See ...
0
votes
0answers
24 views

pagination using jquery

I have a search bar on my page when I search for something it returns the result perfectly with correct pagination. As shown below but when I clicked on page 2, it returns the data correctly but ...
0
votes
0answers
13 views

Magento2: How to get clicked page number on pagination

My pagination is working fine. But in ajax I only want to get page number which is clicked. For example I have products on 10 pages. When I click on page 2 it alert only 2, when click page 3 it alert ...
0
votes
0answers
19 views

check all check boxes with just one click

I have one check box on the top of the page. scenario: I want to check all checkboxes on each line by just clicking that top check box and uncheck all the checkboxes on each line by unchecking that ...
0
votes
0answers
27 views

Display checked radio button custom option value in product detail page Magento2

Below are custom option of Radio Button Type. How to Display <span> value under the <label> when customer checked Radio button using Jquery? Here All class are dynamic. Example: As per the ...
0
votes
0answers
23 views

Replace <div> of page with <div> comes from $.ajax response

Problem is written inside the success section. $.ajax({ url : 'path to file', dataType : 'json', type : 'POST', data: data, success : function(res) { // here I want ...
0
votes
0answers
21 views

jQuery is not defined in Checkout Magento 2.4.1

I'm in Checkout and sometimes I receive the following error: Uncaught TypeError: jQuery is not defined This error is thrown by file jquery-migrate.js in line 10 that contains this: jQuery....
0
votes
1answer
27 views

Magento 2.4.1: Uncaught Error: [object Object] at Object.<anonymous> (default.js:8474)

The error as the post title appears in the cart page. default.js is the bundle that I created with advanced JS bundling. You can see that this is where the error has originated from. When looking at ...
0
votes
1answer
17 views

Unable to select first value from dropdown in jquery

I populated the dropdown with the help of array. for example I have array with elements (ali,abid,naqvi). Problem..... when I clear the cache and reload the page. and first time I am unable to select ...
0
votes
2answers
30 views

Magento 2 custom module jQuery loading issue

My custom module: app\code\Zero\my_module\view\frontend\web\js\changezipcode.js define(['jquery'], function ($) { 'use strict'; $(document).ready(function() { $('#form'...
0
votes
0answers
13 views

Show a loading icon until the page loads on Magento 2.3.6?

I'm new to Magento 2 site. I'm running a site on 4 GB ram and 1 CPU processor. So the site is loading slow. And users are trying to click before it loads completely. I want to show a loading image ...
0
votes
0answers
12 views

Customisation create one array and in that array add all check boxes option ids Magento ver. 2.3.2

How to create one function in magento 2 and every customisation create one array and in that array add all check boxes option ids.
0
votes
0answers
29 views

Magento2.4: Checkout Page loading issue

when I login into the checkout page after login checkout page not loading only loader loads. in console Getting this error: Uncaught Error: Syntax error, unrecognized expression: a[href=#shipping]
0
votes
1answer
47 views

Magento 2 - include JS library without Require.JS

I'm trying to include the jsPDF library in my Magento 2 like this: <script type="text/javascript" src="<?php echo $this->getViewFileUrl("Vendor_Module::js/jsPDF.js");...
0
votes
0answers
16 views

jQuery (server side) search and sort using Ajax

I tried to create search and sort from live URL using Ajax , i used do search function and i managed to retrieve the data from the URL . I am showing Ajax response in select options as below code. I ...
0
votes
1answer
16 views

Magento 2 get country Id when on change in estimate shipping on cart page

Due to some custom requirement on cart page, I need country id when someone change it using jquery. I have tried with below jquery script but its not working. <script> require(['jquery', '...
0
votes
3answers
35 views

Magento 2 How to combine custom module JS in one JS file?

I have multiple modules installed on my website, all modules have scripts in phtml file. I need to move that all scripts into one JS file so it can reduce the page size and merged them as a JS file. I ...
0
votes
0answers
10 views

jQuery must click twice

I have moved my Yotpo reviews on the product page to be shown in the tabs. Everything works but i have to click twice on the star rating to open my review tab. I should only click once for the tab to ...
0
votes
0answers
30 views

How to check all elements of first array with single element of second array one by one using jquery

Like I have two arrays and I wan't to disable value from drop down which are greater then single element of array. ['5', '10', '15', '20', '25', '30'] // dropdown ['10', '15', '20'] // second array ...
0
votes
1answer
49 views

How to add append jquery function in magento

in my case I want to add the 'div1' class to the 'div2' class but I don't really know how to do it. I tested a code but after the else part, the code doesn't execute (just the append method not other ...
1
vote
1answer
50 views

how to add jquery on magento 2

I am using Magento 2, in my case I want to add an element after another using jQuery, can anyway tell me how to it, the best practice please For example i want to insert a div with class 'one' after ...
0
votes
0answers
8 views

Create a Multidimension array and convert this in JSON format

I want to create JSON data to pass in AJAX. I'll pass the dynamic value of country & postcode in the below JSON. Let me know how to perform this task. Required data to pass in JSON {"address&...
0
votes
1answer
77 views

Calling a JS function from a widget from a different widget?

How can I call giveAlert() function that's in newsletter.js from within landingpage.js? landingpage.js define([ "jquery", "Ignite_Orgbf/js/js.cookie", "...
0
votes
0answers
27 views

Three is not defined in Magento 2

new THREE.WEBGLRENDER Three is not defined when i'm using it in Magento 2 with requirejs . THREERENDERER = new THREE.WebGLRenderer({ context: spec.GL, canvas: spec.canvasElement });</quo you can ...
0
votes
1answer
187 views

Magento 2- How remove js files

I am trying to remove some js files from Magento 2 upload in the frontend. This is my code but it doesn't work because when reload category page and i open sources->coverage of chrome i see ever ...
1
vote
0answers
19 views

How can I get my custom modal to work in with my js

This is a fiddle I have with it working but I would not like to apply it within magento http://jsfiddle.net/7yhmkf98/ I have a requirejs-comfig.js file set uo like this var config = { paths: { ...
0
votes
1answer
22 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
1answer
53 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
26 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/...
2
votes
0answers
88 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"> <...
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
60 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['...
1
vote
1answer
275 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 ...
0
votes
2answers
25 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=&...
1
vote
1answer
505 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
0answers
13 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
30 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 ...

1
2 3 4 5
16