Questions tagged [javascript]

JavaScript (JS) is a client side script language which allows to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed. By default Magento 1 comes with the prototype.js library and Magento 2 comes with jQuery. Use 'prototype-js' and 'jquery' tags for questions about those libraries.

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

datetimepicker is not a function?

After installing the module https://github.com/ecomteck/module-delivery-date on magento2, the input field is displayed without date selection. The console shows an error: knockout.js: 3381 Uncaught ...
0
votes
1answer
24 views

Why do I see the wrong static files path in my JS?

After installing and deploying the static files, Magento is looking for: http://127.0.0.1/magento2/static/adminhtml/Magento/backend/en_US/requirejs/require.js instead of: http://127.0.0.1/magento2/pub/...
0
votes
2answers
39 views

How to add an input field with a date to the checkout page?

I'm studying Magento2, downloaded the module https://github.com/ecomteck/module-delivery-date and added it to the app / code / vendor / module-delivery-date folder I cannot understand in which files ...
0
votes
1answer
25 views

override javascript from module

I want to override file from module. vendor/mageworx/module-storelocator/view/frontend/web/js/locations-modal.js I create file app/design/frontend/Mgs/claue_child/MageWorx_StoreLocator/web/js/...
0
votes
0answers
17 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
27 views

magento2: View model knockout

I am new in magento module development. I was searching for something similar to this https://www.mageplaza.com/devdocs/how-add-custom-discount-magento-2.html I just editied the code in step 2 to meet ...
0
votes
0answers
13 views

Magento2 - error when selecting dom elements on cms pages

I am working with an independent js file that I instantiate in an xD module and if I launch a console.log ("test") it appears in the console without problem, then a basic example of logic ...
0
votes
1answer
25 views

How to validate the Tax / VAT Number field depending on whether it is a European country or not

I have a question about how to make the Tax / VAT Number field validate depending on the selected country in the the registration page and the configuration page. Is there a way to do it in the admin ...
0
votes
1answer
33 views

Magento 2.4 add Read More in the Product Description

I want to add "Read More" button in the product description. I use this code: <div class="value more" <?php /* @escapeNotVerified */ echo $_attributeAddAttribute; ?> > ...
0
votes
1answer
19 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
0answers
18 views

Magento 2 - Change shipping price amount when access payment page on checkout not working

I want to change or update the shipping price when I access the payment page on checkout. I have try event sales_quote_address_collect_totals_before and sales_quote_collect_totals_before, shipping ...
0
votes
0answers
11 views

refresh Shipping Method's block on checkout page Magento 2

We have a custom checkout field called the city where we have multiples cities. Now I want that when customers select/ change any city, refresh the shipping method block. Same as when we add/change ...
0
votes
0answers
38 views

Create popup with an attachment file on popup that will be saved in database

How to create popup on PDP page and in popup form, how to add attachment file that will save in database.
0
votes
0answers
12 views

JS file sometimes not loading

I use the Mageplaza Owl Carousel. I haven't changed anything, but it doesn't always load, and I get a console error saying owlCarousel is not a function. Other times it loads as expected. I've cleared ...
0
votes
1answer
24 views

Magento2 > how to remove some JS

I would like to remove these JS from my M2: range.js colorpicker.js datepicker.js tooltip.js polyfill.js decorate.js Would someone know how to achieve that ? Thanks. Jack
0
votes
0answers
12 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
1answer
22 views

How to get prices on category and product page via ajax

I am using the mageworx customer special price module. But it messes up my cache by adding a unique user id to the cache generation. How can I hide prices and add them on load using ajax?
0
votes
0answers
10 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
47 views

How to create this type of popup in magento 2.4.?

add one button on PDP page like "Add comment" if click on that button popup should be open with textarea that user can insert comment user should be logged in then this button should be ...
0
votes
1answer
10 views

When adding item to cart minicart doesnt show the subtotal

When I'm adding an item to the cart from product page it doesn't show the subtotal in minicart but when I reload the page it does. How to fix that? Here is the link.
0
votes
0answers
7 views

Magento 2 product page , Safari mobile view only JS Issue

I'm having a weird issue on my magento 2 website on product page only on safari mobile view! when I add any js file as follows in global-footer-js.phtml (this phtml I call in default.xml as it should ...
0
votes
0answers
22 views

Change product page details for configurable products

I have these configurable poducts with a single option wich changes just an attribute and maybe the price, but of course the tabs like details, reviews and another custom tab I made does not change ...
0
votes
1answer
51 views

Datepicker not working in Magento 2.4 frontend

I am trying to add datepicker in Magento 2.4 frontend checkout page. But its giving following error - knockout.js:3381 Uncaught TypeError: Unable to process binding "datepicker: function(){return ...
0
votes
1answer
16 views

customer/account and customer/address assistance. magento 2

I have scoured the git repository and my local copy, I am trying to find what files magento2 uses to create the edit section of the customer account dashboard for address. specifically for logged in ...
0
votes
1answer
37 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
14 views

Display custom options on category page and allow add to cart

I want to display product's custom option on listing page and want to allow customer to add to cart from the category listing page. I have added Qty field and following code to display the custom ...
1
vote
2answers
31 views

DIFFERENCE BETWEEN ONLINE AND OFFLINE SHIPPING METHOD

I am working on a custom Magento module. I am facing some issues to debug the code and one question that comes into my mind is that what is the difference between offline and online shipping method. ...
0
votes
0answers
8 views

Provider information for the shipping address in the order summary

I created a delivery module with a pickup service. I'm stuck with the shipping address displayed in the order summary. From where does the information come from? My issue happens only when I'm a guest ...
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
0answers
21 views

SET THE RIGHT DOMAIN NAME IN MAGENTO 2 COOKIES

I set cookies (in Magento 2.3.1 EE) with this code below: <script type="text/javascript"> require([ 'jquery', 'jquery/jquery.cookie' ], function ($) { $(document).ready(...
0
votes
1answer
17 views

Change position of elements/uiComponents in Magento 2 checkout depending on screen size

I have 2 html elements on my checkout for which I need to change the position on the page, depending on whether it's being displayed on mobile device or desktop. I cannot solve this using css only ...
0
votes
1answer
41 views

Global Payments Realex 511 Redirect Issue Magento 2.2.2 HPP

I am using this module for Global Payments / Realex Payments for Magento 2.2.2 store form Magento Marketplace "name" : "realexpayments/hpp", "description" : "A ...
0
votes
1answer
25 views

Script injection below body tag in Magento 2.4.1

I upgraded our Magento from 1.9 to 2.4.1 after we found malware that was trying copy customer credit cards before allowing the customer to use PayPal. I used Magento's migration tools to copy data to ...
0
votes
0answers
29 views

Magento 2.4 - Express Checkout - Shipping Address Error

A fresh install Magento 2.4.x + theme, but having some issue related to express checkout, as seen from below picture on red-box area. The form has missing some elements, like firstname, lastname etc. ...
0
votes
1answer
18 views

Magento 2.4 admin keep on infinite loading

I updated my magento from 2.1 to 2.4 . My admin panel keeps on loading since long. Below is error i see in console. Failed to load resource: the server responded with a status of 404 (Not Found) ...
0
votes
0answers
9 views

How to add a script to all product descriptions

How to create a js widget that will add the current date on the product page to the description on the <p id="lol"></p> element? Or which will insert a p tag with a date at the ...
0
votes
3answers
33 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
14 views

How to pass parameter from phtml template file to controller in Magento 2

I have created a custom module. It basically displays a popup modal that prompts user to enter their ship-to location. Below is my code: Learning\etc\module.xml <?xml version="1.0"?> &...
0
votes
0answers
10 views

how can I apply and clear a layered navigation filter via javascript in Magento 2.4?

I would like to create some quick filter buttons for layered navigation, for example to trigger popular filters like featured products, recommended etc. I would like to programmatically trigger the ...
2
votes
1answer
23 views

HTML files not being overwritten in app/Design

I'm trying to override html files the same way that I would override a phtml file, but it doesn't seem to be working. Same with Javascript. I'm trying to change some logic in minicart.js. I put my ...
1
vote
0answers
31 views

How to hide aria-required = “true” field by js in checkout magento 2

I add these fields using custom modules, so that when "Persoana Fizica" is clicked, these fields are hidden and will not affect the magento's data transmission. And when I click on "...
0
votes
1answer
27 views

How to add external JS script to product page in Magento 1.9?

I'm trying to add a JS Script for some specific products in the product detail page but I dont know how to. I know I can edit the xml file and add scripts there... but the source of the script ...
0
votes
0answers
21 views

How do i translate Javascript text?

I've been trying to translate the word "Open Now" that is written in my JavaScript like so $('.store__info_' + locationCode).text('Open Now'); I followed the dev docs here, to no avail. I'...
1
vote
1answer
67 views

Magento2 - including THREE.js in custom module

I'm using a 3D model object in my Magento (2.4.0) site for which I need to use three.js lib along with GLTFLoader and OrbitControls. GLTFLoader and OrbitControls are THREE.js dependents. I kept the ...
0
votes
0answers
28 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 ...
2
votes
3answers
391 views

Uncaught TypeError: Cannot read property 'remove' of undefined — upgrade from 2.3.4 to 2.4.1

Uncaught TypeError: Cannot read property 'remove' of undefined -- upgrade from 2.3.4 to 2.4.1 I'm testing out an upgrade of our Magento store from 2.3.4 to 2.4.1. One issue I have come across is this ...
0
votes
2answers
37 views

UK GB Post Code Zip Validation Magento 2 Space

I need some help with UK GB Post Code Zip Validation Magento 2 Space In that I want to force the user to enter spaces so its like this EC1A 1BB or W1A 0AX or M1 1AE so there must be space After the ...
1
vote
1answer
48 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
9 views

Adding (complex) 3rd Party JS to Module

I'd like to add a large/complex JS file to my module. It's this: https://github.com/google/open-location-code From what I can tell, it's not being added at all. /app/code/Abc/Pp/view/frontend/...
0
votes
0answers
126 views

Magento 2: Remove unused JS from home page

There are several unused JS files which we do not use on the homepage. JS files are: jquery/ui-modules/datepicker.js jquery/ui-modules/timepicker.js moment.js jquery/ui-modules/sortable.js jquery/...

1
2 3 4 5
44