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.

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 ...
1
vote
0answers
43 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 ...
1
vote
0answers
15 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
18 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
1
vote
0answers
13 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
16 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
22 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
0answers
21 views

magento 1 checkout page gives error “checkout is not defined” in console prototype.js::5598

i am using firecheckout for magento 1 checkout page gives error "checkout is not defined" in console prototype.js::5598. because of that error sometimes customers can not place order. can anyone help ...
1
vote
0answers
12 views

Uncaught ReferenceError: Mini is not defined at (index):993 - magento 2 store

How do i trace and fix this error for my magento 2 store? Uncaught ReferenceError: Mini is not defined at (index):993 i can not find the below code anywhere in my magento admin. it is not in header, ...
1
vote
0answers
43 views

Magento 2 Issue with JavaScript and CSS Merge

I have checked my site for speed and it was requesting 258 requests. I have merged all JavaScript and CSS files and again tested it but still 251 requests are there. While in view page source I can'...
1
vote
0answers
25 views

AJAX call returns the same page html

I have a module that I need to do a php GET action and get some informations from php file. The problem is that the returned value is the Dashboard html. Faturamento/Controller/Adminhtml/Ac/Index....
1
vote
0answers
37 views

How to select a shipping method if the default address is present in checkout page in Magento 2?

I need to select the first method rendering in the list as the default selected among the shipping methods in the checkout page for a customer whose default shipping address is pre-populated in the ...
1
vote
0answers
45 views

Show magento loader ajax

how can I show the loader only on my div and not on the body during an ajax call ? Can't make it work. Here's my code, I have the show loader and the context but I'm missing something ? <div id="...
1
vote
0answers
16 views

Magento2 : Fire body loader with text/x-magento-init

i have a custom block on my page, that calls javascript via text/x-magento-init and performs some operations so loader should be displayed untill that script will finish its operations. How can i fire ...
1
vote
0answers
65 views

Magento 2 - problem with mCustomscrollbar.js

Since few days i try to fix issue with my mCustomScrollbar plugin and i got stuck. First of all i i've got library with mCustomScrollbar.js and mousewheel.js in web/js/mCustomScrollbar and my ...
1
vote
0answers
18 views

how to download wishlist in excel format in magento 1.9

i want to download my wishlist in excel format without any plugin, currently i'm able to download my wishlist as docx type. Please help.
1
vote
0answers
10 views

Closure Compiler support

It seems there are several performance extensions for Magento 2 but none of them mention Closure Compiler which still yields the best results compared to the current minifier. The extensions which I ...
1
vote
0answers
18 views

Magento 2 remove lazy load header cart with items

We are currently developing a new Magento 2.3 store, but we find out that items in the cart in the header, are loaded quite late. When we load a page on frontend, first the entire page loads and then ...
1
vote
0answers
29 views

How can i disable till 1 week next future dates in Magento js Calendar?

I want to allow customer to choose dates after 1 week from current date. Like as today date is 15 Feb 2019 so customer can select dates from 22 feb 2019. I did change js for calendar by adding below ...
1
vote
0answers
66 views

CSS and JS merging options is not working on Magento 1.9.2.4

I am simply trying to enable the option of merging JS and CSS on configuration > system > developer and I have cleared the cache and even tried to delete the VAR folder and still having CSS and JS not ...
1
vote
0answers
32 views

JSON.parse: unexpected keyword at line 1 column 1 of the JSON data

I am getting this error in checkout. Below the Shipping Address form, Shipping Methods is stucked on loading. In console it says: JSON.parse: unexpected keyword at line 1 column 1 of the JSON data ...
1
vote
0answers
30 views

Mega menu issue with product zoom

I am using Magento 2.2.6 on the product page, When you view a product, and then you go to Products Menu, once the mega menu is shown up, move mouse to the menu item over the product picture area, then ...
1
vote
0answers
40 views

How to use javascript in ko template in magento 2?

I have a custom module which will overrride vendor\magento\module-checkout\view\frontend\web\template\shipping-address\shipping-method-item.html, here is the code <!-- /** * Copyright © Magento, ...
1
vote
0answers
91 views

Magento2: custom javascript not called when using with text/x-magento-init

In list.phtml (product listing) I am showing requistition lsit for every product using type="text/x-magento-init" in loop as: <script type="text/x-magento-init"> { "*": { "...
1
vote
0answers
30 views

How to add a configurable external JS with additional data- attributes via requirejs?

I was trying to add an external JS, say https://foo.bar/script.js (the url is configurable via config data) via requirejs, and I was successful so far. But then I realized that I would need to provide ...
1
vote
0answers
44 views

Extend a default JS component or Use Mixin

Which is better and recommended to use Extend a default js component as explained at https://devdocs.magento.com/guides/v2.1/javascript-dev-guide/javascript/custom_js.html#extend_js or to use Mixins ...
1
vote
0answers
171 views

Magento 2 Knockout Js Customer Name update issue after changing customer name

I am having strange issue. In header, along with Welcome message i am showing Customer full name. For that i am using knockout.js concept. <?php if($block->customerLoggedIn()): ?> <li ...
1
vote
0answers
235 views

display a popup once per day!

this code is to display a pop up once per day. But I'm having trouble making it responsive, and it seems that it shows once a lifetime... Also if I put it in 3 different pages, and it only shows up ...
1
vote
0answers
53 views

How to solve Js load error? Shipping Extension

I am using Sendle shipping extension, this extension work as, if you give zip code gives auto suggestion of city, after I migrate server, the auto suggestion not working. The extension developer ...
1
vote
0answers
45 views

Issues creating a widget with repeated functionality in Javascript

Have a controller class setup as a widget. Labeled here as "buttonController". I'm trying to call and instantiate an instance of the controller widget per each button. Everything seemingly works, ...
1
vote
0answers
105 views

Magento 2 – default admin editor -where is settings js code?

I want to change admin editor setting but not found config js code, please guys share me JS code path so i can change editor settings.
1
vote
0answers
26 views

Magento 2 : How to Use Custom AJAX Code in Admin Front End

I'm developing a delivery system for handling parcels that are handled the delivery agents. since I'm a open cart developer and new to magento, its hard for me to develop. Kindly tell me how to add ...
1
vote
0answers
48 views

Building javascript “Order by for same day shipping” countdown timer

I've got an online store in Magento and I want to add a countdown timer so that if a customer orders by 5pm Eastern Standard time their product will ship the same day. I need it to be freely usable in ...
1
vote
0answers
46 views

Error in css and js in child theme in Magento 1

I'm having a problem loading style sheets and scripts. I created a child theme, and I did not add any css or js to it. Even so, the magento looks for them in the son theme instead of the father. I'll ...
1
vote
0answers
25 views

how to rewrite magento2 backend menu js

I want to rewrite magento2 js The file path is "vendor/magento/theme-adminhtml-backend/web/js/theme.js", what should i do? Thanks for you helping
1
vote
0answers
17 views

Is it advisable to put JS in the footer? Magento 1.9.x

A query is a good practice to put the JS in the footer in magento 1.9.x? In Google Speed ​​Test tells me that there are resources that clog the page when loading
1
vote
0answers
24 views

Magento 2: Translation in JavaScript don't work

I try to translate the next line and this don't show changes: if (pending > 0) { $('#wrapper-freeshipping_alert > p').text($.mage.__('You need %1 more for free shipping').replace('%1', ...
1
vote
0answers
271 views

Magento 2.2.4 Implementing Bootstrap 4 Carousel to Homepage | JS seems to not be functioning

I've been trying to get the Bootstrap 4 Carousel to work on my homepage and I've been facing an issues that seems like the JS may not be functioning. This is the way that I went about doing so. I ...
1
vote
0answers
27 views

Install a BBB js into my pages

I have to install this JS script into my theme (paygo) in the bottom so I think it is the footer. I don't know where to start can someone tell me what to do. <!-- BEGIN: BBB AB Seal --> <...
1
vote
0answers
39 views

Magento Success/Failure Message for the Form Submission using Javascript

I am submitting the form to edit primary shipping and billing addresses via ajax (2 forms, 1 page), and it finally works like it has to. Now, I'd just like to add messages that magento sets for those ...
1
vote
0answers
94 views

Theme without require.js, knockout.js, AngularJS

I'm evaluating a the moment Magento2 as a solution for our Shop and I looked into a lot of Shops based on Magento2 to test the frontend performance and to be honest, I'm shocked. Every Shop I saw ...
1
vote
0answers
28 views

How to Text editor value display product image?

Please see this below image In this, the right has the text editor column and left side to have the product image frame. I need the text area value is display on image frame.how can I write this ...
1
vote
0answers
84 views

Error: Mismatched anonymous define() module error when integrating intl-tel-input with mageto2

I am trying to use https://github.com/jackocnr/intl-tel-input with magento2 on customer registration form for mobile number field to show country flag for chosing phone number but i am getting error "...
1
vote
0answers
30 views

validation script ReferenceError

I got the following error some time on my website and after refreshing the page its work fine... with the validation script ReferenceError: validateOptionsCallback is not defined at eval (eval at ...
1
vote
0answers
21 views

need the CMS path directive for a app/code module folder

i added my own module under /app/code/my/module/ , activated it and put a java script under /app/code/my/module/view/frontend/web/js/myjs/myjs.js it works so far. The javascript is called within a ...
1
vote
0answers
555 views

Magento 1.9.1 I have added popup after clicking on addtocart button but the page is reloading before closing the popup

Magento 1.9.1 I have added popup after clicking on ad to cart button but the page is reloading before before closing the popup, Please let me know how can http://onlineflowersdelivery.com/new/index....
1
vote
0answers
497 views

Magento 2.2.2 - RequireJS domReady! not working with Slick Product Slider

Issue Slick slider breaking/not loading properly on page load and eventually breaking the product slider Solution: Load slick slider script after entire document is loaded and parsed ...
1
vote
0answers
20 views

Updating checkout validations without typing in the field

By default, the validations on checkout fields get updated on "keyup" of the field you're typing in. Is there a way to update validations when clicking a button or by some other action, that is not- ...
1
vote
0answers
471 views

Mixin js file in Magento 2

I am attempting to override this file \vendor\magento\module-checkout\view\frontend\web\js\view\form\element\email.js First I create a requirejs-config.js file in C:\wamp64\www\magento222\...
1
vote
0answers
187 views

Magento 2.2.2 Javascript Bundle error

I am currently using Magento 2.2.2 and all is fine with JS bundling and minifying off. However, when I enable js bundling I get a JavaScript error. I think this is related to a require.js config file....