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.
2,374 questions
0
votes
0
answers
28
views
Magento 2.4.8 Uncaught Error: cannot call methods on collapsible prior to initialization; attempted to call method 'forceDeactivate'
I am facing following error on live site magento 2
Today I found that issue with Amasty request quote extension
Magento 2.4.8 Uncaught Error: cannot call methods on collapsible prior to initialization;...
0
votes
1
answer
117
views
How to disable options in a Magento 2 custom select field without using setTimeout?
I have a custom select field in my Magento 2 form and I'm loading options dynamically. The goal is to disable specific options based on a condition (option.is_disabled). The current implementation ...
0
votes
0
answers
79
views
Magento stuck on debugger while using dev-tools
Magento website getting stuck because of automatically debugger is triggering in dev-tools.
I tried using different browsers still it's happening.
Using Magento V2.4.5
(function anonymous(
) {
...
0
votes
0
answers
32
views
How to move field on onestepcheckout to another fieldset that is not there by default?
There is a onestepcheckout that is being processed by two modules.
One has most of the wrappers and templates, and another one is responsible for shipping (specific courier company for a country). ...
0
votes
2
answers
350
views
Magento secureRenderer not producing nonce
With this test code
<?= /* noEscape */ $secureRenderer->renderTag('script', ['id' => 'testjs'], 'var thisisatest=0;', false ); ?>
I'd expect Magento to output a script tag similar to
&...
0
votes
0
answers
80
views
Magento 2: Pass custom product attribute to a custom javascript file
I am currently struggling with accessing a custom product attribute (zshortname), which is defined in magento admin panel, in my custom javascript file and send it to google tag manager over dataLayer....
0
votes
1
answer
139
views
How to upgrade jQuery version from 1.12.4 to 3.7.1 in Magento 2.4?
We are using Magento 2.4.2-p2, and the current jQuery version is 1.12.4. We want to upgrade it to version 3.7.1.
Here’s what I’ve tried so far:
Options 1 - Added the following in default_head_blocks....
0
votes
1
answer
84
views
How to resolve issue in admin configuration right side tabs not able to open
How to resolve the issue in Magento 2.4.7-p3 version admin grid is not able to open.
While you are in developer mode and go to store -> configuration-> and open any left tab and now open child ...
0
votes
1
answer
70
views
Magento2.4.7: How to get checkout error messages?
let's assume I want to run a function when I click on place order.
I'm doing some functionality on the Place Order button click, but my functionality still works if there's an error.
Is there a class ...
0
votes
2
answers
219
views
Owl carousel show double image in responsive settings items:1 in mobile
Owl carousel show double image in responsive settings items:1 in mobile
<div class="owl-carousel owl-theme pt-16 xxl:pt-20 h-full" id="carousel8">
<div class="...
0
votes
1
answer
67
views
Add to cart without leaving the page
we have the default add to cart button, that when we click it, it goes to the cart page.
I would like to put a add to cart button on the product card, that doesnt leave the page so the client can ...
0
votes
1
answer
75
views
How to scrap image from Magento script type="text/x-magento-init"
I'm using simple_html_dom.php function to scrap data to specific Magento site. I am able to scrap all of the things but can't able to find additional images which are comes from script type="text/...
1
vote
1
answer
98
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 ...
1
vote
3
answers
307
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 ...
0
votes
1
answer
28
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 ...
0
votes
1
answer
95
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 ...
0
votes
0
answers
28
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 ...
0
votes
2
answers
275
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 '...
1
vote
2
answers
1k
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(['...
1
vote
3
answers
512
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....
0
votes
0
answers
34
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?
0
votes
1
answer
81
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 ...
0
votes
1
answer
59
views
error message error when running
Why do I still get an error message when I run these js files at the correct path?
1
vote
1
answer
476
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 ...
0
votes
2
answers
278
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, ...