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.

656 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
261 views

Adding AMP JS library to Magento using XML

Requirements: Add <script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script> to the head of the page Problem: JS library needs to be ...
0
votes
1answer
90 views

How to get all product images in modal slider?

<div class="pdp-media"> <a class="product-image" href="<?php echo $item->getProductUrl(); ?>"> <img src="<?php echo $this->helper('catalog/image')->init($...
0
votes
2answers
311 views

Newsletter Popup Submitting But Not Closing

It was working when I first installed it. Now I'm finally ready to try to use it it's not completely working. It Submits the form and it registers in magento backend in the newsletter subscribers but ...
0
votes
1answer
50 views

js observe for field validation flickering

I am using this script: <script type="text/javascript"> $('street_1').observe('keyup', function(e){ Validation.validate($('street_1')) }); </script> Which on keyup ...
0
votes
1answer
433 views

How do I get the Bing Revenue Conversion tracking to work on Magento?

I am using Magento 1.9.1. I have Google Analytics ecommerce tracking working fine but the same thing will not work in Bing Ads. <?php $orderId = $this->getOrderId(); $order = Mage::getModel("...
0
votes
1answer
11 views

i need to link the js file in admin inside pdate layout xml tab in magento 2

I need to link a JS file in admin inside update layout xml tab in magento 2 please give if you any solution. <head> <script src="js/productcollection.js"> </head>
0
votes
1answer
79 views

Javascript loading issue in Magento

I am loading an external script on a Magento CMS page. On the CMS page, I have the following div: <div id="feefo-service-review-widgetId" class="feefo-review-widget-service"> </div> ...
0
votes
1answer
259 views

Magento 2 css problem on fronted and backend

I have the following issue: I copied a project from a server to another. On the original server, everything works fine, but on the new server i don't have any css or js included in my project. I ...
0
votes
1answer
255 views

Magento2 Add custom form in order view but url don't correct

I have a problem when add a custom tabs in order view. In new tabs, I have html form: <form action="<?php echo $block->getUrl('giftvoucheradmin/giftvoucher/addcodetoorder') ?>" method="...
0
votes
1answer
679 views

Magento 2 EE Checkout Page not working (JS error)

I am facing an issue of knockout JS file on my site bixlercollegiate.com. My products are being added, but when I click on checkout, the page becomes blank. When I checked my console on Chrome, the ...
0
votes
1answer
67 views

Magento PopUpAjaxCart Does Not Show the Options For Configurable Products

Attached is the picture of what my problem is. I have configurable products that i want the end user to select options from. While the popup with the id popUpAjaxCart appears, but there are no options ...
0
votes
1answer
18 views

Category pages disabled javascript functions

When I go to a category page on my Magento installation since a couple of weeks I do not have a working search/mobile menu/language switcher: https://www.thefixedgearshop.com/beat-the-heat-sale When ...
0
votes
1answer
150 views

Data save in magento 2.1 product form

I have added a attribute "publishers" in product upload form. The publisher list is coming from ajax call from the database like auto suggestion and showing like drop-down list. The problem is when ...
0
votes
0answers
2k views

varienForm is not defined

I have a checkbox, and 3 input fields. Basically, if the user selects the checkbox, then they do not have to complete the 3 text inputs. I have created the below just to test some custom validation (...
0
votes
1answer
219 views

Custom script is loaded before javascript libraries sometimes

This is my requirejs-config.js in theme folder var config = { deps: [ "js/main", ], map: { '*': { 'flexslider': 'js/jquery.flexslider-min', 'typing'...
0
votes
1answer
58 views

magento 2.1.6 in fedora 25 css and js files issues

I have installed Magento 2.1.6 in Fedora 25, after successful setup, but when I run it in the browser, I am getting lots of css and js files not found errors. That is loading from static version ...
0
votes
0answers
123 views

Admin forgot password js issue

I have Try to solve bellow js issue but not succeed. i have checked in new magento this file is magento inbuilt merge. Can any one have solution how to solve this issue ?
0
votes
1answer
182 views

Can i remove default js/calendarview/calendarview.js?

Can i remove the following inlined js and js/calendarview/calendarview.js from magento store? <script type="text/javascript"> //<![CDATA[ enUS = {"m":{"wide":["January","February","March","...
0
votes
0answers
368 views

shipping address is missing out on checkout

I don't know why but i get an error js on checkout. When I'm on the payment step, The shipping address Below the choice of method of payment is absent. The problem come from an error with Knockout. ...
0
votes
2answers
129 views

How to modify text string from this JavaScript file

I would like to change a text string in this file, to be Add or Added to Basket depending on which page the user is on: app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js To ...
0
votes
0answers
277 views

Magento 2 - RequireJS config file not importing JS files, no error thrown

In my requirejs-config.js file placed under [MyModule]/view/frontend, I include all my JS files like this: var config = { paths: { "jquery.min": "MyVend_MyModule/js/jquery.min", "...
0
votes
1answer
371 views

Remove checkboxes in customer-account-edit and show all info

In customer-account-edit page magento decided (why???) to insert 2 checkboxes: By default only if you click on those checkboxes the other fields appear so you can change them. I would like to remove ...
0
votes
0answers
501 views

Executing JS function onclick button which is present inside form

We have button "create" and onclick "Create" button, it will create product programmatically and assign custom image to that product. app/design/frontend/rwd/Theme3/template/aitcg - js_styles1.phtml ...
0
votes
1answer
126 views

Fraud: Is there any way to block a specific postal code (address)?

we've been receiving quite a lot of fraudulent transactions and they're all being delivered to the same address, I was wondering if there was any way I could block customers from using a specific post ...
0
votes
0answers
56 views

Can't overwrite js filed in Magento 2

I tried to overwrite **date.js(module-ui/view/base/web/js/form/element)** and **range.js (module-ui/view/base/web/js/grid/filters)**in my custom theme but it's not working. it not take me the changes ...
0
votes
0answers
770 views

Disable Place order button on checkout page until checkout agreement checkbox is checked

I need to disable place order button until checkout agreement checkbox is checked. I have written some jquery code to achieve this: $('.action.primary.checkout').attr("disabled",true); $(".checkout-...
0
votes
1answer
40 views

Jquery run after plugin

I use a third-party theme, initially the theme included Jquery through default_head_blocks.xml. I wanted to use requireJS instead and I removed Jquery from default_head_blocks.xml. Now I have this ...
0
votes
3answers
464 views

Is it a Trojan? What can I do?

A customer complained about trojan alert on my website, and after doing some reading, I checked the pages, and I found this code below on the System > Configuration > General > Design. <script ...
0
votes
2answers
65 views

How to add +30% to associated simple product price if an attribute = YES?

If configurable product attribute=yes add 30% to associated simple products prices. Have an attribute afiliate in my configurable product. Need to add 30% to the associated simple product price if ...
0
votes
1answer
919 views

Magento : Get Configurable Product Price From Simple Products

Is it possible to get simple product price without manually updating associated fixed price or percentage? We have more than 3000 configurable products, so it's not possible to do it manually. Can ...
0
votes
0answers
245 views

Magento 2 css js all can't be loaded after upgrade

After i upgraded the magento 2 from 2.1 to 2.1.5, all can't be loaded All css & javascript links are like this http://example.com/pub/static/version1491232244/frontend/Magento/luma/en_US/css/...
0
votes
1answer
652 views

Javascript translation not working

I have override the register template in my custom theme. In this form use the validation to validate my fields but the translation of the error messages aren't showed. I declare the function where I ...
0
votes
1answer
133 views

M2e pro not getting Product Image Gallery (i use Stock in the Channel)

I am trying to fetch products extra images for my ebay store. i am using m2e pro and they have a tag system #media_gallery# is what we use to pull the images but it is not working. the strange thing ...
0
votes
1answer
181 views

Magento2 can't translate this sentence with “+”

In the "file vendor/magento/module-ui/view/base/web/js/lib/validation/rules.js" in line 433 Magento2 can't translate this sentence. But after remove "+" the translation is perfect. How I can ...
0
votes
1answer
117 views

Magento : Extend Caching Time For External JS

I want to Increase Expire time for External JS how can I achieve this? Extend from .htaccess doesn't work for this. And We can use CDN for External JS , like zopim , zendesk , google fonts , google ...
0
votes
1answer
58 views

How to unselect selected item in js?

<img class="swatch-img current" src="IMAGEURL" alt="XXX " title="XXX ">this is source line. if class = current onclick it should be changed to class="" I wanna change do it in javascript.
0
votes
1answer
27 views

Javascript point to Folder: Solution and Tool

We are updating our store to Magento 1.9.2 and we are in the testing phase. The store is using Ultimo theme. On all product pages there is a error in the header, which refers to the following line: ...
0
votes
2answers
77 views

CSS and JS not loading

When I run in my terminal: php bin/magento setup:static-content:deploy which is supposed to be the fix for css and js not loading, I get this: PHP Parse error: parse error in /Magento/vendor/...
0
votes
1answer
292 views

Some java script failed to load

So, the question is simple, what can i do to fix what you can see in that picture? Some js are failed, not all of them, just those 5.
0
votes
2answers
2k views

Uncaught DOMException: Blocked a Frame with origin from accessing a cross origin-frame

I have a Magento 1.9 site that uses TinyMCE. Everything worked fine until I added a cdn. The script wouldn't load because it was on a different domain. I went ahead and added a subdomain but it still ...
0
votes
1answer
192 views

Change parent's required JS component type in child component

I want to extend the JS component: Magento_Checkout/js/view/payment/default.js. I need to have a custom version of this component which uses an instance of MyCompany_CustomCheckout/js/action/place-...
0
votes
1answer
365 views

Magento 2 Js issue when try to adding to cart

I receive a js error everytime i try to add products in cart. I already run all this command but nothing changed : php bin/magento setup:static-content:deploy nl_NL , magento setup:static-...
0
votes
1answer
91 views

Magento Wysiwyg editor issue when try insert an image (probably js incompability)

I am having an issue while try to add an image using the Wysiwyg editor in Magento. The error I get is that the image upload tool displays with code (tags) on it and the upload or browse icon do not ...
0
votes
1answer
97 views

Why does magento wait for a request to complete before processing others?

I have added a script to an admin page on a magento site to initiate a long running process and periodically query the progress using AJAX (or XHR) requests so that it can update a progress bar. The ...
0
votes
2answers
1k views

Fixed Header and Mega Menu

I'm new at magento. I'm using luma theme as a blank. I want to fix header and mega menu when page scroll down. Thanks for your helps.
0
votes
0answers
279 views

Lightbox not working

The Lightbox jquery is not working. For Photo Gallery it is hover by mouse and zoom in zoom out effect and modal open when user clicks on that
0
votes
0answers
3k views

How to use Ajax in magento 2 custom module

I am working on one custom module and i need product load when any ID is clicked. Loading is handle by ajax. I am not aware of ajax in Magento 2. Can anybody give me small demo of ajax in Magento 2 ...
0
votes
0answers
583 views

Custome scripts conflict with Magento 2 and requirejs!

I have custome jQuery scripts (revolution slider). My steps: Add custome js files to app/design/frontend/Agestor/default/web/js. Create requirejs-config.js to app/design/frontend/Vendor/default. Or ...
0
votes
1answer
157 views

“Save config” is not working in Configuration -> Advanced -> Developer

After changing in Configuration -> Advanced -> Developer Merge JavaScript Files = Yes Merge CSS Files = Yes My site is not browsing correctly. I believe returning back to Merge JavaScript Files =...
0
votes
1answer
33 views

How do I add a js reference to the body of my page and a css reference to the head of my page?

The only place I have access to edit is: CMS > Pages > 'page' > Content Can I add a jquery reference to the body of my page like this in the content area? <body> <script src="js/jquery.min....