Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

323 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
208 views

Understand Knockout.js data binding

I come across this code : app/code/Aheadworks/OneStepCheckout/view/frontend/web/template/onestep.html <div class="aw-onestep aw-onestep-sidebar" data-bind="mageInit: {'awOscSidebar':{}}"> ...
1
vote
0answers
182 views

Magento 2 knockout JS template for Product listing and detail page

I was wondering since knockout was introduced in magento 2 why this has not been implemented fully. For example I see knockout been use only in checkout page. Pages like product listing page, detail ...
1
vote
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 ...
1
vote
0answers
353 views

how to update order summary sidebar after dynamic product addition from checkout page

I have added a product to the cart through knockout js if the guest customer checked the option during checkout. I was able to update the mini cart also. But I could not update the Order summary ...
1
vote
1answer
102 views

Making selector available to ui component / philosophy

You'd think that the selector .el in { ".el": { "Magento_Ui/js/core/app": { "components": ..... would be made available to the ui component. Instead, it's just thrown away, ...
1
vote
1answer
405 views

Multiply subtotoal price in minicart

I want to show two subtotal prices in the minicart. The plan is to multiply the subtotal price and print it next to the original subtotal price. The price is printed by knockout in the html file ...
1
vote
0answers
163 views

Uncaught Reference Error

I'm getting this error message after an update that the developer of the plugin performed and it seems to be completely broken now. Is there a way I can fix this error myself? Uncaught ReferenceError:...
1
vote
0answers
36 views

Is extending stock knockout objects a good practice in Magento 2?

I'm writing an extra step in the M2 checkout. There are already written well structured models and actions in Magento_Checkout/js. Should I extend them (for instance js/model/quote or js/model/...
1
vote
0answers
880 views

Magento 2 Checkout Billing Address Modification

I have a custom module for checkout part, I just need to know how to modify some elements and for begin I am trying to place the Billing Address part on another side after shipping details. I have ...
1
vote
0answers
193 views

Magento 2 - Using KOJS template for filter component?

On the same page I have several custom product grids with above them a filter toolbar. To simplify the case : <?php foreach ($grids as $id => $grid): ?> <div class="container"...
1
vote
0answers
402 views

How is the minicart content loaded and rendered?

I have overriten the content.html minicart template in my theme, currently the code looks like this: <!-- ko if: cart().summary_count --> <div class="detailArea"> <div> <ol ...
1
vote
0answers
772 views

How to initialise a carousel and use Knockout observables in the same JS file

I'm experimenting with Require JS and Knockout JS in Magento 2 and I've ran into a strange problem where I can't use Knockout JS and initialise a carousel in the same JS file. The carousel works fine ...
1
vote
1answer
860 views

Magento 2: Shipping method radio button is disabled

In checkout page of Magento 2, all enabled shipping method radio buttons are showing as disabled. Anybody have faced such an issue? I used latest version: 2.1.3
1
vote
0answers
1k views

Callback on method for KO JS observable data after AJAX completion

I have a module that modifies the product prices on the catalog pages and needs to bypass the cache. My issue is that I've defined these classes and need to trigger their flush method once another ...
1
vote
0answers
1k views

Magento2 : How to create dynamic checkout step using knockout js

I was created module for add step in checkout. In here i want to add one dynamic form using form fields from my database. My Table structure --Field Id --Field Name --Field Type My ...
1
vote
1answer
84 views

State field misaligned in billing form - Magento 2 checkout page

The state field coming top of the billing form in checkout payment page. The issue coming only in chrome browser when I refresh the page more than three times. I hope that it is because of cache ...
1
vote
1answer
211 views

MAGENTO 2 - How to trigger function on the template after admin save?

I'm wondering it's possible to call (trigger) method on the frontend when admin changes something in backend (admin panel) Suppose that I have banner which has image with 24h cache-validation time. I ...
1
vote
0answers
42 views

Great challenge - convert XML structure to php code

I'm working in a project which i need convert the minicart xml structure to a php code. I made all this. But i don't know why he does't call or read my templates html. I compared the json structure ...
1
vote
0answers
216 views

OneStepCheckout - display subtotals of tax class

I am using Magento 2.1.1 and Module One Step Checkout from Magestore. If anyone is using that it would great, but I bet in default Magento it can ba achieved in similar way.I was digging around for a ...
1
vote
0answers
44 views

Modify the knockout script on the checkout onepage

I want to like the items that are in the customers cart when he tries to checkout. Right now, it looks like this: And code looks like this: The questions is, how can I get the <a data-bind="href:...
1
vote
1answer
431 views

Magento 2 change knockout js template order

How to change Magento 2 knockout js template order. I want to change these blocks order for order summary table: http://prntscr.com/ca9nbc Moving orders items block above summary table.
1
vote
0answers
1k views

Magento 2 checkout Shipping Prices missing

I am trying to get the shipping price to display on my checkout. It's accessed via knockout.js in the template Magento_Checkout/web/template/shipping.html (this is the standard shipped with Magento) ...
1
vote
0answers
922 views

Magento2- In Checkout Page Not Display Payment Instruction

JS File path : Test\Demo\view\frontend\web\js\view\payment\method-renderer\Webpay-method.js define( [ 'jquery', 'Magento_Checkout/js/view/payment/default', 'Magento_Checkout/js/action/...
1
vote
1answer
210 views

Magento2 Custom Template KnockoutJS

I have set up a custom template and all working fine apart from KO templating is not working in the custom theme so things lick the checkoutpage is not rendering. I have the following set: - One page ...
1
vote
1answer
55 views

Magento 2 - Where Knockout js variable are defined?

In Magento 2 I don't understand how knockout js templates work. In this file : vendor/magento/module-checkout/view/frontend/web/template/summary/item/details.phtml <div class="product-item-inner"&...
0
votes
0answers
18 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
0answers
8 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
24 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. ...
0
votes
0answers
16 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
20 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
12 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
0answers
26 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 ...
0
votes
1answer
39 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
54 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
66 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
14 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
8 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
83 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 ...
0
votes
1answer
19 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
75 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 ...
0
votes
2answers
40 views

Magento 2: Translate knockout template html text with variables

Currently i have a knockout template for minicart like this: <!-- ko if: getCartParam('summary_count') --> <div class="items-total"> <!-- ko if: getCartParam('...
0
votes
0answers
16 views

Magento 2.3.4 Region Missing When Creating a New Address During Checkout

Running into an issue during checkout on the Shipping step. When you add a new address to ship to during this step, it asks you for your City, State, Zip... however after adding your address, the ...
0
votes
0answers
15 views

Magento 2 Uncaught TypeError: Cannot read property 'confirmation' of undefined in datapost.js

I get this error while using a<> tag with attribute data-post. I used a data-post to re-order. history.phtml <a data-post="value: postData" href="#">Reorder</a> ...
0
votes
2answers
82 views

Uncaught TypeError: Unable to process binding “html: function(){return getInstructions() }” ( Magento 2 )

I'm using a third party one page checkout module on this system. And added an observer "payment_method_is_active" event for the cash on delivery and bank transfer methods to enable them only ...
0
votes
1answer
39 views

Magento 2: Adding a color picker as an attribute to a product form

Please tell me how you can add a color picker as an attribute to the product form. I tried several options from the Internet, well, they did not work.
0
votes
0answers
35 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
14 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
25 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
342 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
29 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&...

1 2 3
4
5
7