Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

How to send data from cart page(phtml) to checkout page(html) for each item in knockout Magento 2

I am doing some calculation for final sale in cart page which is phtml, and I have show final sale in checkout page as well for each item. app/design/frontend/Mgs/yx_theme/Magento_Weee/templates/...
0
votes
1answer
50 views

Magento2: Knockout JS page in frontend give “404”

I have followed this tutorial link HOW TO USE KNOCKOUT JS ON A MAGENTO 2 FRONTEND PAGE. Magenest/KnockoutJs/etc/frontend/routes.xml : <?xml version="1.0"?> <config xmlns:xsi="http://www....
1
vote
2answers
31 views

knockout js text bind giving object instead of string in magento2

I am binding knockout js value to html but it's give me [object HTMLLIElement] insteadof value prescriptionList:{customer_prescription_id: "1", customer_id: "23971", customer_name: "Rutvee ...
3
votes
1answer
133 views

How to get helper method value in knockout js

I created this method in helper : public function getMessage() { return $this->scopeConfig->getValue(self::XML_ERROR_MESSAGE); } I need to display above output in knockout js. ...
2
votes
1answer
262 views

Magento 2: How can get value input with knockout Js?

<input type="hidden" name="test" value="test"/> i want using ko get value of input. my component define([ 'Magento_Ui/js/form/form', 'jquery', 'jquery/ui' ], function(Component) { ...
-1
votes
1answer
45 views

Magento 2: How can write jquery in html file?

I try it but not working with html file <script type="text/javascript"> require(['jquery', 'jquery/ui'], function($){ jQuery(document).ready( function() { alert("Page loaded."); }); }); ...
4
votes
1answer
187 views

How to update checkout/cart/ orders total when promo code is applied dynamically without page reload

I have changed my checkout/cart/ page promo code to ajax call so that it doesn't get reloaded, while on the success of that ajax call, I have to update the total price summary dynamically without ...
1
vote
2answers
330 views

magento 2 How to get dropdown selected value in knockout js on button click

i have my custom payment method in checkout page with dropdown list. and i want to get that dropdown selected value in knockout js and forward it to controller and store dropdown value in my custom ...
0
votes
0answers
62 views

How to get url parameter in knockout js in checkout/index/index/#payment page

I am trying to replace my custom payment method's button called "submit request" to "place order" button when the status is approved. I send status in URL parameter and now want to get it in knockout ...
0
votes
0answers
43 views

Adding custom/extension attribute to shipping/billing address :: js set-shipping-infromation-mixin.js error

Magento 2.3.1 I referred to following link for adding a custom/extension attribute to shipping address https://devdocs.magento.com/guides/v2.3/howdoi/checkout/checkout_new_field.html However, when ...
0
votes
1answer
154 views

Use new field “Full Name” to replace “First Name” and “Last Name” in Checkout

My idea is to use to add a new field called "Full Name" and it will fill out the "First Name" and the "Last Name" while you type in the checkout. I have almost everything ready but I can't let know to ...
0
votes
1answer
91 views

Get config value in html using knockoutjs

I am trying to get config value to html file. My aim is to check if the config value is enabled of it is show a button and if it’s continue normally with out button the button. I am not sure how to ...
1
vote
1answer
59 views

Knockout Js get value from Config

I want to see if my module is enabled in config are through html using Knockout JS. ko if: module_enabled ==1 show a button if not don't show a button But i get this following error Uncaught ...
1
vote
0answers
34 views

Need somehelp get data from checkbox in checkout

I have used Aheadworks_OneStepCheckout and I added some checkbox. However, I can't get the value of the checkbox. My code: /** * Copyright 2019 aheadWorks. All rights reserved. * See LICENSE.txt ...
0
votes
1answer
51 views

Add custom data-attribute inside script tag of custom JS

I would like to add a custom data-attribute to a javascript injected in the frontend area using a custom module. My custom javascript is inserted using var config = { map: { ...
1
vote
1answer
24 views

How to remove 'clickability' from a SPAN element during Checkout

I'm developing a new Magento 2 eshop in Germany. During the Checkout steps, www.mywebsite.com/checkout/#email in my Sidebar, we see a presentation of the costs and a breakdown view with taxes, Pfand, ...
0
votes
0answers
19 views

Call a function when all checkout shipping address fields are rendered on

I'm customizing Magento 2 checkout. I intend to call a javascript function when all checkout shipping fields are rendered, so I customized the form.html with afterRenderAll on foreach block and ...
0
votes
0answers
15 views

Render UI-component through block

I'm quite new to Magento's front-end and could not find any results on what I'm looking for. I currently have a table which contains many rows and need to render a ui-component button for each each ...
0
votes
1answer
27 views

Questions about using knockout

I would like add a feature to show a data like the "Welcome username". So i searched about how it works and i followed this tutorial I'm blocked because i'm always getting the error unable to process ...
1
vote
1answer
35 views

Magento 2.3 - Category Page in CMS blank amongst other errors

Experiencing some weird behaviour in Magento 2. It's 2.3.1 (recently upgraded from 2.2.4 but it we only started experiencing it after migration). Issue 1: When visiting a category page in the CMS, ...
0
votes
2answers
133 views

magento 2 unhide any messages

As per default Magento 2 behavior, any message like success, error or notice, etc hide after 5 seconds. I don't want to hide any message so that user can read message. See below image that display ...
0
votes
0answers
14 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(){...
2
votes
4answers
154 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
1answer
19 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 ...
1
vote
0answers
48 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
0answers
28 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
53 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
219 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
293 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/...
2
votes
0answers
21 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
119 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 ...
2
votes
0answers
22 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/...
0
votes
1answer
182 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
1answer
40 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 ...
1
vote
0answers
34 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
118 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
1
vote
1answer
48 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 ...
0
votes
1answer
67 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
2answers
192 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 ...
0
votes
1answer
33 views

magento2 checkout summary page refresh on click redio button event

I want apply different charges with customer group on-click radio button via ajax summary part refresh in checkout page.If anyone know reply me.
2
votes
1answer
88 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
153 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 ...
1
vote
1answer
241 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="...
1
vote
1answer
37 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 ...
2
votes
0answers
56 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
65 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%...
2
votes
1answer
194 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). ...
5
votes
2answers
231 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
1answer
180 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 ...