Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

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

Minicart component not working after 2.4.5 upgrade

After recently upgrading a magento 2 install from 2.3.3 to 2.4.5 I'm having problems with the minicart UI Component not rendering anything. After some investigation, it appears that component is ...
  • 1
0 votes
1 answer
12 views

what is $parent in knockout Js Templates?

I am unable to understand what is $parent in Magento html templates Especially in the context of detail.html <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for ...
  • 388
0 votes
0 answers
11 views

Pagebuilder - knockout master.html rendered wrong on custom component

In my master.html for a custom pagebuilder component, the "data" binding is not available. I always get an error that it's undefined in frontend. But it's working fine in preview.html ...
  • 158
0 votes
2 answers
14 views

How can i bind foreach data function to some observable array so that on changing the array values KO Foreach section also gets updated

Foreach Data Function getAvailableMethods <!-- ko foreach: { data: getAvailableMethods(), as: 'item' } --> <label style="position: relative;top: 2px;" data-bind="attr: {'for': ...
  • 118
1 vote
1 answer
9 views

Knockout template : how to provide function parameter/s for looped object, also function call 'is not defined'

I am trying to edit an existing payment method module template: This is a looped object option (which is information about the current loop iteration payment method). The original template loop: <...
1 vote
1 answer
8 views

Get System Config Values in JS file without use of phtml

I want to get System Config Value in my JS file directly without using phtml template. thanks in advance.
0 votes
0 answers
16 views

Magento 2.4.1 disable shipping method selection until email, name and address fields are filled and validated

Good Afternoon Everyone, I need to disable the the selection of shipping / delivery options until the address fields have been filled in and validated. I would like the customer to have filled all ...
  • 166
0 votes
0 answers
17 views

How to show system admin configration message on checkout?

I have created system.xml file and passed value from config.xml file want to show that value message on checkout page.like this
  • 33
0 votes
1 answer
83 views

Change Checkout Billing Address dropdown to list view

I want to change billing address drop down in checkout page similar to shipping address view list template. I have tried the following code in app\design\frontend....\Magento_Checkout\web\template\...
  • 43
0 votes
1 answer
98 views

Magento 2.4.2: Unable to process binding "ifnot: function(){return customer().fullname }" Message: Unable to parse bindings

The following error is found during the process of upgrading Magento from 2.4.2 to 2.4.4 in console. Uncaught SyntaxError: Unable to process binding "ifnot: function(){return customer().fullname }...
1 vote
0 answers
18 views

Region Text is not passing along with form

I have created magento admin form using Uicomponent with country and state everything working fine except region value is not passing along with form.This happens only when there is select box ...
  • 164
0 votes
1 answer
25 views

Uncaught SyntaxError: Unable to process binding "ifnot: function(){return customer().fullname }"

Upon successful Magento upgrade to 2.4.4 from 2.4.2, I noticed the following error in browser console as site loaded. I don't see any references to this error message on the net nor in SO. Could you ...
0 votes
0 answers
24 views

Magento 2.4.2: How to add a Div next to Amazon Pay button in checkout page

I need to place a logo(A credit card image) about the same size of Amazon Pay button next to it where I made a mark in the image below. When viewing the code in Amazon_Pay\web\template\checkout-button....
0 votes
0 answers
24 views

How to edit KnockoutJS template in cart page?

I need to add some text after "Gift Options" title in the cart page. The jQuery code written to do this doesn't work because "Gift Options" field is added with Knockout JS. Shown ...
1 vote
2 answers
60 views

sales_order_save_before etc/frontend/events.xml not working properly

I've used the sales_order_save_before event scope is etc/events.xml - This is working fine but, etc/frontend/events.xml not working properly. sales_order_save_before event not support frontend scope?
0 votes
0 answers
22 views

Magento2 checkout page gets broken if logged in?

I'm in Magento2, and I've build up a new theme for the checkout. I've added a new step: In app/code/Checkout/NewStep/etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="...
  • 13
0 votes
1 answer
52 views

Get order data with customer details in custom checkout page magento2

I have create custom checkout Step between shipping and payment step . Now i want to show all the order details and customer fillup details. Below is the files that i have created for the Custom ...
  • 1
0 votes
0 answers
31 views

My billing and shipping address are the same in payment page doesn't checked when state or country is changed

My billing and shipping address are the same checkbox on the payment page that remains unchecked while I am going back to the shipping page and selecting a different country or state and pressing the ...
  • 11
0 votes
1 answer
25 views

On CMS block render by identifier, it brings wrong localization

I'm trying to render a CMS Block, to pass rendered HTML to jsLayout, on updater I have two CMS blocks, with same name, but for different store fronts (based on store front, the language is different). ...
  • 1
1 vote
1 answer
241 views

How to get Data from system.xml file

I created system.xml file where seller can select multiple options (e.g Days of the week). Now i need to use that data in checkout page as . Where customer can select one option (e.g any day from ...
0 votes
1 answer
25 views

call function inside ko.bindingHandlers knockoutjs

I'm trying to call a custom function inside the initialize ko.bindingHandlers function but getting the below issue. Message: Cannot read properties of undefined (reading 'tConvert') My code for ...
  • 828
0 votes
0 answers
22 views

how to get store name display in a shipping method

I'm new here, please help. when you click shipping method a display of store view name show below using knock out js to display.
0 votes
0 answers
111 views

Knockout DateTime Picker - how to set custom Default Date

I have added a date-time picker in my custom form using the below code in HTML file. <label class="label">Delivery <div class="control"> <input ...
1 vote
1 answer
165 views

Insert child UI component inside existing one

I have 2 modules where each one has an UI component on frontend. Module A contains the main component and component of Module B should be displayed inside the component of module A. I'm not ...
  • 96
1 vote
0 answers
61 views

Magento 2: this.performPayment() not working from callback function payment js

I am creating a payment module, but I am getting issue in my payment js,My js code is below: app/code/Namespace/Magento/view/frontend/web/js/view/payment/method-renderer/abc.js define( [ ...
0 votes
0 answers
99 views

html template is not rendering in modal of admin side in Magento 2

I am trying to load the HTML template in the modal of the admin side in Magento 2 but unfortunately, the HTML template is not rendering in the modal but it's working outside the modal. I am loading ...
0 votes
0 answers
36 views

Checkout After uncheck billing same as shipping checkbox Billing address form is not displaying

In Checkout after unchecking My billing address same as the shipping checkbox, then not able to add a new address or not show any billing address form. Please help.
0 votes
0 answers
76 views

Magento 2 remove loader/spinner from the checkout input fields

in Magento 2 checkout page whenever we update or change any input field it triggers an ajax call with the loading spinner. I want to remove that loader spinner on the selected input field. But not ...
0 votes
2 answers
65 views

How to extends checkout-loader.js

I am using magento 2.3.5-p2 I want to add an event without modifying the core codes of checkout-loader.js which are located here vendor/magento/module-checkout/view/frontend/web/js/checkout-loader.js ...
0 votes
1 answer
43 views

Get product data from wishlist_id in wishlist.js

I am using Magento2.3.5-p2 In vendor/magento/module-wishlist/view/frontend/web/js/wishlist.js I want to be able to get the product data from the wishlist_id the code is like this _beforeAddToCart: ...
0 votes
1 answer
185 views

How to remove out of stock items from the minicart in magento 2?

scenario- when the user doing his shopping he added some products to the basket, that are shown in the minicart by default. But when the click on mini cart (or) when the user refresh the page i need ...
  • 57
0 votes
1 answer
460 views

Understanding data bind at minicart in magento 2

I am using magento 2 in mini cart, I am trying to get the event during which product is being added and removed, a specific item not by cart shown is the item that exists in mini cart, I want that ...
0 votes
0 answers
14 views

knockoutjs set value in another function

I'm trying to set the value inside another function but it's not working HTML Code as below: <!-- ko if: isDisplayedCustomdiscount() --> <tr class="totals customdiscount excl"> ...
  • 7,386
0 votes
1 answer
57 views

Custom Knockout template not picked in checkout - Magento 2

I wanted to show a message on checkout page (above the 'complete checkout' button) only if customer is on certain store views (id_id or id_en). Here what I have done so far. Please help me to find ...
  • 132
0 votes
1 answer
143 views

jQuery listen to ko data bound input

I have a component with for a "quantity changer", comprising of an input field and plus/minus buttons. The input and buttons are connected via data-binding on a KO observable. This works as ...
  • 121
0 votes
1 answer
143 views

How to disable a knockout generated dropdown option by default

I am trying to disable a certain option of select generated from knockout on the checkout page. I tried what was mentioned on the knockout documentation i.e. to call optionsAfterRender. But this gives ...
  • 107
1 vote
1 answer
1k views

How can I access the selected value when bind a change event using knockout JS in Magento 2

Knockout Template <select data-bind="event:{ change: permissionChanged}"> <option data-bind="i18n: 'Yes', value: 'yes'"></option> <option data-bind=&...
0 votes
0 answers
10 views

I have to catch the KO variable's value spontaneously on the checkout page for postcode in order to call ajax request as soon as 6 digits are complete

I want to fire an ajax request as soon as the postcode variable completes 6th digit of postcode number in order to call ajax request to api to populate the city and state fields. I am getting the ...
0 votes
0 answers
32 views

Magento 2 displayArea component not working

Hope someone can help me I have a custom checkout_index_index.xml layout so I can show my own components on checkout, I'm trying to get 2 different components like this: <page xmlns:xsi="http:/...
0 votes
0 answers
87 views

Magento 2 how to access external JS variables and functions in my html template?

I need to access to an external javascript variables and functions so the template does not throws error. I have my template.html template doing this: <!-- ko template: "Vendor_ManualShipping/...
0 votes
0 answers
100 views

How i can change email validation magento 2

When customer go to create account (phat : /customer/account/create/) the email validation fail in this case daniel@example.cm, how i can change this validation to improve this ?.
0 votes
1 answer
299 views

Magento 2 - Use knockoutjs and html instead of phtml

How can I use html and knockoutjs on a custom site which is accessible from a custom controller? For example my controller route is threepartment/vault/index If I go to: www.example.com/threepartment/...
  • 2,541
0 votes
2 answers
73 views

how to override elementTmpl for billing address fields properly in checkout_index_index.xml?

I would like to change the way the company field is rendered in the billing address and I'm trying to apply a new elementTmpl that I've defined and works well for shipping address fields. Here's the ...
  • 531
0 votes
0 answers
68 views

Error on Payment Method

When I try to load first time the checkout page the following error is shown on the console My Tabby payment method is not being loaded at the payment method section when I again reload the checkout ...
0 votes
1 answer
165 views

Magento 2: Custom Checkout Field Validation

I have a module already built for ExtraFee, I just want to add the checkbox below for terms & conditions so I found a template and added a checkbox like this: <div class="field amexfee-...
0 votes
0 answers
19 views

How do I add javascript code to handle callback events after submission of coupon register?

I am using Magento 2.3.5-p2 I am required to trigger a javascript code as below once a user has successfully registered their coupon dataLayer.push({ 'event': 'trackEvent', 'eventDetails.category': '...
0 votes
1 answer
26 views

Extend Core Js File in magento2

I want to extend vendor/magento/Magento_Customer/view/frontend/web/js/address/js to my custom module.Please help
0 votes
0 answers
16 views

How to modify the shipping-address form only at specific locations?

I modified the shipping-address form following this guide to show a legal text on top of the form: Add new field in address form I used a text field with a default value that gets translated for ...
  • 17
0 votes
0 answers
7 views

Render content on the fly based on current quantity - Product View Page

So I have a product view page, I want to get the current quantity (e.g. onChange()) of the product and then pass it to the PHP class to perform some calculations. After calculation, I want to render ...
0 votes
0 answers
174 views

How to get cart subtotal and subtotal in checkout shipping page?

I want to show cart subtotal and subtotal on Magento 2 shipping page How to do that? I have extended the file in my child theme but how to get these price details can anyone help me. app/design/...
  • 576

1
2 3 4 5
16