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
votes
1answer
20 views

admin area getting error 'require is not a function at editor.js:6' after upgrading magento 2 from 2.1.1 to 2.1.17

After upgrading Magento from version 2.1.1 to 2.1.17, I am facing this error Uncaught TypeError: require is not a function at editor.js:6 across admin area especially in edit pages when I look ...
1
vote
1answer
22 views

How to pass array value in url

Array :- foreach ($relatedProducts as $relatedProduct) { $_product = $objectManager->create('Magento\Catalog\Model\Product')->load($relatedProduct->getId()); $skus = $...
3
votes
0answers
26 views

Magento2: Local-Storage Mage-Storage and Mage-Cache Empty on every Reload

Many features in my web page break as when I investigated, I found out that many local storage keys don't even exist now which used to exist before. list of keys that don't exist: lo_session mage-...
5
votes
0answers
32 views

Magento2.3: Display Custom text on Shipping Address

I would like to add custom text whenever shipping country is Sweden, Ive created Magento_Checkout module in my custom theme and added a phtml file <div class="free-shipping-info" data-bind="...
0
votes
0answers
10 views

Magento 2: Failed to load resource: the server responded with a status of 404 (Not Found)

I am trying to override magento 2 core js ' require-config.js file at path Test/JsOverride/view/frontend/ var config = { "map": { "*": { "menu": "...
1
vote
1answer
28 views

Custom javascript is not loading through requirejs-config

I've been trying to add a custom script to my Magento stores, however I can't get it to load. I've created the js file in my web/js folder in my theme, and added it to the theme's requirejs file. It ...
0
votes
1answer
21 views

Why We Use RequireJS on Magento 2

Please tell me why we use requirejs and require-configjs files and purpose of these two files on magento 2.Complete Details if Possible.
0
votes
0answers
10 views

Why is guest customer billing information NULL - Magento 2 checkout and quote?

I'm trying to get guest customer billing information during the checkout session as I need to save it to the quote before redirecting to placeOrder but the billing information is always null. How do ...
2
votes
0answers
54 views

How to translate “ This is a required ” in Magento 2

I want translate error message required field like this I used de_DE.csv but the get fields from data it does not translate, please help me! Thanks all
0
votes
1answer
17 views

How to fix blank Minicart popup in custom navbar for Magento 2

I am creating a custom theme from the parent theme Luma. I've added this code to Magento_Theme/layout/default.xml to include the minicart. <block class="Magento\Checkout\Block\Cart\Sidebar" name="...
0
votes
2answers
29 views

menu.js:1 Uncaught TypeError: require is not a function

I am trying to add a jquery script to my site. I have updated the require-config so it has this- var config = { paths: { slick: 'js/slick.min', slaask: 'js/customscript', menu: 'js/menu....
0
votes
1answer
23 views

M2 Modal Widget - Variable for Link, Title, and Content

I want to have links that activate a modal window with dynamic content and title. I would assume there is a way to do this with variables. I can do it now as a separate script for each modal, but is ...
0
votes
0answers
17 views

Social login popup on custom url

We have installed Mageplaza social login popup(https://github.com/mageplaza/magento-2-social-login). The extension opens the popup when clicked on "Signup/Login" button on the home page. We need a ...
0
votes
0answers
31 views

Magento 2.3.1 not allowing javascript code

I am setting up my store on latest Magento 2.3.1 CE edition. Apache version: Apache/2.4.39 PHP version: 7.2.18 MySQL version: 10.1.40-MariaDB. Also I am using Porto theme. There is a strange ...
0
votes
0answers
25 views

How to send a javascript variable to a PHP file in Magento project?

I have this file that contains a javascript variable: src/app/design/adminhtml/default/default/template/smv/order/sales/creditmemo/refund.phtml <p> <select name="creditmemo[reason]"> ...
0
votes
2answers
18 views

Magento2.3.0 :When merge and minify js and css after set production mode not working my admin panel and frontend css lacking

I am using Magento2.3.0 community version When merge and minify js and css after set production mode not working my admin panel and front end css lacking if any one know what is actual issue reply me ...
1
vote
0answers
13 views

React Router Breadcrumbs use page titles instead of url dynamically

I've got a magento 2.3.1 site with venia storefront a react front end and I'm trying to get the breadcrumbs to pull the page titles dynamically rather than pulling the url. My current code for the ...
0
votes
1answer
22 views

How to override or extend proceed-to-checkout.js

I need to override or extend Magento's proceed-to-checkout.js file in my module. app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js In my modules requirejs-config.js I have tried ...
0
votes
1answer
31 views

Magento 2 - Extend onepage.phtml to add custom JS

Magento 2 I have created a custom shipping method module and need to add custom JS to the checkout page where the shipping address and shipping method is set. But it is not working for me. I have ...
0
votes
0answers
44 views

Magento 2.3: How To Initialize Js…?

I'm new to Magento 2.3, I was trying to apply jQuery DataTable and it's done, after that, I want to add it's Button Extention, for that i need to add two more js,so i initialize it, now i'm getting ...
1
vote
2answers
73 views

Magento 2: jQuery Datatables Button Extentions Not Working

============================UPDATED 1.1============================ I'm new to Magento 2.3, I'm trying to apply jQuery DataTable(DONE), after than, I want to add it's Button Extension, for that i ...
3
votes
0answers
57 views

Magento 2.3.1 CE Tinymce Error

We have upgraded Magento from 2.2.3 CE to 2.3.1 CE successfully. But we are facing few issues with the Tinymce js from admin end product edit page and cms pages etc.. when using Show/Hide Editor.. ...
0
votes
0answers
49 views

Magento 2.2 - Uncaught TypeError: this.modal.zIndex is not a function

Am using Venus need theme, on mini cart's delete click and Checkout's Already have an account? Click here to login throws this issue. Uncaught TypeError: this.modal.zIndex is not a function modal....
0
votes
0answers
22 views

Error displaying the product name in magento 1.x

I'm having an error displaying the product name. if it is "dog" English then it will appear in the frontend. If it is Vietnamese "dog" it will not display. I am doing it in js file. Other products ...
1
vote
1answer
20 views

Magento 2. Describe different types and uses of JavaScript modules. Which JavaScript modules are suited for which tasks?

Describe different types and uses of JavaScript modules. Which JavaScript modules are suited for which tasks? This is a question for the certification study guide. I know it's kind broad, but still ...
0
votes
1answer
31 views

Magento 2 | VueJs Framework

Is there a way to use VueJs Framework under Magento 2 ?
0
votes
1answer
30 views

JS issue with Magento 1.9.4.1 Adminhtml

We recently upgraded our magento 1.8.1 install to 1.9.4.1, we also changed our php version from 5.6.4 to 7.2 However we are now getting an error when looking at the product page Uncaught DOMExeption:...
0
votes
0answers
13 views

Magento2 How do I see the raw files, I'm just on the admin

I'm very new to this, I'm doing this for a client. I see there is a content section where I can edit the blocks. I suppose I can edit the custom js to add a javascript file to call my API. I'm try to ...
0
votes
0answers
16 views

Magento 2 Assign customer group name to externally calling JavaScript file variable

PreRequisites: MageVersion - Magento 2.3.x External JavaScript - http://domain.com/external-js.js var mage_customer_group = ''; //other code related to the customer group Pages - Category page and ...
1
vote
0answers
41 views

Magento2.3 : How do I programmatically submit a form generated via a UIComponent?

I created a UI Component form, but I am unable to find the element in the source. I would like to click a button and then inspect a field in the form and dependent on what value is selected submit ...
0
votes
1answer
28 views

how to add js in custom form in backend magento 2

I have used this code in my form to manage the field id_pdt that is a foreign key so i will put a text from bar code and then search in mu custom table to find if the sku exists in table product and ...
1
vote
1answer
30 views

How to add 3rd party js library to Magento 2

I am trying to install the following slider to my own Module https://owlcarousel2.github.io/OwlCarousel2/demos/demos.html. But unfortunately, Magento has its own complicated mechanism to manage its ...
0
votes
1answer
29 views

Add onclick function to input

I want to add a js function to an input field located in a phtml page on my magento 2 I have write my function like below: <script> function qtyzn() { ..... }...
2
votes
1answer
41 views

Overriding function from the modal.js file

How can I override a function from the modal.js file in the path vendor/magento/module-ui/view/base/web/js/modal/modal.js ? In this file, line 307, is a function with name closeModal() that I want to ...
0
votes
0answers
29 views

Magento2 add js custom conversion tracking on thank you page on first time load

I'm editing a client's site and I need to add custom javascript for our purchase tracking, on a success or thank you page. Oh shopify we put it on the checkout input box custom script input window ...
1
vote
0answers
14 views

UI Components - pass ids selection to listing selection

How do i pass a selection of ids to an insert-listing component to preselect certain rows. I have a dynamic rows component with entries related to the current product I'm editing. When click on a ...
1
vote
0answers
17 views

Failed to load JS and other support files while trying to checkout

I am trying to add a product in cart and check out the product, page still loading and it shown error message. enter image description here
2
votes
0answers
22 views

How to pass variable value from phtml JS to block.php?

I have a phtml (system.phtml) with <script> in it and a variable like console.log(data). <?php $checkcustomer = $block->Customerlogin(); ?> <script src="https://d3js.org/d3.v3.min....
2
votes
2answers
27 views

Magento2 : I am getting this error when i upload two custom module and css and js file

I am getting this error on my live site as production mode and I uploaded only two custom module and js and css and two overwrite file in our theme.Below share error as warning showing I apply all ...
2
votes
3answers
33 views

Magento bad execution on js and css

i have a issue when a try to access to my Magento Admin Panel and frontend default page. the admin panel always shows epmty And the frontend default page show content but without CSS and JS: how to ...
0
votes
1answer
20 views

How can active accordion tab on click

I want to active an accordion tab on button click with activate() method https://devdocs.magento.com/guides/v2.1/javascript-dev-guide/widgets/widget_tabs.html#fedg_tabs_methods-activate This is my ...
7
votes
3answers
268 views

Magento 2 Advanced Js Bundling

Can any one worked on Advanced JS Bundling? We would like to apply this concept to one of our client projects. Could you please explain about Advanced JavaScript bundling in detailed step by step &...
1
vote
0answers
12 views

Backend listing grid view page not opening order listing cms page & block listing etc

Backend listing grid view page not opening order listing cms page & block listing etc.. Admin panel not able to load multiselect.html, text.html, html.html, actions.html and js file as per console ...
1
vote
0answers
15 views

cms pages and block is not loading in backend

CMS pages and blocks won't load in the backend. It keeps loading and loading without not showing any pages or blocks. I reindex, compile, clear cache... But nothing changed. Any help would be much ...
1
vote
0answers
21 views

Add multiple products to cart using product ids

I am trying to add multiple products to my cart. I have product ids in the form of $productIds = implode(',', array_column($points, 'productId')); which gives me numeric product ids like this : 5330,...
1
vote
2answers
54 views

MagenImage Upload File Extention JS Validation?

I'm new to Magento 2.3, i want to validate file upload field. Allowed file formats: jpeg. I put a method in lib\web\mage\validation.js require([ 'jquery', 'jquery/ui', '...
0
votes
0answers
24 views

Magento 2 + NGINX + REDIS + VARNISH + SSL Changing to Developer mode

in Production Mode everything is fine. When i change to Developer Mode i have this Problem because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is ...
0
votes
0answers
21 views

Language and currency switcher js error

Added language and currency switcher to template using this below layout. <block class="Magento\Framework\View\Element\Template" name="store.settings" group="navigation-sections" template="...
1
vote
1answer
61 views

Magento 2 custom module set the css and js file using the check the particular product attribute is enable or not

I have a custom module.I want to the add the css and js file if my custom product attribute value is available. In xml I can't check product attribute value is available or not. so what i do? ...
2
votes
3answers
110 views

How to hide fields with toggle checkbox in ui_component Magento 2

I have a toggle checkbox at product edit form: Created as: <field name="open_amount" formElement="checkbox"> <argument name="data" xsi:type="array"> &...