Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

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

How to customize update Mini-cart individual product price total when qty increased - KnockoutJS

I want to increase product price when to increase qty in Minicart, but here order total increased but price not updated.
1
vote
1answer
1k views

Magento 2 : how to clear selected Value form Custom UI Component select(Dropdown)

Custom ui component select(Dropdown) <select class="admin__control-select" data-bind=" event:{ change: selectOptionCategory(uid)}, attr: { name: inputName, id: ...
1
vote
1answer
3k views

Magento 2 knockout Select options not returning the value

I have Created custom component with select drop down when I select an option and alert the select option it spits out : function observable() { if (arguments.length > 0) { ...
0
votes
1answer
1k 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 ...
0
votes
0answers
7 views

Magento 2 - Braintree Googlepay button missing in checkout

I am trying to add braintree google pay payment method. But getting error in checkout page and google pay button is not showing any content. When I first enabled, it worked for few minutes then it ...
0
votes
0answers
15 views

Magento 2 add custom field in checkout place order

Need to add new custom validation on the checkout page before place order. The place order should work only when the calculation shown above is correct and also to show different values to sum. I ...
1
vote
2answers
889 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: { ...
0
votes
1answer
18 views

Magento 2 how to use phtml jquery events on knockouts js component template?

I'm struggling trying to approach the following objective: Use jquery events on a knockout js component template. On phtml file I have my knockout js component like this: <div class="container&...
0
votes
0answers
17 views

magento2 / Knockoutjs: observableArray not processing change to bindings

My problem: I have a observableArray packageItems linked to my template which works fine on the initial load, but after trying to alter it by a function called from another component, the array ...
0
votes
0answers
30 views

Magento 2: from php plugin to js knockout in checkout

I have created a plugin on Magento\Shipping\Model\Rate\Result that should check on some conditions in the cart's contents. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
0
votes
1answer
21 views

Magento2: JQuery not working because of element binding after load my jQuery

Many times we just need to use simple jQuery on checkout page but checkout element bind with knockout js so our jQuery does not work smoothly. So, how can we call jQuery after bind element??
1
vote
1answer
31 views

How to add Custom Step on Checkout and move Shipping methods in that step In Magento 2.3.5

In this i want one custom checkout step can having only shipping methods inside the step means shipping address and Shipping methods are on different steps on checkout page. So, Please can anyone have ...
2
votes
1answer
1k views

Magento 2 Datepicker in checkout using knockout js

I need a datepicker for every product item that i have in checkout. Below is my code for js file: /** * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. ...
0
votes
0answers
22 views

Modify name in checkout summary?

Magento 2.3.3 I want to add something to the name in the checkout summary. I have a custom checkout extension and it already comes with the DefaultConfigProvider class. In the afterGetConfig function ...
0
votes
1answer
2k views

Magento 2 knockout component scope

I have two knockout components. The xml in layout is: <body> <referenceContainer name="content"> <block class="Vendor\Module\Block\List" name="some_name" template="list....
1
vote
4answers
70 views

How to resolve the Unable save the extension attributes

I followed this link for creating the custom address field. I'm getting this error PHP Fatal error: Uncaught Error: Call to undefined method Magento\Sales\Api\Data\OrderExtension::setCustomerAddrId() ...
0
votes
0answers
8 views

Prevent scroll to top after adding to compare , remains on same position

On my category page there is a compare button , when clicked the page refresh and scroll to top, I need to stay on the same position , any idea? thanks
0
votes
1answer
2k 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
3answers
823 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
38 views

inheritance in knockoutJS components within magento 2's knockout framework

I have been experimenting with a custom module with KnockoutJs on the frontend in M2. I've created two components: a ProductPackage and a ProductPackagePopop. Functionally, the ProductPackage triggers ...
2
votes
2answers
4k 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
2answers
95 views

Magento 2 - Check if shipping cost in cart is 0,00, then change it into text

We would like to check in the checkout cart if the shipping cost is 0,00 and then replace it by text: "free". Therefore I copied the file /Magento_Tax/web/template/checkout/cart/totals/...
0
votes
0answers
15 views

How to modify datepicker input template and js file?

I want to change date input data bind attributes and I don't know exactly which file I should overwrite. I changed these files but output is still the same. map: { '*': { 'Magento_Ui/...
0
votes
3answers
881 views

Magento 2 | Checkout: Change type of field (telephone)

I want to change the input for the telephone field in the checkout from text to number. I looked into it 2 years ago and created this topic on the Magento community forum: https://community.magento....
0
votes
1answer
20 views

How to determine if the user tabbed out of a quantity field using knockout?

I've got a 3rd party module that is showing configurable product details in a grid (i.e. it shows a list of the simple options next to the price of the simple and a qty field, all in a table format). ...
2
votes
1answer
2k 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 ...
0
votes
2answers
28 views

Magento 2: Minicart update product id issue with CustomerData

I am showing a popup on click of checkout when these two products(81, 83) added in the mini cart and this is working fine. Now I have added the 81 products and any other products in the cart. But when ...
0
votes
1answer
34 views

Knockout JS Implementation with Phtml ReferenceError: Unable to process binding

After a lot of search in this forum I have decided to write a question by myself. I am trying to integrate my knockout page into a phtml file in way to update the input layout after a file has been ...
0
votes
0answers
14 views

Magento 2: Modal form submit not working with KO

Modal popup from submit not working after KO binding for input magento 2 I have working on form submit using popup to send email from homepage to checkout for that I have created popup which was ...
2
votes
2answers
2k views

Magento 2 Change Billing Address format from select dropdown to box as the Shipping address format

I want to change the business address format shown in checkout page. By default it is select drop down.How can we change it to the format like shipping adddress is shown. I am new to knockout js. ...
1
vote
1answer
24 views

Magento 2: How to check inarray ids in minicart.js

getCartItems: function () { var items = this.getCartParam('items') || []; _.each(items, function (item, key) { console.log(item.product_id); ...
1
vote
1answer
24 views

Magento 2: I want to get product id from getCartItems function in minicart.js

Here is the function in minicart.js getCartItems: function () { var items = this.getCartParam('items') || []; console.log(items); // want to get product id from ...
0
votes
2answers
2k views

How to observe checked event for different radio button groups?

I have created a new checkout step in which each product is listed along with the option to select which delivery method to use normal shipping or store pickup. I have displayed the product ...
0
votes
1answer
2k views

Magento2 : While bind Custom knockout js to html it return only default value

/app/design/frontend/Vendor/custom_theme/Magento_CheckoutAgreements/templates/additional_agreements.phtml I have this code inside .phtml: <div data-bind="scope: 'checkout-agreements-component-...
0
votes
1answer
16 views

Set value of knockout datepicker from another script file got Error

I'm using Magento 2.4.1 and i successfully add datepicker in checkout page like this: js file define([ 'jquery', 'ko', 'Magento_Ui/js/form/element/abstract', ], function ($, ko, Component)...
0
votes
0answers
16 views

Magento 2 Checkout show Order Summary in popup div window

Good Afternoon All, I am currently working on a small module that requires a copy of the Order summary is shown in a pop-up window after the checkout has loaded. I have been working with the data-bind=...
0
votes
0answers
14 views

How can I insert my custom checkout step form data when place order in quote table and in sales_order table in magento 2.4?

I create custom checkout step with my custom form in that I need to submit three extra field in quote table and sales order table. So, how can I submit this form data in that table when order place. ...
0
votes
0answers
14 views

Magento 2: Where can I edit the Minicart product image template (KnockoutJS template)?

I'm trying to edit the minicart product image template. I found the parent file: /app/design/frontend/Smartwave/porto/Magento_Checkout/web/template/minicart/item/default.html However it uses a ...
0
votes
0answers
30 views

Magento 2 - Check in mini cart if product is virtual

How can we check in the mini cart if the product is virtual using knockout? Inside the cart and checkout we can use the following, but that is not working in the mini cart. Any idea? <!-- ko if: (...
0
votes
1answer
2k views

Debugging Magento Checkout- Property getType of Null, when messing around with Billing and Shipping Address

I am doing some heavy customization on the checkout (pulling billing address to the first position, next to shipping address). If have added a plugin to view/shipping.js: define( [ '...
0
votes
0answers
5 views

Directory not being unloaded after adding it to the exclude portion of view.xml

I added this line to my view.xml file. <exclude> <item type="directory">Lib::knockoutjs</item> <item type="directory">Lib::knockoutjs/kockout</...
0
votes
0answers
13 views

How to call the special price and wish list in the product grid of the module from Adobe Sensei?

How to call the special price and wish list in the product grid of the Magento_ProductRecommendationsLayout module from Adobe Sensei? I am putting together a carousel of recommended products and I ...
1
vote
2answers
2k views

Knockout.js What is the correct way to reference $parent on js file?

I am new on Knockout.js, especially on how to use it in the Magento way. I create a custom ViewModel with a js file called storepickup-select.js and an HTML template called storepickup-select.html. ...
0
votes
0answers
13 views

Magento 2 reutilize components and template.html

I have been searching how can I use ko component inside another ko component and extend in order to create complex forms. I just don't get it how it works. Whit this I was successfully tu extend a ...
0
votes
0answers
18 views

Magento2 UI component focusout event not working

I am using ui component for one the form in admin and for one element i am using component js class to trigger some operations on that element, it only gives onUpdate function, is there anything we ...
0
votes
0answers
20 views

How to get dial code from selected country in textbox before telephone filed using knockout js

I want to develop functionality in that i have created one field for country dial code on checkout page and according to changes of country dropdown dial code will be changes automatically in that ...
0
votes
1answer
48 views

How to add country code dynamically in telephone field on Checkout in Magento 2

I want to develop custom module that is used for adding country code field before telephone field on checkout page in magento 2.3.4.
9
votes
1answer
2k views

Magento 2 : Validate form fields that are loaded with Knockout on blur-event

I have a form that is generated through a .phtml file, and in this form various fields are loaded with KnockOut (using the uiComponent javascript-object). .phtml: <form action="#" class="form ...
0
votes
2answers
75 views

Magento 2 - Create simple hello world script with uiComponent

I try to create my own Component and reuse it. So I created these files: THEME = app\design\frontend\company\fresh Component File: THEME\web\js\elements\custom\input_number.js define([ "...
3
votes
0answers
47 views

How to Make Category tree Auto expand the assigned subcategory tree in edit product form?

I'm using Magento 2.4.1 and have 4 levels category when editing a product in cms it really cumbersome when I need to locate the hierarchy of my product categories because when it first loads it only ...

1
2 3 4 5
15