Skip to main content

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
1 vote
1 answer
25 views

Magento 2 - How can I redirect user to PDP on click of product card without using anchor tag

I need to redirect user to PDP page from PLP page not just on click of image or product name, but on click of whole card. As per w3 standards I can not write div within anchor otherwise I would have ...
Sejal Shah's user avatar
  • 2,153
0 votes
0 answers
33 views

owl carousel not positioning rightly moving part of left side to right

owl carousel container not positioning centrally moving 10 px left side part to right or showing part of left on the right side <div class="carousel-section relative w-full"> <...
Muhammad Hossain's user avatar
0 votes
1 answer
31 views

TypeError: Cannot read properties of undefined (reading 'isLoggedInBolt')

I have upgraded from Magento 2.4.6 to version 2.4.6-p6. Then I'm having troubles when shopping with my store (at the checkout instance), as it does not return the payment methods enabled in the ...
zer0day's user avatar
0 votes
0 answers
24 views

How to use Magento's built-in Cookie Restriction Mode with PWA Studio?

I'm new on PWA Studio and I'm trying to enable the Cookie Restrition Mode. I followed this documentation: https://docs.magento.com/user-guide/v2.3/stores/compliance-cookie-restriction-mode.html But it ...
Berg_Durden's user avatar
1 vote
3 answers
89 views

Javascript broke after migrating the Shop to a new server

I recently migrated a shop from a server to another. The admin site works fine. The javascript of the shop itself is broken, and the console filled with these error messages that I previously did not ...
prgrm's user avatar
  • 61
1 vote
1 answer
78 views

Magento 2.4.7 3rd party scrpit is not working on checkout page

Error Screenshot: https://prnt.sc/evsXGmA4rOdW <?php $googlehelper = $this->helper('Module\Extension\Helper\Data'); $isenabled = $googlehelper->isEnabled(); if($isenabled) : ...
Magecomp Product Team's user avatar
0 votes
1 answer
19 views

Magento 2 : Integrate Javascript based Payment Gateway

I have a requirement for payment gateway integration. The payment gateway is completely built with javascript (example : Izipay [https://developers.izipay.pe/web-core/]). So how can I integrate such ...
shankar boss's user avatar
  • 1,453
0 votes
2 answers
76 views

Hyva products category "load more products" via fetch javascript init problem

There is the standard way to implement "load more products" via ajax request the next page and append the needed part of the html code to listing. There is the problem with js init also, the ...
Max.A's user avatar
  • 107
0 votes
0 answers
8 views

how to customise sorter.phtml in magento2?

i need to customise the magento2 component sorter.phtml so that it displays all available options in a list (instead of a select element) and each element in the list has its own asc and desc arrows. ...
media.queeries's user avatar
0 votes
1 answer
34 views

Magetno 2 how to send the request of place order when user checked on the check box of terms and condtion

I have changed the checkout process into 4 steps Adress Shipping Payment methods and agreement Summary and place order button everything is working fine accept the terms and condition. I have put ...
Harris's user avatar
  • 1
0 votes
0 answers
59 views

Call this._super() from anonymous function in js mixin

I have made a mixin for the minicart. I want to execute an async call before the parent function should be called. However it doesn't seem possible to call this._super() from an anonymous function. I ...
jrswgtr's user avatar
  • 63
0 votes
0 answers
31 views

Magento 2 - All admin grid keeps loading

In my Magento 2.4.1, all the admin grid just keeps loading. No data is rendering. Showing a js error in console but I don't understand what's wrong. If anyone ever faced this please let me know what's ...
Nayem323's user avatar
  • 771
0 votes
0 answers
27 views

How do I upload an image in Magento

How do I upload an image in Magento ? Magento ver. 1.9.3.4 I tried to upload a picture but the system does not accept it.
user115304's user avatar
0 votes
0 answers
15 views

in magento2 wholesale account creation form in email field add customer group validation

i want to add validation for email field in wholesale account creation form that the same email id which is used for retailer account can also be used for wholesale account so basically i want to add ...
ashish's user avatar
  • 3
0 votes
0 answers
16 views

Magento 2 - Get qty from ajax response add to cart post parameters

When click in add to cart button in view page product, with ajax response get in checkout/cart/add the qty added, i need this qty value for datalayer push in phtml, i tried getAddToCartPostParams ...
Diego Castro's user avatar
0 votes
1 answer
33 views

.css and .js files only loading when refreshing page after deploy

Whenever I'm deploying updates on our Magento 2 live environment, I run into the issue that on first page load, the .min.css files and sometimes the .js/.min.js files aren't loading (the browser runs ...
Pascal F's user avatar
0 votes
2 answers
57 views

Ui component validation remove using js magento2

I have a fieldset in my UI component. Depending on certain conditions, I show/hide fields within it. All fields are initially marked as required in the UI component. However, I want to remove the '...
Chippy Ani's user avatar
0 votes
0 answers
22 views

Magento 2 admin page menu and buttons didnt work after speed optimization

After we enable javascript bundling and minify javascript files, admin left menu and buttons didnt work. Also in our website we could add products to the basket. Thank you for your help.
Mabita's user avatar
  • 1
0 votes
0 answers
9 views

In magento, how can we bring the swatch options of a configurable product and it's corresponding image url's in an array?

I need to bring the swatch options of a configurable product and its corresponding image url's stored in an array in PLP page in magento. How can I do that? I got an empty image url array while trying....
Farseen's user avatar
0 votes
1 answer
126 views

Magento2 | Reduce JS files to optimize site performance

I am trying to figure out how I can exclude some js files that Magento2 loads and makes it so heavy however without compromising the functionality of the site. On my site with Magento2 I have a lot of ...
Jackom's user avatar
  • 493
0 votes
0 answers
11 views

XML formatting problem: Aligning 'Options' at the same level as 'Lines' instead of nested within

I am working on a Node script that creates an XML file using data it has pulled from the Magento api. This xml file has a set structure that I have to replicate. I've been having issues getting it set ...
atomic-ag's user avatar
0 votes
0 answers
22 views

Magento2 how to load payment page withot loading the page.?

Magento2 how to load the payment page without loading the page.? I want to refresh my payment page without loading into the js file. can anyone give a solution for this? Here is my js file with some ...
Ekta's user avatar
  • 101
1 vote
2 answers
492 views

Hide DIV if another DIV is active or visible with css/js

Trying to hide DIV if another DIV is active or visible with css/js. Basically if an item is out of stock I would like to hide my custom div. <script type="text/javascript"> require(['...
Shaun's user avatar
  • 109
0 votes
1 answer
64 views

how to remove js files from layout added to page through require or direct src

i want to remove js files from a layout checkout_index_index which is loading by require or direct src. 1) <script src="https://abc.abc.ai/prompt.js" src_type="url" /> ...
nihal malik's user avatar
1 vote
3 answers
415 views

Magento 2 Google language translate script not working

The script was functional on our Magento 2 website until last week. However, for the past four days, we've been encountering JavaScript and Knockout.js errors in the console when this script is active....
Keval Chauhan's user avatar
1 vote
1 answer
61 views

How to retain line breaks when reading text from within <td></td>

With the jQuery below, I'm able to copy the content into clipboard but not to retain the line breaks. HTML: <td width="700" id="message_id2"> We are sorry you are ...
CodeForGood's user avatar
0 votes
0 answers
26 views

how to fix magento runs in the wrong js path

I'm having a problem: my js line is correct but when running, Magento runs incorrectly. Does anyone know how to fix it?
hau's user avatar
  • 41
0 votes
1 answer
87 views

Unable to resolve the source file for

When I run it, the system log shows the message Unable to resolve the source file for, but when I check the path of the js files, Magento runs at the wrong path. Does anyone know how to fix this error?...
hau's user avatar
  • 41
0 votes
0 answers
23 views

Magento 2: How to separate this plugin into 2 different fields

I have import this plugin in my project https://github.com/MaxMage/international-telephone-input. Now I split into 1 field dial_code, 1 field phone but when i choose dial_code and click outside. The ...
Simon's user avatar
  • 1
0 votes
1 answer
47 views

Create an extension using Javascript

I am new to Magento development and finding the process a little overwhelming. I am a Javascript developer without any PHP experience. To help me get started I decided to Vue Storefront's SDKs (using ...
Charklewis's user avatar
0 votes
1 answer
54 views

Why is a piece of code closed but still processed by Google?

When I close this code, why does it still load the code and cause an error when running?
hau's user avatar
  • 41
0 votes
1 answer
45 views

error message error when running

Why do I still get an error message when I run these js files at the correct path?
hau's user avatar
  • 41
0 votes
1 answer
61 views

How to prevent user sending requests frequently?

I believe it can be done with a PHP controller or JS cookie manipulation. Help me with logic. For example, I want a user to send a request once every 2 minutes. Let's pretend I've implemented some ...
Dramorian's user avatar
0 votes
1 answer
239 views

Magento 2 - Minify CSS and JS in pub/static folder not updating in browser

I have activated the minify and merged option for the CSS and JS files for better site performance, but recently I have had problems, after deploying and cleaning cache in both varnish and the ...
Diego Castro's user avatar
1 vote
1 answer
77 views

Add Custom JavaScript to Admin Theme

Using Magento 2.4. I want to add some custom JS in the admin area. app\code\ClientQuote\AdminTheme\view\adminhtml\requirejs-config.js var config = { map: { '*': { adminTheme: '...
xgarb's user avatar
  • 11
0 votes
2 answers
208 views

Magento 2.4.6: How to display Order IDs Based on Selected Customers in a UI Form?

I've created a UI component form that consists of two dropdown fields. The first dropdown successfully displays customer IDs and names. However, I'm encountering challenges with the second dropdown, ...
MagentoDev's user avatar
0 votes
0 answers
34 views

Add Javascript to a Single Custom Admin Configuration Page in Magento 2.4 with XML

I am developing a custom module and need to load a javascript function on my "Custom" admin configuration page created with system.xml at url "admin/system_config/edit/section/<...
Fox's user avatar
  • 211
0 votes
3 answers
314 views

After installing Magento2.4.6-p2 CSS and JS 404 not found

I installed magento2.4.6-p2 in my C:\xampp\htdocs\magento2. But I can see this. In pub .htaccess file is : ############################################ ## Optional override of deployment mode. We ...
Bohdan V.'s user avatar
0 votes
0 answers
73 views

Update selector field in Magento 2

I have a form with the following 2 fields in an xml file: Regions: <field formElement="select" name="regions" > <argument name="data" xsi:type="array&...
user113186's user avatar
0 votes
0 answers
61 views

Radio Button Will only reflect after two clicks

We are using an RMA module which let the customer select a new return for their purchased item. When clicking on the item radio to select an item it should bring up the entire information on the ...
Ran's user avatar
  • 1
1 vote
0 answers
259 views

Bad control character in string literal in JSON at position 40 Fresh installation Magento 2

I install fresh new Magento on my environment Magento version 2.4.6-p1 in the admin panel loader not gone it's take only loading. can any one guide on the same.
Jay Parmar's user avatar
1 vote
0 answers
93 views

totals.getSegment('giftcardaccount') returning null

I'm about at my whits end. I still consider myself a relative novice with Magento, but this one literally has me baffled. I've also tossed it around to some senior devs at my work, and they are ...
Drew's user avatar
  • 141
0 votes
1 answer
54 views

Show simple products URL in bundle summary

We want to make product name clickable in bundle summary. When user click on product it should be redirected to simple product page. Anyone knows if it possible?
Petacchi's user avatar
0 votes
3 answers
945 views

In magento 2 javascript , How i can wait till a component/node initialize then i can excute my code?

How to wait till components exists in registry . I want to wait till global component "messages" initialize then I can add error/success message. // view/frontend/templates/messages.phtml &...
Phạm Hòa's user avatar
1 vote
0 answers
49 views

Add Custom Field to Braintree Credit Card Payment Method in Magento 2.4

I want to add the custom field i.e. po_number in the braintree credit card method in the payment page. Here is the code which I have added for field. <?xml version="1.0"?> <page ...
Mitul Vadalia's user avatar
0 votes
1 answer
275 views

Admin not loading - JS errors

Suddenly my Magento 2.4.6 started to show a JS issue without any deployment. I had this issue below with the JavaScript loading. How could I solve it?
Rafael Corrêa Gomes's user avatar
0 votes
2 answers
156 views

How to exclude custom extension JS : Magento 2.4

I want to exclude some custom extension JS from merge functionality. so how can i achieve this functionality?
Kushal Dani's user avatar
  • 2,134
0 votes
1 answer
571 views

Magento 2 - Get cart item qty change in Javascript

I have a javascript file that loads when the page loads. This file defines two variables (one for the shopping cart items and one for the count). This script also contains a subscribe that fires ...
JamesS's user avatar
  • 101
0 votes
2 answers
543 views

Magento 2 - Get location of view model of knockoutjs .html template

For example, how can I find out where the model / view model for this template is located at? vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html
Black's user avatar
  • 3,390
0 votes
1 answer
65 views

Magento2 How to translate City names in the Arabic language

How to translate City names in the Arabic language. here is the screenshot. https://i.imgur.com/2UVdzrJ.png I can not translate city names on my account page.
Ekta's user avatar
  • 101

1
2 3 4 5
48