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 ...
1
vote
1answer
12 views
How can I build a redirect URL in a magento 2 js component?
I have added a payment method renderer javascript file to a magento 2 module. I want one of the functions in the js to redirect to another page on the site.
How do I get the base url so that I can ...
0
votes
1answer
26 views
Magento 2 Add javascript to single page
I'm trying to get some JavaScript in the head on a single CMS page in Magento 2 and cannot figure it out. I understand how to extend layouts to include this, but I don't want the script on all pages ...
0
votes
1answer
17 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.
1
vote
0answers
26 views
How to override Magento 2 js using Mixins?
I want to override the js file in module-checkout/view/frontend/web/js/model/cart/totals-processor/default.js using mixins. Here is my requirejs code:
var config =
{
config:
{
...
0
votes
1answer
28 views
Magento1: Form Validation suddenly broken?
I'm trying to find a solution to a problem I've recently run into, whenever I attempt to create an account or checkout as a guest it keeps coming up with "The first name cannot be empty, The last name ...
0
votes
1answer
13 views
My Magento site on Macbook is not picking up .css and .js because paths are wrong, where can I set these paths?
I have pulled whole Magento web site from a git repository onto my Macbook. It looks like the css and js files don't have the right path, and site doesn't look good (site is now without any styles). ...
0
votes
0answers
22 views
Modify checkout step navigation magento 2
I'm customizing the checkout process in magento 2 by adding a custom step between Shipping and Payment steps and by adding a checkbox in Shipping step.
The problem
When going to checkout page for ...
0
votes
1answer
71 views
What Programmatically Triggers Magento 2's Shipping Rates to Update
When you're filling out the Shipping Address form in Magento 2, periodically Magento will make an ajax request for the URL
http://magento.example.com/rest/default/V1/guest-carts/[hash]/estimate-...
0
votes
1answer
21 views
how to set external js dependency for internal js in magento2
In default_head_blocks.xml I've loaded following jquery.
<link src="//maps.googleapis.com/maps/api/js"/>
<link src="js/main.js" order="101"/>
Now my situation I want map js loaded to be ...
0
votes
1answer
38 views
Trigger modal after placing a product in minicart on Magento 2
I need to show a modal after a product is placed inside cart. This is what i have so far.
This is my default.xml
<body>
<referenceContainer name="content">
<block ...
2
votes
1answer
112 views
Magento 2 js bundling - exclude certain script
We got M2E pro installed on Magento 2.1.1. After enabling js Bundling under Config > Developer we have a not defined error on all m2e pro js.
Wondering is there any way how to exclude M2E pro related ...
0
votes
2answers
45 views
How get admin url in js file?
How get admin url in js file ?
Js file call AjaxController and this Js file are called to System -> Config from system.xml
0
votes
0answers
13 views
jquery / AJAX add to cart / minicart doesnt refresh
Currently i am working on this website;
http://picknickbankspecialist.nl/picknicktafel-rond-120cm-aanbieding
I did run into a problem with the setup of the magento since its a multistore with ...
0
votes
0answers
19 views
Checkout loader overlay not disappearing after page load completion
We've recently upgraded a magento 2 site to 2.1.2 and since doing so the /checkout/ page has a strange issue. Once the page has completely loaded the loader gif does not disappear - it just stays ...
0
votes
0answers
13 views
Onepage checkout module based on jquery
I need a reliable onepage checkout module written in jquery framework, not oldschool Prototype for its client-side stuff.
The reason for above-mentioned restriction is the conflict of javascript code ...
1
vote
1answer
26 views
requirejs load js but not work - magento 2
app/code/Vendor/Module/view/frontend/requirejs-config.js
var config = {
map: {
'*': {
'gworks/jquery':'Vendor_Module/js/jquery.min'
},
}
};
In ...
0
votes
0answers
18 views
TypeError: element.prop is not a function - Magento 2
In product detail page I got below error in browser console at app/code/Magento/PageCache/view/frontend/web/js/page-cache.js
TypeError: element.prop is not a function
.prop('href', element....
1
vote
0answers
14 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 ...
0
votes
2answers
23 views
Code Not working in category description
<div class="category-description std">
<p>
<script type="text/javascript">// <![CDATA[
var z = jQuery.noConflict();
z("#toglbtn").click(function(){
z("#catdescr").toggle(...
0
votes
1answer
28 views
How to conditionally mutate widget based on configuration value
I'm in the process of porting an M1 module over to M2 and am trying to figure out the cleanest approach for conditionally mutating a component based on a system configuration value.
In Magento 1 I ...
0
votes
0answers
14 views
Right way of passing form values from phtml to controller in magento (Controller to view) [duplicate]
What is the right format of giving the path for the file to be posted from say index.phtml to my custom .php file
My index.phtml is in :
\app\design\frontend\base\default\template\recipe_creation\...
0
votes
0answers
13 views
Magento js TypeError: element.attachEvent is not a function
Im trying to post some data to backend at regular intervals based on the data submitted by the user.
app\design\frontend\base\default\template\vendor_recipe\recipe_creation\index.php
<!DOCTYPE ...
1
vote
0answers
19 views
Uncaught TypeError: is not a conscructor after update to 1.9.3 [duplicate]
After updating from Magento 1.9.2 to 1.9.3 on my dev site the tabs on my item page broke. I looked in console for the dev site and see this error-
Uncaught TypeError: Product.optionsPrice is not a ...
1
vote
1answer
45 views
MIME type ('text/html') is not executable and strict MIME type checking is enabled
In magento when I add to cart the product I show below error:
"Refused to execute script from 'http://www.example.com/ajaxcartsuper/ajaxcart/add/uenc/aHR0cDovL215ZmF…r_attribute%5B139%5D=27&qty=1&...
3
votes
1answer
27 views
How to get maching products based on rule conditions
how to get matching products based on rule conditions i need to filter product grid according to rule condition in my custom module I have used it as a filter
Array
(
[conditions] => Array
...
2
votes
1answer
38 views
magento 2: trigger js form validation without submit
On a custom frontend page I have a form in which I use magento's js validation to validate inputs: name, email description, etc. When the form is submitted the validation is triggered and works ...
0
votes
0answers
18 views
Call Magento Soap API with NODE JS
We are trying to create a product using Magento 1.x Soap API From NODE JS application. I know some wrappers are available for SOAP Call to Magento that uses xmlrpc. But I want to use Soap web services,...
0
votes
0answers
14 views
Magento 2 - use formatPrice method from price-utils in product list
i want to format the price in javascript with the formatPrice method in a list.phtml of my catalog. Unfortunately it only works in a product detail view. This is my code:
define([
'jquery',
'...
3
votes
0answers
19 views
Magento Speed issue google PageSpeed Insights Eliminate render-blocking JavaScript and CSS in above-the-fold content
I tried few hours, but it's not working. I tried this methods link
but still not working. please suggest me to speed up the site for mobile version.
0
votes
0answers
21 views
Selecting form fields on Checkout page with JavaScript
I'm trying to edit a checkout page - specifically form and order of the fields.
I didn't find a way how to reorganize and "do stuff" inside the checkout page so I decided to do it through JS since I'...
0
votes
0answers
14 views
Invalid method Mage_Core_Block_Text_List::addJs(Array
Invalid method Mage_Core_Block_Text_List::addJs(Array
(
[0] => varien/product_options.js
)
)
Trace:
#0 [internal function]: Varien_Object->__call('addJs', Array)
#1 [internal function]: ...
0
votes
0answers
14 views
Password Requirement Status - Magento
I would like to create a password status indicator for the customer while registering on my Magento website. Similar to the screenshot below but not the same.
On the registration page, I have the ...
6
votes
2answers
114 views
How to rewrite widget function with mixins Magento 2.1.1
We have swatch-renderer.js
In this file there are some widgets.
....
$.widget('mage.SwatchRenderer', {
....
/**
* @private
*/
_init: function () {
if (this.options....
0
votes
0answers
16 views
Magento multi-attribute configurable needs to hide invalid selections on the front-end
I have a very odd and specific request. I want to hide invalid simple product combinations on my complex configurable product.
To clarify, Assume we have the following product and attributes:
Shirt -...
1
vote
1answer
16 views
Uncaught SyntaxError: return 32 - new Date(year, month - 1, 32).getDate();
I have this code in my magento onecolumn etc. and I'm getting
Uncaught SyntaxError: Unexpected identifier swing-step-brush-guard-flat-black-with-stainless-cross-bars-by-ami.html:3918
On this line ...
1
vote
2answers
50 views
How can I add custom js file and js file in magento 2 using requirejs
How can I add custom js file and compile using requirejs file in magento 2 ?
please give me details for this process.
0
votes
0answers
70 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('...
0
votes
0answers
19 views
Magento2: How to trigger own javascript function in price change
In Magento you can define product price depending on e.g. product options. When the customer chooses product options, the price in product page is updated automatically.
I have added some code that ...
1
vote
1answer
65 views
jQuery ajax data to controller
I am trying to make my first ajax request in magento to controller file but can not get it working. My .js file is:
jQuery.ajax({
type: 'post',
url: 'vendor_module/index/...
0
votes
1answer
23 views
Add Expires headers load from third party url
I am using Magento 1.9.3. I have an issue GT Metrix says "add expire headers" for third party URL.
Looks like bellow in GT Metrix.
There are 4 static components without a far-future expiration date.
...
0
votes
0answers
23 views
magento2 gives 404 when loading text.js from requirejs
I'm facing a problem when applying a custom theme in Magento2. It doesn't find the text.js file in pub/static, as it's not there in fact. The real path of text.js should be en_US/mage/requirejs/text....
0
votes
1answer
34 views
Add js file at the end of merged js file magento 1.9.3
I am using Magento 1.9.3. I merged js and CSS files.
I want to add order or if possible add js file at the end of the merged js file.
is this possible in merged js ?
0
votes
2answers
19 views
Validate Fontend Form
I have the below Calculator Form which I'm creating in Magento that I would like to be able to use Magento's in-built JavaScript validations, even though I need to validate on a button click rather ...
3
votes
2answers
169 views
Price not updating on Configurable products after upgrade to Magento 1.9.3
I think I may have found a bug in Magento CE 1.9.3 which was released last week?
I upgraded our Staging environment to it and have found that the pricing of Configurable products is not updating ...
0
votes
0answers
26 views
Linking Jquery on magento 2.0
I am attempting to link Jquery on one of my blocks on magento admin but everytime I do it breaks all the other JS for the page.
This is what I am using:
Can someone please help?
6
votes
1answer
917 views
Product.OptionsPrice is not a constructor magento 1.9.3
I have upgrade magento 1.9.2.4 to 1.9.3.
I am facing the following error in the console in product page.
TypeError: Product.OptionsPrice is not a constructor
var optionsPrice = new Product....
0
votes
0answers
11 views
Custom javascript for topMenu
Basically, I want to implement a custom script for my top menu. What I want to happen is that when a link in the submenu is hovered over, an image corresponding to that link gets displayed.
I tried ...
0
votes
0answers
20 views
How to repair store after being broken by merging CSS and JS?
I merged my CSS and JS files but it resulted in losing a lot of functionality. The admin panel and basket are basically useless now. I have replaced the root of my site with a backup I took before ...
1
vote
1answer
22 views
JavaScript : All Magento Js to the bottom [Problem]
I have put on my page.xml a new block for add my minify magento scripts to the bottom.
<block type="page/html_head" name="javascript" as="javascript" template="page/html/javascript.phtml">
&...
0
votes
1answer
25 views
how to check all index of table using javavscript in magento
i have created a table in magento with two column id and zip_code. but only [0] index value is fetching. how to fetch value of all index. i am using this code
<script language="javascript" type="...