Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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
104 views

Magento 2.2 I want to add plyr.js for Vimeo video, I'm getting requirjs error and Class.extend is not a function, how to solve it?

Error 1) Class.extend is not a function. 2)RequireJS Error: Mismatched anonymous define() module: function (_, utils, wrapper) { 'use strict'; 3) I'm getting black screeninsted to Video. ------...
1
vote
0answers
40 views

Inserted text via JS is not in POST

I've got a custom backend module. This module has a form created with xml and .phtml file. In form there's some inputs, selects and textarea (the problem). In .phtml file there's only buttons which ...
1
vote
0answers
64 views

How to get child product _id in magento2?

I can get attribute _color. Now, How to get the selected child product_id in wishlist.js file in Magento2. If anyone knows please help me.
1
vote
0answers
38 views

js 'address' variable in Checkout

Can somebody explain where does 'address' variable come from in i.e file app/code/Magento/Checkout/view/frontend/web/js/view/shipping-information 'address' is used many times as argument into ...
1
vote
0answers
349 views

How to add some custom code javascript in core widget without override

I want to modify mediabrowser widget of magento Location that implement widget in vendor/magento/module-cms/view/adminhtml/templates/browser/content.phtml browser widget stay in lib/web/mage/...
1
vote
0answers
20 views

Minicart -product_sku in Magneto2

Below file contains product_sku value. view/frontend/web/template/minicart/item/default.html file. how to get/use product_sku in custom js file .If anyone knows please explain me
1
vote
0answers
97 views

Search through adminhtml grid not working 1.9

Magento ver. 1.9.2.4 Search through admin grids suddenly stopped working. No js files with 404 status, no errors in js console. Script productGridJsObject = new varienGrid(... is present, as it ...
1
vote
0answers
31 views

Magento 2. Adjust order of loading javascripts

I have the following navigation menu, loaded through Javascript like this: <ul data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'> ...
1
vote
0answers
324 views

Script in html does not work

I tried to add some javascript in details.html in vendor/magento/module-checkout/view/frontend/web/template/billing-address like in code below. details.html : <div class="billing-address-details" ...
1
vote
0answers
293 views

Can't submit add-to-cart AJAX form because of duplicated form in mobile friendly product page

I'm working on a mobile design for a Megento product page, what I'm basically doing is duplicating the HTML for desktop and mobile display and showing/hiding the correct design according to the screen ...
1
vote
0answers
544 views

Magento 2 Fotorama click event

Is there a way to fire a fotorama click event from a template file? What I am trying to do is have the functionality where, when the user selects an options from the dropdown from the catalog-product-...
1
vote
0answers
418 views

How to remove <script> tag if the device is mobile ? M1

I am trying to remove certain dynamic script tags if the device is mobile. I have something like this to start with: Vendor/MobileDetect/Helper/Data.php : <?php class ...
1
vote
0answers
440 views

Can't get ajax request post in Magento 2

In my js file i have this ajax request : var url = $(this).closest("form").attr('action'); jQuery.ajax({ type: "POST", url: url, ...
1
vote
0answers
96 views

Magento 1.x way of extending product.js

I recently found myself working with making price updates work in two places on a configurable product page. The previous dev had set up some jquery to try and catch the price updates and apply them ...
1
vote
0answers
75 views

What is the difference between the navigation and menu widgets

I've just noticed Magento 2 has two widgets that sound very similar, the menu widget and the navigation widget. They are both customised versions of the Query UI Menu widget and they both use the ...
1
vote
0answers
57 views

Magento 2 Add Javascript

I have the following code in a custom module for admin backend, which is not running. tinymce.html <textarea class="admin__control-textarea wysiwyg" data-bind=" value: value, valueUpdate: ...
1
vote
0answers
70 views

How to get pop up on button click popup with ajax call

On Shipping method section after select shipping option i want to open pop Up with 2 button submit & cancel on click on submit button i want to check my logic via ajax call
1
vote
0answers
138 views

Uncaught Reference Error

I'm getting this error message after an update that the developer of the plugin performed and it seems to be completely broken now. Is there a way I can fix this error myself? Uncaught ReferenceError:...
1
vote
0answers
288 views

Magento 2 infinite scroll issue

I am using a magento 2 custom infinite scroll module. When I scroll down ajax request initiate and response come with new page content . But this response not updating on current content . I checked ...
1
vote
0answers
296 views

Pricebox.js Issue Magento 2

I'm having an issue with pricebox.js/configurable.js and configurable products. They are used in quickview and on individual product pages. The first error I get is a console error calling a ...
1
vote
0answers
837 views

How to move “Place Order” button from “Review & Payments” to custom step in Magento 2 checkout?

I have create an extra step in magento 2 checkout page and put custom step after "Review & Payments" step. Now as you can see there is "Next" button on my custom step. I want here "Place Order" ...
1
vote
0answers
50 views

How to add class to javascript document.write & shorten date format?

<div class="shipout"> <p style="margin:0;">Delivery: FAST & FREE</p> <script> Date.prototype.addDays = function(days) { var dat = new Date(this.valueOf()); dat.setDate(...
1
vote
0answers
121 views

Magento 2 - Using KOJS template for filter component?

On the same page I have several custom product grids with above them a filter toolbar. To simplify the case : <?php foreach ($grids as $id => $grid): ?> <div class="container"...
1
vote
0answers
692 views

Magento 2 : How to Add Date Validator on Custom Input Form Js File

I have created a custom input on the checkout page, I want to add date validator from js but I can't. I already tried this custom js: $( "#co-shipping-method-form" ).validate({ rules: { ...
1
vote
0answers
48 views

Execute custom JS on 'Add to cart' completion

I'm currently trying to implement a very simple JS that should take the product name, quantity and price and store it in an json array so I can use it later on as part of the basket abandonment ...
1
vote
0answers
2k views

How to add js file to footer end of body in magento2

I want to add to footer from this code <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="empty" xsi:noNamespaceSchemaLocation="../../../../../../...
1
vote
0answers
876 views

Magento 2 How to flush javascript cache?

I rewrote the code in validation.js. It was successfull,the new text has appeared on the site and now i want to change it again but this time its not changing on the frontend. I tried to flush cache,...
1
vote
0answers
144 views

Magento 1.9 Calendar not displayed on customer registration page

I am using magento 1.9 for my website. I have enabled Javascript calendar in magento admin, but it is not displayed on customer registration page for Date of Birth field. How should I enable it?
1
vote
0answers
648 views

How to initialise a carousel and use Knockout observables in the same JS file

I'm experimenting with Require JS and Knockout JS in Magento 2 and I've ran into a strange problem where I can't use Knockout JS and initialise a carousel in the same JS file. The carousel works fine ...
1
vote
0answers
380 views

can't get jQuery's ajaxComplete working

I can't get jQuery's ajaxComplete to work. I'm thinking it's because the ajax call is being initialised by Prototype? But how can I check when any ajax call This is basically the code I have: ...
1
vote
0answers
666 views

Problem with loading Javascript in Magento 2 from history

On our Magento 2 new webstore there is a problem with loading javascript from history (with F5 or new tab). This problem occurs mostly in Microsoft Edge Browser. Sometimes, my code loads fine, but ...
1
vote
0answers
746 views

Uncaught TypeError: Cannot read property 'value' of null(…) on Onepage checkout page

I can't progress to the payment step when I click continue: UncaughtTypeError: Cannot read property 'value' of null : getting error on click continues button. Can someone assist me, please?
1
vote
0answers
166 views

How to change inline js

<li class="buttons ajaxlogin_actions"> <button id="ajaxlogin_button_send" name="ajaxlogin_button_send" title="<?php echo $this->__('Login') ?>" class="...
1
vote
0answers
300 views

Magento2 cant find …min.js

Afer content deploy php bin/magento setup:static-content:deploy de_CH php bin/magento cache:clean in direcrory pub/static..../js created ...min.js files but magento on frontend try to load not min ...
1
vote
0answers
165 views

Load specific step in One Page Checkout

A link is sent to a customer to complete the payment on payment pending. So the link redirects the customer to the one page checkout. Where all the details are filled in through the quote of the order....
1
vote
0answers
79 views

Overwrite a modules JS files with theme

I've been looking over the Magento 2 Docs for using custom JS and have been trying to add a modified version of 'configurable':'Magento_ConfigurableProduct/js/configurable' to my theme directory so ...
1
vote
0answers
1k views

ReferenceError: Flex is not defined

I am receiving this error with an extension. I think this is related to the last patch 8788, anyone know how to solve it? the error points me here var uploader = new Flex.Uploader('...
1
vote
0answers
447 views

How to disable auto collapse in mobile menu?

In mobile menu of Magento 2 when we click any child item of a parent, the parent collapse [see the image] what can i do to disable this behaviour. Demo: http://magento2-demo.nexcess.net/contact
1
vote
0answers
224 views

Magento 2 : How to merge JS for frontend?

I want to merge all js request and for this I am using Merge JavaScript setting of Magento and set it to yes. But still lots off js request in browser which are not merged. How do I merge all these ...
1
vote
0answers
429 views

Can't get my ajax request to call controller

I'm trying to send information from the view (js) to the server. I'm trying this with the JS request: $.ajax({ type: 'POST', url: 'php_file_in_controller/Main_Class_Name', data: data, ...
1
vote
0answers
84 views

How opinionated is magento2 frontend(JS)?

I hope this question makes sense, there is a chance it doesn't. I am looking into creating a custom checkout module for Magento2 and as a part of it i am evaluating JS frameworks. After evaluating ...
1
vote
0answers
255 views

css and js should have relative path in page source - magento2

I have one request that is I need to change all the css & js path from absolute to relative in page source. Please refer the screenshot for your easy reference. here I want to change all the css ...
1
vote
0answers
118 views

Saving a page/static block triggers an tinymce error and I can´t switch from HTML to text

I have a up to date Magento System. But for some reason when I am in the backend and want to edit a page or a static block, I cant switch from the HTML view to the text/visual view. If I click the (...
1
vote
0answers
45 views

multiple coupon code apply on magento cart

I have been working for 2 days for applying multiple coupon on cart I know there are modules which are available for that. But i don't want to use it. I want some custom code so that i can apply more ...
1
vote
0answers
96 views

Magento 2 Script tag error

I'm having an issue with Magento not processing script tags correctly: This code: echo $this->getChildHtml('addthisJs'); adds this script tag: <script type="text/javascript" async src="//s7....
1
vote
0answers
553 views

Uncaught ReferenceError: signals is not defined

Hi I am adding a js file to get a push slide in menu so I can change the country which is working here http://kaiel.fr/shopnew/kaielf.html But in magento 2.1 http://kaiel.fr/shopnew/ it does not work....
1
vote
0answers
149 views

Product Configurator in magento 1.x

I want to create a module for customized t-shirts design. Configurator modules consist following features: Product Image upload Text configuration on production Size Colors For size and color, I can ...
1
vote
0answers
427 views

Magento 2 calculate custom text fields length and width on product view page

How is possible in magento 2.0? I successfully active in magento 1.9 for bellow thing. I am trying to create a product with two custom text fields: Length and Width. When the user types, both a length ...
1
vote
0answers
1k views

Display out of stock options of configurable product

Greetings to all developers! I need your help! I am following this tutorial to display out of stock options of my configurable product. What we want to achieve is even when certain sizes of a product ...
1
vote
0answers
148 views

How to override step-navigator in checkout?

I need to override/extend the step-navigator.js with the function "isProcessed" but that link How to extend js class/method of checkout model class in magento 2 doesn't work. Magento can't find the ...