Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

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

Magento 2.3.5: custom item renderer for checkout review step (access template view model from within uiComponent)

I'm trying to build a custom item renderer intended to gather all configurable child items for an "user-friendlier" display. I finally did it for cart and minicart contexts, but I'm ...
0
votes
0answers
8 views

Magento 2 Checkout shipping afterRender

how to add afterRende to a form (page checkout shipping).I am using setInterval to check form is loaded, but it's a very bad idea.
0
votes
0answers
22 views

how to add quantity increment and decreament (+ and - button) in cart summary magento 2?

I want to add increment decrement functionality in the checkout page how to achieve this
0
votes
1answer
29 views

Magento 2 - How to get quote shipping method in knockout js?

In Magento 2 I try to get shipping method in this js file : vendor/magento/module-checkout/view/frontend/web/template/billing-address.html I try this : quote.shippingMethod()['method_code']; And I ...
0
votes
1answer
28 views

magento 2.3.3 konckout translation doesn't work

Hello I have the official stripe module for magento 2 which is not trasnlated correctly. This is the piece of code: <span><!-- ko i18n: 'Use a new card'--><!-- /ko --></span&...
0
votes
0answers
38 views

Check if default billing address in checkout - Magento 2.3

Inside the checkout /app/design/theme/theme/Magento_Checkout/view/frontend/web/template/shipping.html file I would like to check if the customer does have a default billing address. Is there a ...
0
votes
0answers
12 views

Magento 2 need to add new component Form on checkout step shipping which appear on selected shipping Method

I have some issue to add a new form on shipping checkout step . Form visibilty depends of the selected shipping method. and on submitting shipping steps my form should be submitting and my data should ...
0
votes
2answers
20 views

Magento 2 - Where are data-bind attributes defined?

In the file vendor\magento\module-checkout\view\frontend\web\template\minicart\item\default.html there is this code: <li class="item product product-item" data-role="product-item&...
0
votes
0answers
30 views

Knockout Js not found Magento 2.3

I am unable to click on menus, submenu in admin Panel. I have checked and found there are errors related to knockout.js in console panel. Front-end is working fine but i can see the same knockout ...
0
votes
1answer
26 views

Magento 2 - get amount of items in cart by using knockout.js

I am creating a new header. It is supposed to look like this: I need to get the number of items in the cart and write it to a certain place in the header, where the minicart is showing. So I added ...
2
votes
0answers
26 views

knockout data-bind issue on the Frontend Magento 2

I have added file-uploader component in the review form. I have used below code to add browse button in the form. <div class="upload-wrapper" data-bind="scope: 'uploader'"> ...
1
vote
3answers
36 views

Magento 2 - How to override knockoutjs template?

I try to override the following template from my own module vendor\magento\module-checkout\view\frontend\web\template\minicart\item\default.html but I don't find the file where I can override it, I ...
2
votes
4answers
151 views

How to load js file first in Magento 2

I'm using Magento 2 and I have a js file that was called like this: default.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
1answer
35 views

Add custom knockout component to checkout sidebar in Magento 2

I'd like to know what is the best approach to add a custom knockout component to the checkout sidebar in Magento 2, an example assuming we already have a custom module would be great UPDATE: As I ...
1
vote
0answers
27 views

How can I remove Recently Viewed Products individually using delete(icon) button?

I want to add a delete button link to the recently viewed products and when we click on delete button link of any product then it should be remove from the list. You can see image for better ...
1
vote
0answers
11 views

How to pass data using chackboxes in HTML uiComponent

I'm trying to add/remove data based on a checkbox. I can't figure out how go get the value to get through to the function. My console is logging a list of my observed variables. Any idea how to pass ...
0
votes
2answers
83 views

How to implement jQuery click event in magento knockout JS function

how to implement below jQuery code into knockout js, Actually I'm trying to call this function on a button click event using knockout js, but it's not working HTML code: <div> <ul class=&...
0
votes
1answer
18 views

Mini cart js is not working properly the count is not showing some times

Minicart is not showing cart count properly at the time of not logging in. I had tried to show statically into the id condition but the when loading the 0 is shown after load it is not showing, I ...
0
votes
0answers
19 views

Magento 2: How to make new billing address form shows up in popup in checkout just like new shipping address form?

In magento 2 checkout page there will be a pop up form when we add new address instead of using current shipping address, but for billing address the new billing address form is below the dropdown, is ...
0
votes
1answer
135 views

Magento 2.3.4: Refresh window.checkoutConfig

We are adding shipping price of quote object to myTestData which is pulled onto the page using window.checkoutConfig.myTestData: use Magento\Checkout\Model\ConfigProviderInterface; class Config ...
0
votes
0answers
28 views

Jquery callback function cannot read property of undefined using knockout js

1.lets assume placeOrderClick function is called.within this there is a eprotect API success callback function called submitAfterEprotect. i'm trying to call placeorder function using self in ...
0
votes
1answer
16 views

Magento 2: How to translate knockout html file for word that contains hyperlink?

I have a text like this: To contact us please email us at joe@mail.com, will be waiting! when the user clicked on the email it will redirect the user to mail link, using phtml i can easily achieve it ...
2
votes
1answer
97 views

Uncaught TypeError: Cannot read property 'status' of undefined misc.js:181 checkout shipping page Magento 2.3.5

I am facing below console error in our site so that some of our extension stopped working in checkout shipping page Magento 2.3.5 pub/static/frontend/Vendor/Theme/en_GB/mage/utils/misc.js define([ ...
2
votes
1answer
24 views

Wishlist not working for login customer in magento2 with caching if once i add product then wishlist icon remove by KO wishlist().counter?

How can I set my wishlist for logged on customer and log gout customer with knockout JS if I logged on then I only add product once then wishlist icon remove because of knockout JS how to write ...
1
vote
1answer
37 views

Magento 2: how to get product details using Magento_Checkout/js/model/quote

In Magento 2 how we can get the product details using Magento_Checkout/js/model/quote
2
votes
0answers
19 views

Magento 2: How to bind an element in phtml with minicart js model function?

I want to print the items count in somewhere else, so i create a new phtml like this: <?php /** @var $block \Magento\Checkout\Block\Cart\Sidebar */ ?> <div class="test-cart" data-...
1
vote
0answers
17 views

Magento 2 - Save data of customer from a form in database

I wish I could create a form with several inputs dedicated to the customer's attributes in my first custom checkout step. This form will have to save the data in the database, in the customer ...
2
votes
0answers
13 views

Magento 2.3.4: Not able to search admin grids

Recently upgraded from 2.3.1 to 2.3.4-p2 and now we're not able to use the keyword search above admin grids like Catalog > Products, Sales > Orders, etc. We can still use the filter boxes, but ...
1
vote
3answers
57 views

How to get store logo url in Javascript file in Magento 2?

I want to load store logo image URL in javascript so i can bind it to my knockout element, how can i achieve that?
0
votes
0answers
21 views

Magento 2 - Create repeatable field in checkout and saving the data to model

I am trying to create fields for each product in the cart. Some extra data needs to be filled in per product and the wish was for it to be found in the address section of the checkout form. I can ...
1
vote
0answers
11 views

How to initiate tabs widget when all payment methods are rendered

I want to initialize tabs widget on payment methods on checkout. How would I know if all the payment methods are rendered and it is now safe to initialize tabs. Thanks
0
votes
0answers
19 views

Create dynamic div using for loop

Suppose i have array like this [ ['suplier1'] ['suplier1'] ['suplier1'] ['suplier2'] ['suplier2'] ['suplier3'] ['suplier3'] ['suplier4'] ] And I want to create html ...
0
votes
0answers
23 views

magento2 select data form more form

I am doing save data to database. But i have three form in here But when i submit. The data received only one final form This is my code public function execute() { $resultRedirect = $this-&...
0
votes
0answers
10 views

Magento 2 Add option in section “Please select in shipping and billing address are same” drop down

I want to add option "Please select" on checkout page when unchecked "My billing and shipping address are the same" checkbox in drop down.I have checked all module-checkout module ...
0
votes
0answers
14 views

Magento 2: Error Disable some dates in jquery Datepicker

I try to add datepicker in magento 2 checkout page like this: ko.bindingHandlers.datepicker = { init: function (element, valueAccessor, allBindingsAccessor) { var $el = $(...
0
votes
1answer
32 views

Magento2: How to get country list in custom HTML template

I need to display a country list with dropdown in the custom knockout HTML template. Help would be appreciated.
0
votes
0answers
31 views

Magento 2.3.4 In checkout form, Customer Address Custom attribute not getting displayed. Getting knockout error

I'm using magento 2.3.4. I have added custom attributes in customer_address. the attribute is properly saved and displayed too in my customer account. But in checkout, I'm getting error of knockout. ...
0
votes
0answers
18 views

How can i Stop calling event bind with data-mage-init

I am implementing infinite scroll in a custom collection which is working perfectly but in my case when i filter out this collection and update collection item with ajax response still the previously ...
0
votes
0answers
9 views

SKU switcher based on configurable selection

I am trying to update the product SKU based on the product selection chosen.. I have the following code that works, but only works if the configurable product is in stock (eg at least one of the ...
0
votes
1answer
40 views

Unable to process binding on product page Magento 2.3.5

Hello i'm facing an error that i absolutly not understand. I just to upgrade my magento from 2.3.2 to 2.3.5 and i have a knockout.js error on my product page and an infinite loader . I don't no where ...
3
votes
1answer
118 views

How to bind an event handler to 'street[0]' input on the checkout page?

I've been trying to ensure an alert displays on a user typing in PO BOX number in the street address field on the checkout page, saying we don't ship to PO BOX. My jQuery code doesn't seem to bind a ...
0
votes
1answer
35 views

Magento 2.x knockoutjs dispaly data from observable Json Object

to display data from observable array one can do: Component: myObject: ko.observableArray([{name: 'test'}]), Html: <ul data-bind="foreach: myObject"> <li data-bind="text: name">&...
0
votes
1answer
35 views

How to populate Purchase Order Number with a random rumber?

Magento 2.3.x Purchase Order used as a payment method requieres a purchase order number. Some of our customers don't have that number, so we need to pre-populate this input field with a random content ...
0
votes
1answer
29 views

'getFormattedPrice' undefined on checkout

I need to get a list under each product in the form: - Unit price - Amount - Amount based on price and quantity Rewrite template: vendor/magento/module-checkout/view/frontend/web/template/summary/...
1
vote
1answer
52 views

Ui element and knockout js array subscriber/listener

I would like to do 2 thinks with knockout js and UI component Fill in input in a grid based on entity_id - Works great Trigger callback when one of input has changed The second part works partly. ...
0
votes
1answer
45 views

Magento 2- How to pre select and load CCAvenue on checkout page

I have installed and configure the CCAvenue payment method in Magento 2.3 successfully, now I want to pre-select and load CCAvenue on the payment section. Please suggest.
0
votes
0answers
13 views

Order summary items-in-cart update

I want to update the items in cart count in the checkout#payment sidebar. I have added a button that when clicked the items in cart will be added by one. So far the items in cart are updating ...
0
votes
1answer
45 views

Display formkey in knockoutjs template

I have a phtml template that display the formkey in my html file. Below is how I'm displaying this <form action="" method="post" id="form-validate-pound" class="form form-...
0
votes
0answers
90 views

Checkout address custom attributes don't get rendered in address information components

I have to add a new customer address attribute apellido2, this field is a second last name and must be present in both shipping and billing address. So I after reading a few posts, I started with my ...
0
votes
0answers
24 views

Magento 2: All variables in knockout.js

in Magento 2 I created a module that shows all items in the cart on every page. The price is f.e. shown with: <span data-bind="text: product_price"></span> Now I am wondering if there ...

1
2 3 4 5
14