Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

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

Cart page Total amount change observable

Three statements to explain my question: Without page load: I want to update one value on the same page via ajax request if cart total change. I want to observe Cart Total changes by increasing/...
0
votes
1answer
22 views

Execute jQuery after foreach loop in knockout template

I am trying to execute some custom code after a knockout template has fully rendered. The template is Magento_Catalog/list/listing.html The relevant part of the template for this problem is: &...
0
votes
1answer
13 views

Knockout : How to find the called methods

Simple question and probably already asked but, I don't get how this knockoutJs works and I can't find any clear explanations. I'm under vendor/magento/module-checkout/view/frontend/web/template/...
0
votes
0answers
11 views

Magento 2 extend errorPlacement in knockout

I need to extend errorPlacement from validation.js in Magento_Checkout/web/.../email.html I want to append error's (in checkout login section) in a custom div created by me in email.html. I tried 2 ...
0
votes
1answer
18 views

Creating a register link inside of ko text

Fairly easy question for most but it's somewhat tricky and I'm having issues. <span class="note" data-bind="fadeVisible: isPasswordVisible() == false"><!-- ko ...
0
votes
0answers
32 views

Magento 2: Minicart product title is coming with special character

Magento 2.3.5-p2 when adding the product to the cart product name is "Hello & world", on minicart when we hover the product image the product title is showing like this "Hello &...
0
votes
0answers
19 views

Magento 2: ko Select select default value

How to select default value in select in magento 2 and show same in checkout page <select class="pro-subscription__options-list" name="pro-subscription_type" data-validate="...
0
votes
2answers
30 views

Magento 2 knockout js onchange selected value not working

I'm working on checkout page. I cannot get the selected value from the event. My Html <select name="addresslist" id="addresslist" data-bind="event:{ change: regionChange}&...
0
votes
0answers
18 views

Issue in currency wise price convert on checkout order summery using Javascript or JQuery

I have product item price with USD $10 and I want to convert this price to INR and display it on checkout order summary. I got currency symbol using utils js but I can't convert price. How to convert ...
0
votes
1answer
18 views

Magento 2: Uncaught TypeError: Cannot read property 'closest' of undefined

I am getting Uncaught TypeError: Cannot read property 'closest' of undefined Here is my code: var _self = this; var btn = _self.element; var parentBlock = _self.element.closest('.new-...
0
votes
0answers
12 views

Page builder new element knockout issue

I'm new to web development with Magento. Unfortunately, I've run into an issue with the page builder. Any advice would be appreciated. I've attempted to create a new element following the example ...
0
votes
0answers
18 views

Notify Customer on Product/category page that this item already in cart

I have to notify the customer that this product is already in the cart on the product page and category page too before Add to cart Button like product page For Category Page I have tried to get ...
0
votes
0answers
40 views

Magento 2 API Data is not being accessible on Knockout JS

I'm struggling with a knockout js component. Here is what I'm trying to do: 1- Get data from an external API 2- Load that data on my JS Component So basically what is happening is that when I create a ...
0
votes
1answer
27 views

Fill HTML space while KnockoutJS renders

I'm doing an extension for the shopping cart which consists on adding and removing quantities using + and - buttons without reloading the whole page. Thus I'm using Ajax for sending the request and ...
0
votes
0answers
16 views

how to inherit account_new_no_password.html in magento 2

I have tried this: var config = { map: { '*': { 'Magento_Payment/template/payment/cc-form.html': 'Namespace_Module/template/payment/cc-form.html' } } };
0
votes
0answers
17 views

KnockoutJs bad translation

In a template I have this koJs code : In src/vendor/magento/module-checkout/view/frontend/web/template/cart/shipping-rates.html <!-- ko text: $data.method_title --><!-- /ko --> This is ...
0
votes
0answers
13 views

Elements disappear when manipulating the xml. Checkout_Cart_iten (Cart)

Whenever I try to move or remove a block, some elements on the page just seem to disappear. The cart page is being too complicated for me, I don't understand why this is happening. The price next to ...
0
votes
0answers
19 views

Magento 2 - parse knockout values to x-magento-init script

I'm trying to replace native minicart quantity field with my own ui component. I created an override of vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html. My code : &...
0
votes
0answers
25 views

Set optionsCaption as preselected option with knockout js in dropdown list at checkout

I am trying to set the OptionsCaption as the preselected option in a dropdown list during checkout That's what it gives me so far. It selects the first item on the list instead. This is my code in js ...
0
votes
1answer
17 views

Javascript issues in Magento 2 cart page

In my magento 2 theme in cart page in console, I have errors: Uncaught SyntaxError: Unable to parse bindings. Bindings value: if: getCartParam(summary_count') Message: missing ) after argument list ...
0
votes
1answer
61 views

How to customize update Mini-cart individual product price total when qty increased - KnockoutJS

I want to increase product price when to increase qty in Minicart, but here order total increased but price not updated.
0
votes
0answers
13 views

Magento 2 - Braintree Googlepay button missing in checkout

I am trying to add braintree google pay payment method. But getting error in checkout page and google pay button is not showing any content. When I first enabled, it worked for few minutes then it ...
0
votes
0answers
28 views

Magento 2 add custom field in checkout place order

Need to add new custom validation on the checkout page before place order. The place order should work only when the calculation shown above is correct and also to show different values to sum. I ...
0
votes
1answer
20 views

Magento 2 how to use phtml jquery events on knockouts js component template?

I'm struggling trying to approach the following objective: Use jquery events on a knockout js component template. On phtml file I have my knockout js component like this: <div class="container&...
0
votes
0answers
17 views

magento2 / Knockoutjs: observableArray not processing change to bindings

My problem: I have a observableArray packageItems linked to my template which works fine on the initial load, but after trying to alter it by a function called from another component, the array ...
0
votes
0answers
31 views

Magento 2: from php plugin to js knockout in checkout

I have created a plugin on Magento\Shipping\Model\Rate\Result that should check on some conditions in the cart's contents. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
0
votes
1answer
26 views

Magento2: JQuery not working because of element binding after load my jQuery

Many times we just need to use simple jQuery on checkout page but checkout element bind with knockout js so our jQuery does not work smoothly. So, how can we call jQuery after bind element??
0
votes
0answers
22 views

Modify name in checkout summary?

Magento 2.3.3 I want to add something to the name in the checkout summary. I have a custom checkout extension and it already comes with the DefaultConfigProvider class. In the afterGetConfig function ...
0
votes
0answers
10 views

Prevent scroll to top after adding to compare , remains on same position

On my category page there is a compare button , when clicked the page refresh and scroll to top, I need to stay on the same position , any idea? thanks
0
votes
0answers
49 views

Magento 2.4: How to display attribute option frontend label with KnockoutJs?

How to display attribute option frontend label with KnockoutJs when creating configurable product variations in step 2? Current Color option label is displayed: module-configurable-product/view/...
1
vote
1answer
44 views

inheritance in knockoutJS components within magento 2's knockout framework

I have been experimenting with a custom module with KnockoutJs on the frontend in M2. I've created two components: a ProductPackage and a ProductPackagePopop. Functionally, the ProductPackage triggers ...
1
vote
4answers
75 views

How to resolve the Unable save the extension attributes

I followed this link for creating the custom address field. I'm getting this error PHP Fatal error: Uncaught Error: Call to undefined method Magento\Sales\Api\Data\OrderExtension::setCustomerAddrId() ...
0
votes
0answers
15 views

How to modify datepicker input template and js file?

I want to change date input data bind attributes and I don't know exactly which file I should overwrite. I changed these files but output is still the same. map: { '*': { 'Magento_Ui/...
0
votes
1answer
24 views

How to determine if the user tabbed out of a quantity field using knockout?

I've got a 3rd party module that is showing configurable product details in a grid (i.e. it shows a list of the simple options next to the price of the simple and a qty field, all in a table format). ...
1
vote
1answer
48 views

How to add Custom Step on Checkout and move Shipping methods in that step In Magento 2.3.5

In this i want one custom checkout step can having only shipping methods inside the step means shipping address and Shipping methods are on different steps on checkout page. So, Please can anyone have ...
0
votes
2answers
122 views

Magento 2 - Check if shipping cost in cart is 0,00, then change it into text

We would like to check in the checkout cart if the shipping cost is 0,00 and then replace it by text: "free". Therefore I copied the file /Magento_Tax/web/template/checkout/cart/totals/...
0
votes
2answers
31 views

Magento 2: Minicart update product id issue with CustomerData

I am showing a popup on click of checkout when these two products(81, 83) added in the mini cart and this is working fine. Now I have added the 81 products and any other products in the cart. But when ...
0
votes
1answer
57 views

Knockout JS Implementation with Phtml ReferenceError: Unable to process binding

After a lot of search in this forum I have decided to write a question by myself. I am trying to integrate my knockout page into a phtml file in way to update the input layout after a file has been ...
0
votes
0answers
15 views

Magento 2: Modal form submit not working with KO

Modal popup from submit not working after KO binding for input magento 2 I have working on form submit using popup to send email from homepage to checkout for that I have created popup which was ...
1
vote
1answer
27 views

Magento 2: How to check inarray ids in minicart.js

getCartItems: function () { var items = this.getCartParam('items') || []; _.each(items, function (item, key) { console.log(item.product_id); ...
1
vote
1answer
28 views

Magento 2: I want to get product id from getCartItems function in minicart.js

Here is the function in minicart.js getCartItems: function () { var items = this.getCartParam('items') || []; console.log(items); // want to get product id from ...
0
votes
1answer
16 views

Set value of knockout datepicker from another script file got Error

I'm using Magento 2.4.1 and i successfully add datepicker in checkout page like this: js file define([ 'jquery', 'ko', 'Magento_Ui/js/form/element/abstract', ], function ($, ko, Component)...
0
votes
0answers
21 views

Magento 2 Checkout show Order Summary in popup div window

Good Afternoon All, I am currently working on a small module that requires a copy of the Order summary is shown in a pop-up window after the checkout has loaded. I have been working with the data-bind=...
0
votes
0answers
15 views

How can I insert my custom checkout step form data when place order in quote table and in sales_order table in magento 2.4?

I create custom checkout step with my custom form in that I need to submit three extra field in quote table and sales order table. So, how can I submit this form data in that table when order place. ...
0
votes
0answers
15 views

Magento 2: Where can I edit the Minicart product image template (KnockoutJS template)?

I'm trying to edit the minicart product image template. I found the parent file: /app/design/frontend/Smartwave/porto/Magento_Checkout/web/template/minicart/item/default.html However it uses a ...
0
votes
0answers
6 views

Directory not being unloaded after adding it to the exclude portion of view.xml

I added this line to my view.xml file. <exclude> <item type="directory">Lib::knockoutjs</item> <item type="directory">Lib::knockoutjs/kockout</...
0
votes
0answers
46 views

Magento 2 - Check in mini cart if product is virtual

How can we check in the mini cart if the product is virtual using knockout? Inside the cart and checkout we can use the following, but that is not working in the mini cart. Any idea? <!-- ko if: (...
0
votes
0answers
15 views

How to call the special price and wish list in the product grid of the module from Adobe Sensei?

How to call the special price and wish list in the product grid of the Magento_ProductRecommendationsLayout module from Adobe Sensei? I am putting together a carousel of recommended products and I ...
0
votes
0answers
13 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
22 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 ...

1
2 3 4 5
15