Stack Exchange Network

Stack Exchange network consists of 174 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

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 ...

0
votes
1answer
9 views

Sometimes getting cannot read property issue after page load due to which some functionality affected

On the entire website(homepage, category page etc) sometimes I'm getting "cannot read property timepicker" issue due to which some feature like "Add To Quote" functionality affected & instead of "...
1
vote
1answer
21 views

Extend Swatch rendered js file

How to extend the Swatch rendered js file in my custom module? I have override the phtml template files. <script type="text/x-magento-init"> { "[data-role=swatch-option-<?= /* @...
0
votes
0answers
6 views

Magento_Checkout custom field, value in realtime to uppercase [on hold]

I have the following problem, I have inserted a new input field in Checkout, and i want to set the value in realtime as uppercase, usually, I add the onkeyup attribute to HTML, but I cant find the ...
-1
votes
0answers
17 views

Copy to clipboard button in magento 1 [migrated]

Is there any way to create a copy to clipboard button on Safari? This is my code, but it does not work in Safari. <input type="text" id="copy"/> <button class="copy-button" id="button-copy"&...
0
votes
0answers
13 views

$block->escapeJs replacing hyphen with \u002D

On the Send Friend page, under Invitee the label for the email form should be 'E-Mail' on the German store, but because of $block->escapeJs it looks like this: This is the relevant code in the ...
0
votes
0answers
17 views

Load ajax after using observer

I have added this JS code inside catalog-add-to-cart.js : var popup = $('<div class="add-to-cart-dialog ajoutPanierModal"/>').html('<span>Le produit a été ajouté au panier.</span>')...
0
votes
2answers
24 views

How to get values passed from phtml in js magento 2?

I have passed two variables in my phtml to js file as below <script type="text/x-magento-init"> { ".slider-gallery": { "slickSlider": { "...
1
vote
1answer
29 views

Magento 2 jsonParse() does not receive data, Unexpected token '

I'm creating a js template in Magento 2. When I call js, I get an Uncaught SyntaxError: Unexpected token 'in JSON at position 96. Why jsonParse () does not get the value? Can somebody help me? file ....
1
vote
1answer
52 views

How To Debug Custom Feedback Form Sidebar Slider JavaScript Error?

I'm trying to create a Feedback form Sidebar slider. Workout: step 1: C:\wamp\www\magento\app\design\frontend\default\theme327k\layout\local.xml <?xml version="1.0" encoding="UTF-8"?> <...
0
votes
2answers
29 views

Magento 2.2.5 custom theme js errors

I created a custom child theme for luma and it works fine. But when I extend the layout for Magento_Theme I start getting all kinds of javascript errors which are random, sometimes they don't appear ...
0
votes
0answers
14 views

Magento 2: How can I change the product name and details in a configurable product with dropdown selectors?

Basically, I would like to get the functionality of: Magento 2 - How to change Product Name dynamically in configurable product view page - accepted answer, which provides dynamically changing details ...
0
votes
0answers
15 views

Magento 2 Cannot read property get of undefined

When this module is disabled 'MagePal_GoogleTagManager' => 1 the error dissapears. However I need the module to be enabled.
0
votes
1answer
25 views

Magento 2 How to add custom validation rules and apply them?

I'm trying to modify some validation rules for the State input in shipping address. I want to add an error message if user selects 'Texas'. I created a mixin for Magento_Ui/js/lib/validation/rules in ...
0
votes
0answers
10 views

Translate javascript validation messages

Got problem with validation, all the strings not javascript ones are easily translated via my .csv file located at app/i18n/vendor/language_language/language_language.csv, putting a string from js to ...
2
votes
1answer
28 views

Magento 2 TypeError Undefined products images not displaying / js not loading

At home page, product category view and product detailed view page images are not loading / displaying at firefox and less frequently at chrome. I am using magento 2.2.6 upgraded from 2.2.2 and porto ...
0
votes
0answers
15 views

On product list page, edit icon is not clickable when JavaScript is off

I can't find a solution to this issue. This is my unique question. I see many solutions in StackOverflow but not suit my current problem. I am not able to click edit icon when JavaScript is off. I ...
0
votes
1answer
15 views

Wow Slider appears on all pages except one why?

View this "wowslider" works here: https://www.allbookcovers.com 1.) but once you goto this single category made in Magento Version 1.5 CE as a page for product it starts breaking and showing the ...
1
vote
0answers
30 views

Adding Custom XML and JS to a theme in Magento 2.2.5

I'm currently trying to add some custom XML code and JS to a Magento 2.2.5 To start with I want to implement the solution provided in question 161644 (custom paging options in admin grid). But I'm ...
0
votes
0answers
12 views

Magento 1.9 drag n drop functionality on module's grid list in admin

I would like to add drag and drop functionality to my custom module list in the admin panel. Has someone re-use the drag and drop functionality from the categories or would this have to be a separate/...
1
vote
1answer
54 views

Constr is not a constructor Magento 2

I simply want to add js for my custom module but I'm getting this error: layout.js:137 Uncaught TypeError: Constr is not a constructor The hello.js file will still work, console.log will still ...
0
votes
1answer
15 views

using javascript in .html form Magento2

i have a custom form.html that displays at checkout. i want to have a javascript tag - when the form load just show an alert testing purposes. code i used below, "<script type="text/javascript"&...
0
votes
0answers
26 views

Popup Modal is not showing in Magento 2

I am new to Magento 2. I need to show magento 2 modal popup in checkout page when it loads.But the modal is not showing. When I inspect my code it shows my code but the modal does not load. My code :...
2
votes
1answer
18 views

Magento 2: Proper way to utilize “ajax:addToCart” event

I found the following codes in /vendor/magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js at around line 100, when I was trying to find ways to add some custom JS handling after ...
1
vote
1answer
23 views

Magento 1.9 How to add js to order review tab?

I want to hide an the tax row, but I dont know when is generated so I can add some js to hide it.
2
votes
0answers
32 views

Node modules in theme

I am new to magento and i have researched this issue i am having for enough time to post it here. My goal is to understand how require-js works with node modules. Case: $themeDir = app/design/...
0
votes
1answer
40 views

Magento 2: Can we write script in .html file? [closed]

script code will work in .html file in magento2? Thanks advance....
1
vote
1answer
22 views

JavaScript and CSS don´t works in my Magento 2 page

I found a "partial" solution on the Internet, but if I use that "solution", my store don´t works: If I use that, this is the result: Home JS page Store Like you can see, if it makes me choose ...
0
votes
1answer
25 views

Pinit Button is not working in IE11 in magento 2

I have added pinit save button using following guide Pinit Widget builder in product detail page in gallery widget. I have added pinit.js at the end of app/code/Vendor/Module/view/frontend/templates/...
1
vote
1answer
25 views

Magento2 - Get ID for simple product which is associated to configurable product on product listing page

I want to pass product id in a rel tag in the swatch-option class which is on the listing page for swatches. I am aware it has to be done via swatch-renderer.js but not able to do the code. console....
0
votes
1answer
48 views

Sticky header with cart button

I tried to made the header to sticky and put the cart button to the header when the page slide down. I already done with the sticky header, but i can't add the cart button to the sticky header. How ...
0
votes
0answers
18 views

Have To Click Links Twice CSS/JS Issue?

I don't think this is exclusively related to Magento but it is an issue I am experiencing with Magento. On all browsers (including Safari on Desktop) all links etc work fine. On Safari on an iPad &...
1
vote
1answer
28 views

Magento 2.2.5: Static files are not generated for custom theme

I'm trying to custom Module_Checkout of magento, and it doesn't works because in pub/static it doesn't render js and template file. Here's my tree, please take a look: The custom-shipping.js is ...
2
votes
0answers
19 views

Negation in the imports link (UI component)

I've got the fieldset component in my custom UI-form: <fieldset name="default"> <settings> <label>Default</label> <collapsible>true</collapsible&...
0
votes
1answer
21 views

I am not able to use product name like 5" ABCD in Magento2

When i use double quotes in product name Magento2 product page is breaking. Not Rendering Images , Tabs etc getting below js error Uncaught SyntaxError: Unexpected token B in JSON at position 120 ...
0
votes
0answers
10 views

How to merge name : value pairs in Javascript

We have a form on our Magento site and wants to send the form data to an external application like Superoffice using ajax call. But the Superoffice table contains only 8 fields and the extra fields ...
0
votes
0answers
28 views

Js error when first time loading site magento 2 in chrome browser

Js error when first time loading site magento 2 in chrome browser. Firefox, and explorer no problem. One of the problem is here. http://prntscr.com/kso59y
1
vote
2answers
41 views

How to remove core js in magento 2 [duplicate]

I wish to remove password-strength-indicator.js and zxcvbn.js from customer module, because it takes 1 MB to load and takes more time. So Please provide me a solution to remove the above js what i ...
0
votes
2answers
52 views

Magento 2 - JS to fire once checkout page has fully loaded

I have the following if statement where I want to check to see whether the postcode input is empty however it fires before the input is loaded on the page and was wondering whether anyone could please ...
1
vote
3answers
46 views

Add bxslider in magento 2 home page

as i am new in the magento and i want help to add bxslider in the home page area. I have added the widget-block from the admin to display the slider images. Also I have added the js in ...
0
votes
0answers
34 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 ...
0
votes
1answer
14 views

requirejs ! bootstrap.min is not loading in Magento2

I am doing theme integretion. I have included the bootstrap.min.js file in requirejs-config.js in requirejs-config.js file var config = { map: { '*': { 'jqueryjs': 'India_Newtheme/js/...
0
votes
2answers
45 views

How to remove a specific href from a top-menu link in Magento 2

Hello I am trying to make 3 items on menu to be not click-able and I want to ask how to remove a specific href from a top-menu link in magento? (I don't want to remove from all menu ...
1
vote
0answers
37 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, ...
0
votes
0answers
18 views

How to close the popup by clicking browser back button in magento 2

I wish to close the popup while clicking browser's back button, Please provide me a solution I have tried like below,but not works $(function () { if (window.history && window....
1
vote
2answers
105 views

M2 Free shipping if subtotal is higher than X amount

I am developing M2 store for a company that just serves only for domestic users. I recently bought the Amasty Inventory module and made the domestic cities.(No shipping available to the countries ...
2
votes
3answers
199 views

Remove deleted javascript from body

I deleted the file in my ftp but it is still being loaded on every page at the end of the body tag <script type="text/javascript" id="cookieinfo" src="/media/js/cookieinfo.min.js"> </...
0
votes
0answers
51 views

Accordion not working Magento 2 after minify JS

I have minified JS and HTML and CSS in Magento 2. After that Accordion is not working. <?php $collectionTitle = $this->getCollectionFaqcat(); ?> <div class="shy-shadow-container row mrg0"...
0
votes
0answers
14 views

Using Grunt to watch JS files

I have been following this guide to theme development with M2 and Grunt. I have set this up, but it is only watching Less files. Is there a guide to get grunt to watch for changes in JS files as well?
1
vote
0answers
14 views

Launch Polyfill.io BEFORE Magento 2 scripts

I need to use the https://polyfill.io/v2/docs/ library for a Magento 2 project, so I called it in : htdocs/app/design/frontend/my_theme/default/Magento_Theme/layout/default_head_blocks.xml With this ...
0
votes
0answers
28 views

Mganeto2: doesn't exist or not a file .js

In exception log file I get every time issue: [2018-08-26 10:41:56] main.CRITICAL: The path "/home/czasowe/domains/domain.com/public_html/var/tmp/_cache/merged/dff080226ea3597444c03925cb09364e.js" ...