Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

Filter by
Sorted by
Tagged with
0
votes
0answers
4 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
10 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
11 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
2answers
27 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
57 views
+50

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
40 views
+50

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
26 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
17 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
18 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
23 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
34 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
30 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
26 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
26 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
13 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
14 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
30 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
19 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
26 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
19 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
27 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
11 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
1answer
117 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
48 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
18 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
30 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 ...
0
votes
0answers
17 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
25 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
21 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
35 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
vote
0answers
47 views

How to hide aria-required = “true” field by js in checkout magento 2

I add these fields using custom modules, so that when "Persoana Fizica" is clicked, these fields are hidden and will not affect the magento's data transmission. And when I click on "...
0
votes
0answers
18 views

Magento2 - How to update label for select “region_id” field on the Checkout page?

On the Checkout page, I need to update the label of the "region_id" field like this: If the Country selected is Indonesia, the label of the "region_id" field is "City". ...
0
votes
0answers
23 views

Magento 2 file uploader not working in other theme in frontend

I am using magento inbuilt file uploader component in my theme, I have 5 types of different themes and have called uploader component from one of the custom module, the issue is I cannot see file ...
0
votes
0answers
15 views

How to unselect shipping address on checkout

I would like to know, how can I unselect default shipping address that load when I go to the first step on checkout. My problem is when I'm trying to add new address, I need to unselect any address ...
0
votes
1answer
24 views

Magento 2 - knockoutjs template ignores script tag

I try to add a script tag with a console.log("hello world"); message in the knockoutjs template vendor/magento/module-checkout/view/frontend/web/template/cart/shipping-rates.html This is the ...
0
votes
1answer
28 views

Do you know any good courses/tutorials/blogs?

I am learning more and more about Magento 2 yet I still feel like there is much to learn. I was wondering what good sources/methods of learning the following subjects are. Basics Things like the ...
1
vote
1answer
108 views

<referenceBlock name=“header.container” remove=“true” /> removes minicart functionality

I've added <referenceBlock name="header.container" remove="true" /> to my themes default.xml and instead has been replaced with: <referenceContainer name="page....
1
vote
1answer
80 views

Cart summary_count not updated when “add to cart” is pressed

I'm using the following code to show the total number of items in a users cart: <span data-bind="text: JSON.parse(window.localStorage.getItem('mage-cache-storage')).cart.summary_count">...
0
votes
0answers
37 views

How to reload a component on checkout page when shipping address is modified

I am using Amasty Deliverydate module, this module allows customer to select delivery date and time on checkout step. I am trying to customize this module and we have developed a feature where admin ...
3
votes
0answers
50 views

Magento2 Holepunch Cache for Pricing

I have a Magento 2 website which has been set up to allow customers to have their own pricing. However, as a result of this the FPC (for category and product pages) is now being generated uniquely for ...
0
votes
1answer
143 views

Knockout observable is not accessible inside function

So I am working with Knockout inside Magento 2.3.4, and I am setting a custom observable value on initialize, and then I am trying to access that observable and change the value inside a function. ...
0
votes
0answers
120 views

How to display cart item count in custom header using JavaScript?

I've created a custom header that works fine. I replaced Magento's cart, and instead added a shopping basket icon in the header. Like so: When pressed it redirects to the cart. What I want to do is ...
0
votes
2answers
126 views

How To 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 minicart and i want to show the product Qty as Dropdown and get value from Helperdata. Any help would be ...
0
votes
0answers
17 views

How to hide special price based on a checkbox?

Some people want the ability to hide special price and only show retail price. I want to do this in knockout by adding a class to the parent container. This class will be set based on a cookie that is ...
0
votes
0answers
10 views

Magento2.4 use knockout to identify if user is logged in

I am trying to edit the links in the header.phtml file so that it will show and additional link only if logged in. My issue is it does not seem to work here is my code. The sign up is showing even ...
0
votes
1answer
245 views

Magento 2 Knockout bind on ajax response

I am going crazy with knockout on Magento 2, I am new to knockout and I cannot understand what I am doing wrong. I know there are some related questions posted there but each one is different from ...
3
votes
2answers
121 views

Magento 2 - How does getShippingMethodTitle know the method title in module-tax/view/frontend/web/js/view/checkout/cart/totals/shipping.js

I try to understand knockoutjs and requirejs more but I fail to understand the following case. In checkout the shipping method title is showing in the summary This is the template: vendor/magento/...
0
votes
1answer
23 views

Magento 2 - Pass data to checkout during runtime

I created a new carrier method for express shipping. I need to show a dynamic message which I am generating based on the products in the cart. There are some product categories which are not allowed ...
0
votes
1answer
311 views

Magento 2 - how to add methods to a javascript file by using mixins?

I am using the extension amasty/single-step-checkout. They are using this mixin... vendor\amasty\module-single-step-checkout\view\frontend\web\js\view\shipping-mixin.js (A) ...to extend this magento ...

1
2 3 4 5
15