Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

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

Magento 2.4: How to display attribute option frontend label with KnockoutJs?

How to display attribute option frontend label with KnockoutJs when creating configurable product variations in step 2? Current Color option label is displayed: module-configurable-product/view/...
2
votes
1answer
50 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 ...
1
vote
4answers
93 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
16 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
1answer
24 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). ...
1
vote
1answer
70 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 ...
0
votes
2answers
180 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
2answers
34 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
116 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
19 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 ...
1
vote
1answer
28 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
30 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
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
25 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
15 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
16 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
6 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
58 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
0answers
15 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 ...
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
30 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
23 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
150 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.
0
votes
2answers
89 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
52 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 ...
0
votes
1answer
37 views

Magento 2 how to send information from Knockout Js to Js component?

I'm trying to send an array of data from a Knockout Js component to a JS file so I can do an ajax request there. Here is what I'm doing: phtml: <div class="container"> <div class=&...
0
votes
0answers
14 views

Magento 2 How to send data from one html template to another?

I'm developing 2 forms with knockout js and html template. This 2 forms templates need to be separated, however they share data in common, for example, coverages amounts (this templates are about ...
1
vote
0answers
23 views

Magento 2 - How to override knockoutjs template which is already overriden from a third party module?

I try to override the knockoutjs template vendor\amasty\module-single-step-checkout\view\frontend\web\template\checkout\summary\item\details.html from my own Theme. The module amasty\module-single-...
0
votes
0answers
20 views

Magento 2 send data from html template to Controller without Ajax

So I have created a component which has 2 templates, but the property data is the same for both. I wanted to know if there is a way to send data without using ajax. Why? Because I don't need to use ...
0
votes
2answers
169 views

Update data in block template using knockout js

I'm at a dead end. I'm trying realise custom pagination on frontend page. So, hear my code in modulename/view/frontend/web/js/blog.js define([ 'jquery', 'ko', 'uiComponent', 'domReady!'...
0
votes
1answer
36 views

Get order data afterPlaceOrder on checkout page

Im trying to get the order increment id after success place order is triggered. This is my method-renderer file: define( [ 'Magento_Checkout/js/view/payment/default', 'Magento_Checkout/js/...
1
vote
1answer
97 views

Magento 2 How to close Dropdown Dialog on click

I have added dropdown dialog using bellow code <div class="block block-demo-dialog empty" data-role="dropdownDialog" data-mage-init='{"dropdownDialog":{ ...
0
votes
0answers
33 views

place order issue in onepage checkout knockout js magento 2

By selecting an existing shipping address in the checkout I am not able to place an order.
0
votes
1answer
35 views

Method which triggers after change in shipping address

Is there any knockout method which is triggering after update/edit shipping address on checkout ? to be in details what I want to achieve is based on city enter, I want to show custom content. All ...
1
vote
0answers
15 views

How I change the modal of adding address at checkout magento 2?

Currently the modal that I want to change is as in the image. And where Line 1, Line 2 etc. is written, this is where I want to change, but this modal is done through the knockout and I can't find a ...
0
votes
0answers
20 views

Magento2 ui component binding issue for file uploader in knockout template

I am using knockout file uploader in one of checkout step, please check below screenshot: below is my code to initialize file uploader but somehow its not working: <div class="reference-...
0
votes
1answer
145 views

Uncaught TypeError: Unable to process binding "datetimepicker: function(){return true }" datetimepicker is not a function

I am getting the error knockout.js:3381 Uncaught TypeError: Unable to process binding "datetimepicker: function(){return true }" Message: $el.datetimepicker is not a function Below is my ...
0
votes
0answers
24 views

Random JS errors on Magento 2.4.1

I am getting Random JS errors on a website built with Magento 2.4.1 and Apache2. Tried many solutions but no luck. Here are the some screenshot attached. I am using Magebig Martfury theme. Did ...
0
votes
0answers
37 views

How to make radio button active on load?

I have a few radio buttons on the checkout page, I want one of them to be checked on page load. How can I do that? <input type="radio" name="payment[method]" ...
0
votes
1answer
248 views

Mageto2 error Uncaught Error: You cannot apply bindings multiple times to the same element

I am getting following erro knockout.js:3277 Uncaught Error: You cannot apply bindings multiple times to the same element. Below is the code var instance = new viewModel(initialData); ...
0
votes
2answers
29 views

NaN in Knockout Template

I am using Knockout as a View Model to fill values of my view template, It is working fine for all except one function getConvertedTotal is returning NaN. define([ 'ko', 'uiComponent', 'mage/url', '...
0
votes
0answers
64 views

Magento 2 product page , Safari mobile view only JS Issue

I'm having a weird issue on my magento 2 website on product page only on safari mobile view! when I add any js file as follows in global-footer-js.phtml (this phtml I call in default.xml as it should ...
0
votes
2answers
375 views

Datepicker not working in Magento 2.4 frontend

I am trying to add datepicker in Magento 2.4 frontend checkout page. But its giving following error - knockout.js:3381 Uncaught TypeError: Unable to process binding "datepicker: function(){return ...
0
votes
1answer
128 views

Customise message.phtml pop up message magento 2

I want to change the message.phtml template file which renders a pop up message below on product page. Im not sure where in the KO.js binding message html to change "My new message" Here is ...
0
votes
0answers
20 views

Magento 2 - How to customize "new address" form in checkout?

In magento you can add a new address during the checkout process. I need to add a little text at the position seen in the screenshot: I can't figure out how this is done. I've read through the ...
0
votes
1answer
96 views

Magento 2 - How to add logo and link to payment method in checkout?

I am using Amazon Pay. Currently it looks like this in the checkout: I need to add a logo and a link pointing to the info page about amazon pay: I solved it with a workaround by adding a javascript ...
1
vote
0answers
44 views

Magento 2 uiComponent multiple instance

I have a view with two templates that use the same uiComponent with Knockout Js. I spent hours trying to discover how to do not share the observables between two different templates. example: <div ...
0
votes
0answers
36 views

Magento 2 - Ko Js - Multiple Instance of component in the same page

I am trying to add two templates with the same component, but i need that each template do not share observables and computed this with the other template. I need each one have it own instance of the ...
0
votes
1answer
73 views

How to Get Custom Product Attribute In Sensei Product Recommendation

How to get custom product attribute in Adobe sensei product recommendation slider. It is a B2B Module Sensei Magento2 Product Recommendation Kindly Share your Answer. Thanks in advance.
0
votes
0answers
48 views

Magento 2.4 - Express Checkout - Shipping Address Error

A fresh install Magento 2.4.x + theme, but having some issue related to express checkout, as seen from below picture on red-box area. The form has missing some elements, like firstname, lastname etc. ...

1
2
3 4 5
16