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 [knockoutjs]

Denotes questions related to Knockout use in Magento2

1
vote
1answer
555 views

Get customer chosen shipping method with jQuery

How could i find out the shipping method that the customer has chosen right after click of change? I have tried to get shipping methods id or value that customer has chosen when he/she has clicked ...
4
votes
3answers
3k views

Magento 2 - Add CMS Static Block to Checkout Address Form

Evening All, I am looking to add a static CMS block to the Magento 2 Checkout delivery address form. I would like display the CMS block under the phone number field. The old method would have been to ...
1
vote
0answers
21 views

Pass data from Helper Data to Knockout JS file Magento 2

How i can pass helper data to Knockout JS to show it on my html file. Actually i am working on Checkout page and i want to show the name of product owner on checkout summary. Any help would be ...
0
votes
1answer
920 views

magento 2 payment method does not show up in checkout page frontend

I'm trying to implement a new payment method with Magento 2 , so i have implemented the below code to display the payment method as an option within payment methods list , however the issue is "...
7
votes
1answer
1k views

how to load or add js before require js in magento 2

I am trying to override default_head_blocks.xml like below vendor\magento\module-theme\view\frontend\layout\default_head_blocks.xml <?xml version="1.0"?> <!-- /** * Copyright © 2016 Magento....
2
votes
4answers
54 views

How to override both shipping.html and shipping.js file in custom module magento 2

override both shipping.html and shipping.js I am trying to override shipping.js file in magento 2 but can not working. requirejs-config.js var config = { paths: { 'Magento_Checkout/template/...
0
votes
0answers
8 views

Unable to edit custom options in configurable product (JS error)

When I try to edit a configurable product I get this error in console (after clicking the Custom options tab) : knockout.js:3012 Uncaught TypeError: Unable to process binding "afterRender: function(){...
0
votes
1answer
11 views

“Field is required” error once I make selection on custom ui-select

I'm currently making a custom ui-component for the adminhtml form which extends the default ui-select element. But the issue is that when I make a selection on this new ui-select all fields have their ...
0
votes
0answers
19 views

How do I render an external template in ui-component?

I'm making a UI-component table that displays different types of fields which allow the user to manipulate the data of a given row easily. I got to the point where I need to get, render and display ...
0
votes
0answers
28 views

Magento 2 checkout page js error

Checkout Page JS Error :- Unable to process binding "mageInit: function (){return {'collapsible':{'openedState':'active','active':isItemsBlockExpanded()}} }"
0
votes
0answers
18 views

How to show new shipping address modal form below list of shipping addresses?

I am completely new to magento ui-components and I don't know how to use them to make frontend changes. I am adding screenshot below to show what I am trying to achieve. Recently I have a task in ...
1
vote
1answer
1k views

Knockout JS removes jQuery change event

I don't know if it is specific to Magento 2 but an already set up HTML node with jQuery change event attached to it will lose its change event when run inside a knockout component with attached VM (...
1
vote
1answer
21 views

Unable to process binding click: function()

I'm trying to implement a click event in one of the button I added under the Magento_Checkout module specifically under payment.html view. Now I added the below code File location: app/design/...
1
vote
0answers
13 views

UI Components - pass ids selection to listing selection

How do i pass a selection of ids to an insert-listing component to preselect certain rows. I have a dynamic rows component with entries related to the current product I'm editing. When click on a ...
2
votes
1answer
19 views

Magento2 custom Knockout binding

I am working on a customization of the checkout page in M2, in particular I am trying to add to the 'discount' section of the page. In this part of the page I need to call a third party javascript ...
11
votes
4answers
4k views

How to specify skin image path in Knockout HTML template?

I'm trying to add an icon image in the Magento_Paypal/web/template/payment/paypal-express.html template. The icon is located in web/images. I would like to use the equivalent of the following code, ...
2
votes
0answers
12 views

Magento 2: i need update order summary when click custom option payment method checkmo

need to know is how to update the order summary like reloading the component when we do something like choosing a select payment terms My code: view/frontend/web/js/payment/method-renderer/...
1
vote
1answer
1k views

magento 2 get value of selected select box using knockout in custom module

I have created custom module , in which I have created front end template form using knockout js. In form I have created a select box. I want selected option value in form post method and save that ...
5
votes
1answer
1k views

Magento 2: shipping methods not updated on changing of checkout fields

In the past when I fill one of the checkout fields then shipping method section under the checkout page refreshed and then updated like this: But now shipping method not updated by calling ajax (or ...
1
vote
1answer
32 views

Get changing variables from Magento block in knockout js

Want to pass entityId to the getInfo method: This block.phtml is on the catalog page (list) that gets called per Item on the page and sends each entity id to the getInfo method. The getInfo method ...
2
votes
2answers
2k views

Magento2 Knockout js - issue on cart

I tried to reposition my cart block to a other header location. Since then I am getting this javascript error which is annoying since I only repositioned a block. Uncaught TypeError: Unable to ...
0
votes
1answer
24 views

magento 2 how to override select-shipping-method.js

when trying to override select-shipping-method.js in my custom module then getting this errors 1 - Uncaught Error: Script error for: Xyz_Customcheckout/js/model/quote http://requirejs.org/docs/...
1
vote
0answers
18 views

Magento 2 what is “each” argument and how it works? [duplicate]

what is "each" argument and how it works ? <each args="getRegion('address-list')" render="" /> <each args="getRegion('address-list-additional-addresses')" render="" /> If anyone knows ...
1
vote
2answers
32 views

How can you get the config value in html

I want to know if you can get the config value to html I have a class which provides the value for config Not sure how to get this checked in HTML I have been looking at configproviderinterface
0
votes
0answers
20 views

What is the purpose of “configSource” in layout

What is the purpose of using "configSource in file "https://github.com/magento/magento2/blob/0eb8677b0b4e35606032e856cc1ef7c80e68829f/app/code/Magento/Captcha/view/frontend/layout/default.xml
3
votes
2answers
557 views

Magento 2 - Add success message with knockout

I need add an errorMessage or successMessage on checkout/cart after an jquery validation. I tried require file 'Magento_Ui/js/model/messageList' for this but not have success. My code: define( [ ...
1
vote
0answers
69 views

Magento2: custom javascript not called when using with text/x-magento-init

In list.phtml (product listing) I am showing requistition lsit for every product using type="text/x-magento-init" in loop as: <script type="text/x-magento-init"> { "*": { "...
7
votes
1answer
2k views

Magento 2 Add to cart frontend event listener

I am trying to find good solution to execute custom javascript when product is successfully added to cart. Also this custom javascript need information about product that was added to cart (sku, qty, ...
1
vote
1answer
34 views

KnockoutJS Which Model does the Minicart use?

So, i'm very new when it comes to using KnockoutJS but i've been doing some reading around it and to my knowledge each template file has its own corresponding model. However, as i'm looking through ...
1
vote
1answer
58 views

Knockout js : Read parent of parent's data

I want to read the parent of parent elements data. But, I can't able to read it properly. My Array Screenshot : My Code : <!-- ko foreach: { data: Object.keys($parent.optionParam()[main_id]), as:...
4
votes
2answers
88 views

Magento 2 : How to debug knockoutjs getRegion() bindings

Shipping address is displayed using below knockout js code. I am having a hard time finding the back-end code that's setting data for getRegion('ship-to') function even though I could see the UI JS ...
1
vote
2answers
73 views

Use Jquery in KO Js Magento 2

On checkout page i want to hide summary component by default. and when a user clicks on a button i to show that Summary section. The Summary section is build through XML and KO. My Question is, Can i ...
2
votes
1answer
63 views

Magento 2 : Which view model or Observable pulls shipping address data on payment page?

I see that following code from shipping-information template is used to display shipping address on checkout#payment page but unable to understand which Magento 2 PhP Model or knockout view model is ...
0
votes
1answer
26 views

Loop in KO magento 2

i have created steps on checkout page and every step has number like 1 2 and 3 now i want to create those number through a loop like $i = 1; $i++ how i can do this in KO Js. image is attached ...
1
vote
1answer
901 views

Validation Error with jQuery-UI Autocomplete and KnockoutJs - Magento 2

The Problem: I've implemented jQuery-ui Autocomplete with Knockout Js in Checkout Page but some input fields that are binded to my Component throw a validation error ("Required Field") when i update ...
5
votes
3answers
8k 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
0answers
16 views

magento2 checkout summary page refresh on click redio button event

I want apply different charges with customer group onclick redio button via ajax summary part refresh in checkout page.
4
votes
1answer
984 views

Magento 2.1. How to display select box instead of box in checkout shipping address?

As checkout page layout is mostly build in knockout.js and I have zero knowledge of knockout.js. I want to show shipping address in select box <select> instead of Box (ref to image - section 1) ...
0
votes
2answers
651 views

Binding Events On Dynamically Generated DOM Elements Knockout + Magento 2

I am working on a module where i have generated few DOM elements dynamically. But when i am trying to call certain function on some events then its not getting called. Here is the code sample. Here ...
1
vote
1answer
26 views

Clicking on product color triggers change in all products

I want to show the product's special price in the catalog but I am getting an error when there is more than one product with a discount. One color product's click triggers a change in all catalog. I ...
1
vote
1answer
53 views

Why data bind template is not working on 2.2 or greater?

I was studying about Knockout.js and how it works with Magento 2. Then I reached the topic: template integration, in the first sample of it I'm presented to this notation: <div data-bind="...
0
votes
1answer
64 views

Adding link to the Checkout button in magento2

I need to add external link to the "New Address" button in checkout. Found the button html is loading from this file. vendor\magento\module-checkout\view\frontend\web\template\shipping.html How ...
0
votes
1answer
181 views

Magento 2.2.5: Custom checkout

I'm working on Custom Checkout Module. I've Created a Custom module follow this devdocs: https://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_customize.html and everything is working ...
2
votes
1answer
55 views

Magento 2 I Want to add Dropdown Quantity Box In Minicart

I am trying to replace Dropdown instead of text box at Quantity at Minicart. I tried following code but didn't get success ( i am trying direct in Magento Vendor folder for testing purpose). ...
2
votes
0answers
38 views

Force quote_address instead of customer address when browser is refreshed Magento 2

I am having hard time understanding how below code is getting shipping address data for display on checkout/#payment page. It displays correct address when we go from shipping to payment page but ...
0
votes
0answers
28 views

knockout.js:2624 Uncaught SyntaxError: Unable to process binding "ifnot:

Any help regarding to this. i installed porto theme on magento 2 there was first installed luma theme everything was working fine. GET https://cellphonepartscanada.com/%7B%7BMEDIA_URL%7D%...
0
votes
1answer
617 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 ...
1
vote
1answer
60 views

Magento 2 checkout page add class to shipping method on click event

I want to add "active" class on shipping method selection. Means If I change shipping method then "active" class automatically added to newly selected shipping method and removed from the old ...
4
votes
1answer
695 views

Uncaught TypeError: Cannot read property 'apply' of undefined at Function.ko.observableArray.fn.(anonymous function) [as push]

I have created a custom attribute(multiselect) for product with the same filter type as category selection on Magento 2. Attribute selection is working fine when creating a new product however it is ...
1
vote
0answers
18 views

Address list at billing step

Hello Magento community this is my first question so go easy on me, I will try to be as accurate as possible but I am a noob front-end with Magento. What I am trying to achieve is: when user buys ...