Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

Filter by
Sorted by
Tagged with
0
votes
1answer
46 views

How to overwrite a payment method js renderer component?

Resolved: Seems the error has been caused by the requirejs and my lobster hands :) I rewrite a default Component and trying to extend it inside own component which rewrites a default component: ...
0
votes
0answers
98 views

Why radio button 'onclick' not work?

I have template .html <input type="radio" value='0' name="name" id="0" data-bind="click:fun"><label for="0" data-bind="click:fun">0%</label> <input type="radio" value='5' name="...
0
votes
2answers
251 views

Magento 2 | Checkout: Change type of field (telephone)

I want to change the input for the telephone field in the checkout from text to number. I looked into it 2 years ago and created this topic on the Magento community forum: https://community.magento....
0
votes
0answers
49 views

“Create Permanent Redirect for old URL” is triggered when saving even when key not changed. why? how?

EDIT: the two things were unrelated so this is a non question. Background: I have tried to bulk update attributes for my product but it fails. Digging in the error always is "URL key ... for ...
0
votes
0answers
156 views

I am getting "falseException: Warning: Cannot modify header information in magento 2?

I am getting below exception (only for logged in user)when the controller returns a response to knockout js. "falseException: Warning: Cannot modify header information - headers already sent by (...
1
vote
1answer
51 views

Magento2: Get gallery images in knockoutjs?

How to get gallery images in knockoutjs in Magento2.3.0? Any help would be appreciated.
0
votes
0answers
33 views

How to get input value to js when button click in mganto 2 knockout js, when having two input field in same template?

I am having two input field one for phone number and other for OTP. When click the submit button for OTP also I get the phone number value. How can I get the OTP value when the OTP button click? ...
0
votes
1answer
639 views

How to pass text input value to js in magento 2 knockout js?

In my template.html file, I am having only the input field. After I complete entering the text in the input field, I need to pass the value to the js file without any button click. How to achieve this ...
1
vote
0answers
157 views

How to pass value from template.html to js in magento 2 knockout js when complete entering the input field?

1) I need to pass the phone number value to the telephone.js when complete entering the number before the button click. 2)Below the phone number field, I added the OTP input field (i added it in the ...
0
votes
0answers
32 views

ReferenceError: getTemplate is not defined

I'm currently working on Megamenu on Magento 2.3, I'm able to edit menu on chrome but after coming to Firefox I'm not able to edit it and I'm getting error in the console it says ReferenceError: ...
1
vote
0answers
55 views

How to add selected items on a page to a separate block in Magento 2?

Please help with the implementation of this functionality. I have a separate module with a separate route. There will be elements on the page (picture and checkbox under it) as in the screenshot. ...
0
votes
1answer
106 views

Magento 2 - How to change the error placement in a custom form on checkout page

I wish to place the error after the parent of the element being validated. I tried to change the place via error placement function like below <script> require([ "jquery", "...
0
votes
0answers
39 views

How to initialize knockout js componenet for dynamic elements?

There is a knockout js component on category page, that is initialized like this (for every product in a list): <div id="some-block-<?= $product->getId() ?>" class="some-block-container" ...
0
votes
0answers
10 views

knockout - set event to fire when knockout has completed ajax call

I need to display a loader / spinner div on page load, and only remove it after the knockout.js ajax call has completed and the appropriate data-bind effects have completed. How can I register my own ...
2
votes
1answer
94 views

How to call knockout functions from html (Magento 2)

I have functions defined in my knockout js, define([ 'Magento_Ui/js/form/form', 'ko' ], function (Component, ko) { 'use strict'; function viewedProducts() { let rvp = JSON....
2
votes
2answers
76 views

Magento 2 - cart page custom UI component foreach binding

I want to add a custom UI component template on the cart page. The data is in JSON format and wants to bind forach to display a list of data. data like as {'name':'5% discount','description':'5% ...
0
votes
1answer
43 views

Magento2 : Show Three Products on Checkout page in Order Summary section

I have added 8 products in the cart and now I would like to show three products on Order Summary section on Checkout page with a Load More button. And, if we click on Load More button, it will show ...
1
vote
1answer
31 views

Implementation of sending selected items along with feedback form

Tell me how to implement the functionality of such a sample. On a separate page there is a form with any fields 2 or more and a submit button. I will use this example to implement. https://magento....
0
votes
0answers
43 views

How to make fields observable?

I have added a custom field in shipping page using afterProcess plugin for LayoutProcessor The code is as follows : $jsLayout['components']['checkout']['children']['steps']['children']['shipping-...
0
votes
0answers
53 views

Adding customer address after i click `Save Address` on Checkout page

I have a 'New Address' button on our checkout page, my issue is that the customer address is being saved after the order is placed, Can I have it saved after pressing save address button? I am ...
1
vote
1answer
339 views

How to add Cancel/Ok button within Minicart and remove popup

I want to remove the delete button that is in below screenshot And add to button Cancel/Ok within minicart, not in popup like magneto by default functionality. just want to add button on mincart not ...
0
votes
0answers
21 views

Magento 2 Address Validation In checkout

How to validate the shipping address by using external services and provide address suggestions for customer to select the suggested address in checkout?
1
vote
0answers
22 views

How to achieve inheritance in Knockout JS implementation of Magento 2?

I have created one component 'measure_parent' and added one observable variable inside this. this.width = ko.observable(false); Now, I have extended this measure component inside another component '...
1
vote
0answers
16 views

Send Credit card details to another server after customer enters card details in checkout

How to send credit card details to another url outside of magento and get response token, after customer enters credit card details in checkout page.
1
vote
1answer
262 views

Magento 2 get store information on checkout page by knockoutJs

I wanted to display store name with item name on checkout page. I am beginner in knockoutJs, please help me to solve this.
1
vote
2answers
538 views

Changing Address list to dropdown select on checkout

I have this code on Magento_NegotiableQuote/web/js/view/shipping-address/list.js define([ 'jquery', 'ko', 'underscore', 'mageUtils', 'uiLayout', 'Magento_Checkout/js/view/...
1
vote
3answers
266 views

How to pass the value and call js function from template.html using knockout js in(in checkout page) Magento 2?

I have to call and pass value to the js function(showPopup())from the template(when clicking the Verify OTP button). How to achieve this?. But now i am not able to call the js function. layout file &...
0
votes
1answer
32 views

Magento2: How to customize the Billing address form?

Currently there is no validation class available in phone number field. I want to add "validate-digits" class, but I am not able to find the related file, Please help me how to do this changes so ...
1
vote
1answer
109 views

how ko.observable declaration in magento 2 works without mentioning it in any variable?

In Knockout we make the variable to be observable like var a=ko.observable(); but in Magento 2 without mentioning ko.observable() the variable acts as an observable variable. This is customer.js file ...
1
vote
1answer
44 views

Magento 2 minicart not updating after custom popup add to cart completed

I have created custom Popup on category page and added custom button with form data for add to cart. After popup button is clicked the custom controller is adding product to cart. But its not ...
1
vote
0answers
165 views

Magento 2 how to update price on quantity change in product detail page using knockout

I am using magento version 2.3.2 I want update price based on Qty change using Knockout js in Product detail page anyone help here, thank in advance
0
votes
0answers
93 views

How to call a function inside click action function using magento knockout js?

Here, I am trying to call _showProductUrls function inside _getCategoryId function. The _getCategoryId function triggered based on click action. I am getting an error response as "_showProductUrls" ...
1
vote
0answers
122 views

I want to add sign in form of magento 2 checkout step

I want to add sign in form of magento 2 to my checkout step and want to show sign in form when checking out how to call template of sign in form in my custom checkout step.
0
votes
0answers
23 views

Remove shipping step from one page checkout

I am working on the functionality of "Buy now Pay Later". So that customers can purchase on credit and that order will be in "pending" state. Then later, customers can see the list of "Outstanding ...
0
votes
0answers
16 views

Is possible to create form inside listing ui?

I have already known benefits of use ui components but it comes with complexity to implements specific design. My question is there a way to create form ui contain ui elements inside of one general ...
1
vote
0answers
69 views

Magento 2 - bind to .html template load complete event

I need to do some DOM manipulation within a JS mixin after .html template is loaded. My mixin is for following component: module-braintree/view/frontend/web/js/view/payment/method-renderer/hosted-...
1
vote
0answers
72 views

Magento 2.3 - Always show reviews on pageload

I use the tab-view on the product page for mobile devices, but I show all the tabs open at once on the desktop view. This causes a problem with the reviews. The form for adding a review is shown, but ...
0
votes
0answers
27 views

In Magento 2.3. How to bind the Product detail page components via Knockout Js

In Magento 2.3, Whether we can implement knockout JS on the product detail page for entire components such as Product images, Custom Options, Price calculation, Review sections etc., Also, I would ...
1
vote
0answers
43 views

How to Add an icon next to Payment Method for Amazon Pay?

I have looked up a few similar question but can't figure how. It's the default amazon pay module that came with Magento 2 I'm editing this file /var/www/html/vendor/amzn/amazon-pay-module/view/...
2
votes
2answers
563 views

Magento 2 : Add custom text in payment step of checkout

I have a requirement like below. If there aren't any payment methods, There is a text showing in payment page No Payment method available. under the path Magento_Checkout\web\template\payment....
1
vote
1answer
271 views

Get street address in checkout page magento 2?

Hello all I am trying to get selected shipping address from dropdown(without changing the dropdown option like getting selected shipping address when page loads) or default shipping address on ...
4
votes
4answers
692 views

Magento 2: How to check that customer is logged in on frontend?

Checkout Minicart content.html <div class="block-content"> <button type="button" id="btn-minicart-close" class="action close" data-action="close" ...
0
votes
1answer
62 views

How does $block->customerLoggedIn() work with Magento's cache?

I see there are two ways Magento2 renders content in the header for logged-in vs logged-out customers. With KnockoutJS in header.phtml With PHP in customer.phtml Which is considered best practice? ...
0
votes
0answers
223 views

Checkbox and span text bind is not working in Knockout js - Magento 2

I am trying to put a checkbox on the checkout page and need to display a message at the sidebar on the summary section. I am struggling with the binding of checkbox and span text. Please have a look ...
2
votes
2answers
405 views

Magento 2 Inject UI component(s) via ajax into adminhtml form

I've build a regular adminhtml form via UI component(s) including multiple fieldsets, input and select fields. All working like they should. Now I've created a so called 'Event' select field within ...
0
votes
1answer
418 views

upgrade javascript library versions in Magento 2

Recently we have made pen-test on Magento 2.3.3 version. We have received the following issues. Vulnerable Javascript Library Versions In Use adminhtml/Magento/backend/en_US/jquery/jquery-ui-1.9....
0
votes
2answers
197 views

Add Custom Validation Rule in existing street field of shipping address form Checkout Magento 2?

Basically I am trying to add custom validation rule in existing street field of shipping address form Checkout in magento 2 where pobox should not be allowed. I tried using mixin with requirejs-config....
0
votes
1answer
35 views

Magento admin ui after render event

I'm trying to create a custom text-area in admin panel and I need to attach the afterRender event to it. Config XML: <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
0answers
173 views

Slick Slide After Scroll Slide is Working Magento2

I have used Slick Slider for Product Comparison in Magento 2.3. The issue here is when I scroll alone the slick slider gets activated. But I need to load slider before. Its Like I Am new to ...
0
votes
0answers
14 views

Magento2 get all validate field fail on checkout

I would like to get all validate field failed on checkout after clicking button placeorder. After that, I will show a popup notify all field. How can I capture where return all validate field fail? ...

1 2
3
4 5
14