Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

2
votes
1answer
62 views

Zoomed image didn't close in Magento 2.2.3 and 2.2.4

I have just installed Magento 2.2.3 in my system. I have also added few categories and that of products. I can see a bigger image when I have clicked on it and it has been closed when I clicked on "X" ...
2
votes
1answer
566 views

How to override js functions which is inside the return in magento 2(mixins)

I need to override the setPaymentMethods() function in below js using mixins. Please provide me a solution to override the function which is the return value of the js magento/module-checkout/view/...
2
votes
1answer
346 views

Custom Checkout Validation: two fields must have the same value validation

I created two custom password fields, the confirm field should check if the value is the same as .create-password-field. I saw that Magento 2 uses equalTo but I can't get that to work in a uiComponent ...
1
vote
0answers
23 views

Magento2 - Custom Payment Method - standard approach to show dynamic data on payment method

What is the best way to show dynamic data (i-e pending balance or something) on payment method at checkout page ? Here is the screenshot for further reference. USD 1000 is the dynamic value which i ...
2
votes
1answer
827 views

Custom fields checkout checkbox toggle required?

in the Magento 2 checkout I added 3 custom fields, a checkbox that shows the customer two password fields that are used to create an account. Since the checkbox toggles if the fields are visible or ...
0
votes
0answers
75 views

How override the variable which is in existing core js (using mixins)in magento 2

I need to override the variable cacheKey in my custom js var cacheKey = 'checkout-data', /** * @param {Object} data */ saveData = function (data) { ...
0
votes
0answers
54 views

How can I check custom attribute of a product in file vendor/magento/module-catalog/view/base/web/template/product/list/listing.html?

I have added the recently viewed product's widget in CMS block in admin and I have added a code in .phtml files (wherever I need to show recently viewed products) to display this block using the ...
0
votes
0answers
134 views

Magento 2 : Pulling Dynamic Data in Checkout Agreement Popup

I'm trying to fetch some dynamic information related to order and customer in checkout agreement popup. Is there a way we can do this easily ? I have checked core Module module_checkout_agreement to ...
0
votes
0answers
326 views

Uncaught Error: You cannot apply bindings multiple times to the same element. and Bootstrap's js requires jquery error coming

I have created custom module in magento2.2. Whenever am loading that page at first It's showing two errors in console Uncaught Error: Bootstrap's JavaScript requires jQuery Uncaught Error: You cannot ...
2
votes
1answer
340 views

Overwrite third party template file in my custom module

I have done some research to this subject but couldn't seem to find a detailed answer. What I need To overwrite a template file from a third party module in my case: Amasty One Step Checkout ...
1
vote
2answers
783 views

How to translate text in Knockout file

I want to translate KO text. "You have no items in your shopping cart." "Empty Basket" Already tried with translate.csv it doesn't work. Is there any way to translating knockout template text in ...
0
votes
0answers
59 views

The best way to add an extra attribute to checkout shipping form fields

I want to know the best way to add some extra attributes ('disabled' & 'readonly') in shipping checkout form. I found some workaround to bind a js in knockout but my js is loaded before the form !...
0
votes
1answer
29 views

Magento 2 : Form Component changes through component are ignored

I think there is a "changed" event somewhere that needs to be called, but I don't know what element or component, here is my code: requirejs(['jquery', 'uiRegistry', 'underscore'], function($, ...
0
votes
0answers
294 views

mini-cart not working on homepage but it's work on other pages

Homepage Vs other pages My theme structure : I didn't use requirejs-config.js in my theme Problems: My minicart doesnt't show count item on home page. it show on all other pages. Here's my ...
2
votes
0answers
47 views

How can I set Comment box as Required field In Checkout Page Magento 2

I have purchased one extension for Delivery date and comment box. Now I want to set Comment Box Mandatory, I have tried I think it uses Knockout JS so I am unable to set it mandatory. Any Help. My ...
2
votes
1answer
133 views

Alternative Knockout syntax?

Today I've noticed an alternative syntax in a html-template in Magento 2, which I hadn't noticed before. If you take a look at the checkout/shipping template, you'll notice a syntax like: <each if=...
3
votes
0answers
186 views

knockout js in Magento 2 admin [closed]

How to use knockout js in Magento 2 admin sales order creation? I did the same way like frontend but my code is not working. Kindly help me, if you have used knockout js for admin.
0
votes
1answer
339 views

Magento 2.2.4 - Checkout summary in custom phtml

I have a custom off-canvas sidebar (foundation 6) which I declared via a standard phtml template. It shows only in the checkout. Now I would like to display the content of the checkout's sidebar (...
0
votes
2answers
587 views

How do I customize the steps of the progress bar on Magento 2 Checkout?

I would like to quite simply change the "shipping" step on the magento 2 checkout to read "delivery information". I tried to do it through translation to no avail. I am wonder can anyone point me ...
1
vote
1answer
195 views

knockout js hiding button text

I am using knockoutjs to send ajax call and successfully am able to do that but when I click on update button the text on button gets to hide. <div class="field-group"> <!-- ko foreach: ...
0
votes
2answers
262 views

How to Interract with Knockoutjs Variables | Magento2

1) I'm trying to filter the customer addresses in the checkout according to their postal code. The address blocks are displayed using the following knockoutjs code: vendor/magento/module-checkout/...
2
votes
2answers
1k views

Format price value in knockout template

In Magento 2's checkout summary I managed to add price values to each "item in cart": <span data-bind="text: $parent.price_incl_tax"></span> <span data-bind="text: $parent....
3
votes
0answers
117 views

How to call KO js functions outside the template

Is it possible to access variable addressConverter from custom js file. Filename: Magento_Checkout/js/action/create-shipping-address.js /** * Copyright © 2013-2017 Magento, Inc. All rights ...
1
vote
2answers
517 views

Extention Attributes in payload return as null in backend

I am trying to implement Extention Attributes. I want to send the e-mail and a subscribe boolean to the backend in the checkout. In ShippingInformationManagementPlugin the var_dump(...
0
votes
1answer
546 views

magento 2 custom component at checkout-step-shipping as shipping address child

I trying to add a custom template @ checkout between form customer login and shipping address inside div id="checkout-step-shipping" there are 2 forms : I've tried a few thing like 'before-form' etc....
0
votes
1answer
444 views

Open Popup in checkout page

I need to create a popup for coupon code in checkout page.. In discount.js: showPopup: function () { alert("popup"); var couponcodepopup = { type: 'popup', ...
2
votes
1answer
204 views

Adding events to input on checkout

I'm trying to add an event like 'keyup: validationSuccess' to all input fields on the checkout. I have overwritten input.html and added the Js to Shipping.js but now when i go to checkout/cart.html I ...
0
votes
2answers
595 views

Accessing a JS function from another JS file

I'm trying to access a function from 'create-validation-list.js'. define([ 'jquery' ], function ($) { return createValidationList = function () { // Code } shipping.js define([ 'jquery', '...
3
votes
1answer
356 views

Working around knockout without need to compile

How can we work with knockout without having to compile the Magento every time? I have disabled all cache and set Magento on developer mode but still, it needs to compile and clear cache.
1
vote
0answers
92 views

Theme without require.js, knockout.js, AngularJS

I'm evaluating a the moment Magento2 as a solution for our Shop and I looked into a lot of Shops based on Magento2 to test the frontend performance and to be honest, I'm shocked. Every Shop I saw ...
4
votes
3answers
166 views

Best source for Knockout js

As a beginner, can anyone tell me which is the best source to learn how the knockout js works in magento2? I have tried learning from http://knockoutjs.com/ but it does not give the detailed idea for ...
0
votes
1answer
1k views

Magento 2 knockout Select options not returning the value

I have Created custom component with select drop down when I select an option and alert the select option it spits out : function observable() { if (arguments.length > 0) { ...
0
votes
3answers
492 views

M2: How to get storeId in javascript?

I'am adding a new validation rule. The result should depend on storeview code. How can I get the storeId in the following javascript code? validator-mixin.js define([ 'jquery' ], function ($) {...
1
vote
1answer
511 views

Magento 2, why data-mage-init validation not working when I use knockout component

I have a phtml file with a form that used data-mage-init <form data-mage-init='{"validation": {}}' class="form" id="custom-form" method="post" autocomplete="off"> </form> and then I ...
1
vote
0answers
69 views

Magento2 : knock out js

I would like to change the changes in checkout page address fields, how to remove the fields or update, the code is knockout js. How to modify this. <div class="address-information address-info-...
2
votes
1answer
335 views

How the list.html(Magento_Checkout/web/template/payment-methods/list.html) is works to render and display the payment methods in checkout page

I wish to know how the list.html works while displaying the payment methods. 1)How it loops to display the payment methods using below template list.html <div if="isPaymentMethodsAvailable()" ...
1
vote
1answer
399 views

Magento 2 - how to load JS template from filesystem in jquery widget

For example, native Magento theme-frontend-blank\web\js\navigation-menu.js has such code: $.widget('mage.navigationMenu', { options: { ... collapsableDropdownTemplate: '&...
0
votes
1answer
822 views

Uncaught TypeError: Cannot read property 'top' of undefined at step-navigator.js

I am getting following error. Uncaught TypeError: Cannot read property 'top' of undefined at step-navigator.js:158 I have created a custom step using Magento 2 documentation http://devdocs....
1
vote
0answers
52 views

How do I edit KO template in magento 2

I wish to edit /var/www/html/xxx/vendor/magento/module-checkout/view/frontend/web/template/payment-methods/list.html Exactly in below line, Because which is the responsible file to render the ...
0
votes
1answer
610 views

Magento 2 : How Can I get Selected Payment Details on Next Step

Using knockout js, I have created a custom step, which I have place after payment method. I need to show which payment method was selected by the user. I am creating a custom step as summary step. I ...
0
votes
1answer
190 views

Not showing messages at onestepcheckout in magento 2.2.x

After the ajax process get the error from the payment api i can see that the Magento_Ui/js/model/messages.js it triggered and the message should be added to the list but I cant see anything in the ...
0
votes
1answer
340 views

Uncaught TypeError: utils.convertToMomentFormat is not a function

I am working on a Magento 2.1.7 shop. To achieve this, I have created a child-theme of Magento Blank. Whenever I go, within the Magento admin, to Content > Blocks, there is this error in the console: ...
0
votes
2answers
993 views

Magento 2 checkout knockout.js in custom template error - telephone field

I'm trying to create a mask for telephone field in Magento 2.2.2 checkout. In order to do so. I placed a checkout_index_index.xml with a new template for telephone field at vendor/mytheme/...
1
vote
2answers
1k views

Magento 2 : Remove Billing Address From Payment Step in Checkout

In the payment step under checkout in Magento 2, I'm trying to remove the address and the option: 'My billing and shipping address are the same '. Because I have added billing address to shipping step....
0
votes
1answer
198 views

Magento 2 : How Can I Override Step-Navigator File From Checkout

I want to override step-navigator js file. I had followed this method How to extend js class/method of checkout model class in magento 2 but it didn't work. any help. I want to override this method. ...
0
votes
1answer
89 views

How to replace knockout with old school layout xml and phtml

Let me be straight: knockout.js is a pain in my sitting device. It creates yet another layer of abstraction, is hard to debug, creates enormous overhead (more files, more code, more possibilities for ...
2
votes
1answer
847 views

Go to next step after submitting custom form in Magento 2 checkout

I created a module to add a new step to the Magento 2 checkout. This step has a custom form. On submitting the form I can't figure out how to go the the next step. checkout_index_index.xml <page ...
3
votes
1answer
1k views

How to get the Quote Id from Masked Quote Id (QuoteIdMask) in magento 2

I need to do something after applying the coupon code in the checkout page, So I have created the ajax call in the response of set-coupon-code.js in Sales Rule module. But I got the Masked quote Id ...
0
votes
1answer
200 views

How to access custom data from a customer session in JS file?

Is there any way to access custom data stored in a customer session from a JS file ( without Ajax call ). Here is the code for controller: <?php namespace Company\Vendor\Controller\Index; use ...
1
vote
1answer
737 views

Magento 2 - Display product collections some column using knockout js binding

I am trying to display product collection using knockout js binding. But not working. Please guide me. Also in Magento2 is require to manually applyBinding when using component.? Also please anyone ...