Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

Filter by
Sorted by
Tagged with
0
votes
0answers
9 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
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
26 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
26 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
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
1answer
21 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
25 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
96 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
37 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
27 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
35 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
40 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
56 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
68 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
91 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
77 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
20 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
80 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
42 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('...
1
vote
1answer
40 views

Magento 2 - How to override frontend javascript file

I need to overwrite a javascript file from a custom module at: vendor\amasty\module-single-step-checkout\view\frontend\web\js\model\one-step-layout.js because I need to replace a code line in it to ...
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
92 views

Magento 2 - override knockoutjs template located in base folder

I need to change the value of the maxinput field in the knockoutjs template vendor\magento\module-ui\view\base\web\templates\form\element\input.html so I have to replace the template with my own ...
0
votes
1answer
40 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
351 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&...
0
votes
0answers
63 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
19 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
22 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
38 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
196 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
36 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
86 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
411 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:...
3
votes
1answer
169 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
28 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
13 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
299 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
36 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
32 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
512 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 ...

1
2 3 4 5
15