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.

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

Script work only in RWD theme and don't work on custom theme

I have a problem, I am using custom theme on my magento site, and use this script. It works only in RWD theme. I try to find some information about it and don't find anything.Please help if you know ...
0
votes
1answer
1k views

Magento 2 How to add onKeyUp to a text field in customer checkout address form?

I want to add a auto complete function to the customer checkout address form, but I found that the address fields are rendered by knockout js, I can't add the "onKeyUp" attribute directly. How can I ...
0
votes
1answer
221 views

Script Error on Admin Catalog

My Magento 2 is hanging on the Catalog Page - there is an unresponsive script: lib/view/utils/dom-observer.js:201 In Firefox I can skip the script and the page loads - in Safari I cannot. Any help?
0
votes
1answer
431 views

Overriding Core File in Magento

I am new magento and I want to override my "Data.php" file which is located at /app/code/core/Mage/Directory/Helper/Data.php I want to remove the unwanted states from DropDownList. Below is my ...
0
votes
1answer
37 views

Issue with magento subtotal value

I’m trying to calculate a value by subtracting the magento subtotal of my cart from another value, let’s say 50. This is the code: <script type="text/javascript"> function minus_number() { ...
0
votes
1answer
501 views

Get cart subtotal

I'm trying to get the subtotal of the cart and subtract it from a value in javascript. This is my code: <script type="text/javascript"> function minus_number() { var a = document....
0
votes
1answer
297 views

jQuery Function Call issue

I'm using magento 1.9 version. I am creating custom module, which contains some javascript functions to be included. I defined all javascript functions in seperate js file and included that js in my ...
0
votes
1answer
101 views

Loading Javascript file when module load

I am developing custom Module in Magento 1. Now I would like to load my module specific JS file when then module enabled. In this regard I used below xml code in a separate xml file named as module ...
0
votes
1answer
107 views

Can Widgets add custom stylesheet?

I would like to insert a custom stylesheet from my custom-made Widget. Is that possible? More specifically, I'm trying to use jquery.fancybox on a specific page and it needs jquery.fancybox.css for a ...
0
votes
1answer
731 views

GridJsObject is not defined when add grid seriallize inside Grid UI

I have face with this error while creat grid seriallize render data inside Grid parent. It build in by Grid UI Component. I dont use old way like magento 1. When click on edit tab to trigger ajax ...
0
votes
2answers
729 views

Add a javascript file in Magento 1.9

I'm discovering magento since 1 week. But i have a problem now. I need to include a javascript file in my admin panel to sort a list according to another. I'm using magento 1.9 and i really don't find ...
0
votes
1answer
542 views

Calling an Javascript function after adding an item

I have an javascript function to display div block once i added any item to cart. How can i achieve this?
0
votes
0answers
375 views

How to debug js/varien/configurable.js

I made some changes to js/varien/configurable.js but they don't seem to work as expected, I open the file in a built in debugger in my browser and set a break point at desired location, however it ...
0
votes
1answer
111 views

CMS Read More script

I have a javascript running on my home page to provide a read more facility, so part of the content is hidden until the read more link is clicked. This works well but I would like to use an image ...
0
votes
1answer
427 views

Get javascript value without html or script tags

I'm trying to get a product id value inside a add to cart button. The below code works getting the value in an alert. <script type="text/javascript"> jQuery(document).ready(function(e) { ...
0
votes
0answers
28 views

How to load default 4 items in a row in my website. Magento 1.7

This is the website I'm working https://www.joliefi.com as you can see if you maximize your web browser by default and refresh the homepage you will notice on page load it loads 3 column and later on ...
0
votes
1answer
239 views

Change js file code

I just ran a website through the wc3 validator and found some errors that I need to fix. Now, I’m quite new to magento so slightly confused where to find certain bits of the code. I need to find this ...
0
votes
0answers
155 views

Set Final Price by javascript (Magento 2)

I'm playing with some calculations and everything seems ok visually, I could get the price from: <span class="price">$280.98</span> And use in my formula, however, I want to change the ...
0
votes
1answer
602 views

Coupon code button problem!

I have 1 issue confusing. -When i am in checkout cart page. I cant click button apply coupon code. Javascrip seems it does not work ( I try with input empty but no validate or any reaction). But if I ...
0
votes
1answer
329 views

Magento 2: Update the Add to Cart button

I've updated the magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js file and have saved it in the VENDOR/THEME/Magento_Catalog/web/js/ folder. Unfortunately, I don't think I've saved ...
0
votes
1answer
18 views

Frontend assests have no base url

We have a strange issue on one of our live websites. Every now and then the websites frontend assets don't load. By looking at the paths it's trying to load it is because the base part of the URL is ...
0
votes
1answer
292 views

Add Thumbnail slider

Hi i have custom module with image how to add thumbnail slider for this <div class="fanbook-img"> <?php $collection = Mage::getModel('fanbook/fanbook') ->getCollection() ...
0
votes
1answer
1k views

Can Not View Content Blocks due to require.js error - Magento 2 theme change

I am facing problem with require.js on Magento 2 theme change Content > Blocks The page shows endless spinner and I can never view my imported blocks for my new theme. When I do Firebug on the page. ...
0
votes
1answer
823 views

How do i can extend or re-use Gallery Js Component of module Catalog in right way

This component is located in Magento_Catalog/js/product-gallery map: { '*': { categoryForm: 'Magento_Catalog/catalog/category/form', newCategoryDialog: 'Magento_Catalog/js/...
0
votes
1answer
454 views

Magento 1.9 JS problem

I have a search autocomplete to search a products. If it works other modules are not working (banner slider, brand logo slider, product slider, sticky menu and sticky header). autocomplete has 2 js ...
0
votes
1answer
136 views

How to copy “list view” style to a new file random.phtml?

I have created a random.phtml with the following code to list few products in the product page. <?php $manufacturer = Mage::registry('current_product')->getMerchantName(); $...
0
votes
1answer
32 views

Unique Web Page Url after every transaction

I am building a book business website. When the customer wants to download the book, first he has to pay the bill and then after the successful payment, the page redirects to the download page where ...
0
votes
1answer
379 views

Magento 2: How to run a javascript plugin?

Magento version: 2.0.0 I try to use NivoSlider plugin on my site, so, my requirejs configuration is: Demo/Theme/view/frontend/requirejs-config.js var config = { map: { '*': { ...
0
votes
2answers
34 views

How i can get static value with the pound symbol?

I am trying to assign pound value for input box. I am getting error can u please help me? if i give alert means its showing the value but i cant see the input value in inputbox I have tried below code ...
0
votes
1answer
37 views

Javascript - Read script js only if radio is checked

i'm stuck in a problem with a script js. This is the condition: var stampProd = "?php $stampProd = '10001'; ?"; function valiAnswPos(){ if (document.getElementById("positive")....
0
votes
1answer
525 views

CSS and JS is not loading in new theme

Created a new template and it's showing in the back end, but the CSS and JS files are not loading. The default theme blank/luma works fine, but when I select new theme then CSS, JS is not loading ...
0
votes
1answer
47 views

Magento Make Coupon Field in Cart only visible on Click

For conversion purposes I'm trying to hide the coupon field in the magento cart and only make it visible upon a click. This is adviced by all conversion experts, so it's weird Magento hasn't adopted ...
0
votes
0answers
598 views

Finding where CSS and JS injection is called from

In my development site, I added an extension that I have since decided to remove. Having removed all the files from the site structure, I am still seeing the css and js include files being included in ...
0
votes
1answer
47 views

Is it possible to write form validator which can process two different elements?

I need to do a validation on form submit, Which needs values from two different fields in the same form. I thought I will write a validator for one element and will read other element value with ...
0
votes
1answer
311 views

Add a comment to an order on Magento after backend javascript action with XMLHTTPRequest

I'm working on a custom module for Magento CE 1.9.1 and i need to add a comment to an order after a javascript function is triggered (clicking on a button). I thought to do this using an AJAX/...
0
votes
1answer
475 views

Create Drop-down menu in shopping Cart Page

In given link , http://liferaybangalore.com/index.php add one product to cart and go to VIEW CART , Above PROCEED TO CHECKOUT Button i want to add custome code for drop-down menus like(Children ...
0
votes
1answer
401 views

Need to Open Two URL while clicking product view page button in grid mode?

Need to Open Two URL while clicking product view page button in grid mode, Basically its a coupon site. In Grid mode when clicking the product view page button. It has to open product page url & ...
0
votes
1answer
178 views

How to populate all custom options of a configurable product in product view?

I have a configurable product in magento which has a size and color as product options. But the colors options gets populated when I have selected a size. Now I want to populate size and color before ...
0
votes
1answer
656 views

Product Out of Stock Subscription in not working in product listing page in magento

I'm using Business King Product Out of Stock Subscription (Link here) to develop product out of stock alert subscription. Its working fine in product details page but it s not working on product ...
0
votes
1answer
172 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/...
0
votes
3answers
223 views

Magento 1.x - Custom JS/CSS not found

I added these custom js and css file: skin/frontend/base/default/black/NewsletterPopup/js/main.js skin/frontend/base/default/black/NewsletterPopup/css/main.js Then I included them via my modules ...
0
votes
1answer
263 views

How to override js file in lib folder for admin theme?

I need to override js located in lib/web/mage/backend in Magento/backendtheme. Basically i should get modified js in static content for admin theme.
0
votes
1answer
614 views

Magento 2 get customer login or not in Js file

We want to check if customer is login. Only in that case we want to run particular script in Js file.
0
votes
1answer
557 views

Show adminhtml form field when other checkbox is checked

I am new to magento and using magento 1.9 version. I want show/Hide adminpanel form field based on the other checkbox is checked. How to do this using javascript.
0
votes
1answer
57 views

Magento2 requirejs inclusion

From what I've read there are 2 ways to include your javascript files: 1) In catalog_product_view.xml you insert <link src="js/product.js"/> and in web/js/product.js you add your js code ...
0
votes
4answers
402 views

Css and Js not load Magento 2

Problem: I am installing Magento 2 on live server. While the site displays product info and some of the product images, there are no styles and JavaScript functions don't work. Solution attempts/...