Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

Filter by
Sorted by
Tagged with
1
vote
0answers
16 views

Ui element and knockout js array subscriber/listener

I would like to do 2 thinks with knockout js and UI component Fill in input in a grid based on entity_id - Works great Trigger callback when one of input has changed The second part works partly. ...
0
votes
0answers
10 views

How to calculate the amount based on the number of elements on the checkout in the sidebar using knockout

In the block Your Order sidebar there is a block with the elements that are in the basket It has 2 fields price and quantity How to add one additional to these two fields, which is responsible for ...
0
votes
1answer
24 views

Magento 2- How to pre select and load CCAvenue on checkout page

I have installed and configure the CCAvenue payment method in Magento 2.3 successfully, now I want to pre-select and load CCAvenue on the payment section. Please suggest.
0
votes
0answers
5 views

Order summary items-in-cart update

I want to update the items in cart count in the checkout#payment sidebar. I have added a button that when clicked the items in cart will be added by one. So far the items in cart are updating ...
0
votes
1answer
13 views

Display formkey in knockoutjs template

I have a phtml template that display the formkey in my html file. Below is how I'm displaying this <form action="" method="post" id="form-validate-pound" class="form form-...
0
votes
0answers
24 views

Checkout address custom attributes don't get rendered in address information components

I have to add a new customer address attribute apellido2, this field is a second last name and must be present in both shipping and billing address. So I after reading a few posts, I started with my ...
0
votes
0answers
35 views

How to use if condition(knockout) in html template ? magento 2

How to use if / else condition in html template file ?
1
vote
1answer
711 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
0
votes
1answer
717 views

magento 2 how to override select-shipping-method.js

when trying to override select-shipping-method.js in my custom module then getting this errors 1 - Uncaught Error: Script error for: Xyz_Customcheckout/js/model/quote http://requirejs.org/docs/...
0
votes
0answers
23 views

Magento 2: All variables in knockout.js

in Magento 2 I created a module that shows all items in the cart on every page. The price is f.e. shown with: <span data-bind="text: product_price"></span> Now I am wondering if there ...
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
2answers
34 views

Magento 2 Set Default Zip/Postal Code in cart page

I have overridden the vendor/magento/module-checkout/Block/Cart/LayoutProcessor.php in my module and added below code to set the default value of postcode class LayoutProcessorPlugin { public ...
2
votes
2answers
731 views

Get customer chosen shipping method with jQuery

How could i find out the shipping method that the customer has chosen right after click of change? I have tried to get shipping methods id or value that customer has chosen when he/she has clicked ...
5
votes
2answers
958 views

Magento 2 : How to debug knockoutjs getRegion() bindings

Shipping address is displayed using below knockout js code. I am having a hard time finding the back-end code that's setting data for getRegion('ship-to') function even though I could see the UI JS ...
0
votes
1answer
19 views

Magento 2 How to observe cart price in JS Component

I want to show amount after which free shipping will be available in mini cart like below For that I override minicart.phtml in view/frontend/layout/defaul.xml like this <?xml version="1.0"?> &...
1
vote
1answer
743 views

get shipping description by ko

this code return shipping method title ... how i can get shipping description ? define( [ 'jquery', 'Magento_Checkout/js/view/summary/abstract-total', 'Magento_Checkout/js/model/quote' ], ...
1
vote
1answer
31 views

How to removed mini cart picture with the width and height

I need to remove the width and height of the picture in mini-cart pages. I have checked about Magento developer document. I realize I can set up in view.xml to change the width and height, but here is ...
2
votes
2answers
3k views

Magento2 Knockout js - issue on cart

I tried to reposition my cart block to a other header location. Since then I am getting this javascript error which is annoying since I only repositioned a block. Uncaught TypeError: Unable to ...
0
votes
0answers
16 views

How to add a JS script after full page loading in checkout in magento2?

Since the checkout page is loaded asynchronously, I am not able to call the js script after entire page is loaded.I tried using below code require(['jquery'],function($){ $(document)....
0
votes
0answers
8 views

Magento2: Remove Address from Checkout page based on condition

In customer address, 2 fields are there like is_shipping and is_billing so based on the true and false I have to show the address if is_shipping is set as 1 so I have to show that address in the ...
0
votes
0answers
21 views

How to update the QTY on the default checkout of magento2?

I have customized the maegnto2 default checkout, and I want to update the qty on it, and the price, subtotal and shipping etc should auto update when we update the qty . qty update should work like it ...
0
votes
2answers
1k views

Knockout.js What is the correct way to reference $parent on js file?

I am new on Knockout.js, especially on how to use it in the Magento way. I create a custom ViewModel with a js file called storepickup-select.js and an HTML template called storepickup-select.html. ...
1
vote
1answer
1k views

How to refresh shipping and billing address after checkout page load just like shipping Rates refresh using Knockout Js magento 2

Hi guys, i want to refresh shipping and billing address after checkout page load using Knockout Js magento 2. If you guys have any idea please guide me. Please check the code i tried below ...
1
vote
2answers
29 views

Hide company field on checkout step based on customer group in Magento 2.3?

I am working on checkout step for hiding the company field on the basis of customer group. can anyone help me to solve this ? Thanks
0
votes
0answers
8 views

Magento2: How to add/get click function with DOM?

filename.js categoryClick: function(data, event) { var clickUrl = $(this).attr('href'); console.log(clickUrl); }, filename.html <div class="bottomWrapper"> <ul id="progressbar"&...
0
votes
1answer
1k views

Debugging Magento Checkout- Property getType of Null, when messing around with Billing and Shipping Address

I am doing some heavy customization on the checkout (pulling billing address to the first position, next to shipping address). If have added a plugin to view/shipping.js: define( [ '...
1
vote
2answers
100 views

Magento 2 knockout js translation is not working

I'm using Magento 2.3.4 I'm looking at the translation issue for the last few days but I didn't get any answer. I have used mageplaza one step checkout module. Very recently I have upgraded the ...
1
vote
2answers
478 views

How can you get the config value in html

I want to know if you can get the config value to html I have a class which provides the value for config Not sure how to get this checked in HTML I have been looking at configproviderinterface
7
votes
2answers
2k 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
0answers
9 views

I am calling custom value on the checkout page and getting error can someone please check and guide me where I am going wrong

_scopeConfig->getValue( 'contact/checkout/status', \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); $states = $this->_scopeConfig->getValue( '...
0
votes
2answers
789 views

How to observe checked event for different radio button groups?

I have created a new checkout step in which each product is listed along with the option to select which delivery method to use normal shipping or store pickup. I have displayed the product ...
0
votes
0answers
18 views

Magento 2 mage/url in Admin

I have followed this solution Magento2: How to get adminUrl in js file using something like 'mage/url'? and its perfectly working. But when i add Add Secret Key to URLs that time it don't work....
2
votes
1answer
1k views

Validation Error with jQuery-UI Autocomplete and KnockoutJs - Magento 2

The Problem: I've implemented jQuery-ui Autocomplete with Knockout Js in Checkout Page but some input fields that are binded to my Component throw a validation error ("Required Field") when i update ...
0
votes
1answer
711 views

Magento 2 EE Checkout Page not working (JS error)

I am facing an issue of knockout JS file on my site bixlercollegiate.com. My products are being added, but when I click on checkout, the page becomes blank. When I checked my console on Chrome, the ...
1
vote
2answers
1k views

how to trigger click event in M2

In my header section I have user name and if user have access to different location then he has button saying click me. I want to send ajax call on this button. But JS is not working. Can anybody help ...
0
votes
0answers
27 views

Use knockoutjs in Ui component of Admin form

I have created a form using UI component on Admin side. If i want to add a .phtml then i can add the file this way. <htmlContent name="driven_form_design"> <block class="Magento\Backend\...
4
votes
1answer
1k views

Magento 2.1. How to display select box instead of box in checkout shipping address?

As checkout page layout is mostly build in knockout.js and I have zero knowledge of knockout.js. I want to show shipping address in select box <select> instead of Box (ref to image - section 1) ...
6
votes
4answers
4k views

Magento 2: javascript elements load slowly

Checkout forms, gallery on product pages, and more elements loaded by javascript take up to 4 seconds to load. What can be done to make javascript elements load faster? Update: I'm using a custom ...
0
votes
0answers
16 views

Where one can learn the knockout js especially , how its used in magento 2?

Knockout js is interesting & complicated at the same time, As checkout is all ui component and knockout js , how one can learn knockout js which is used in magento 2 ?
0
votes
1answer
39 views
1
vote
1answer
847 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', ...
0
votes
1answer
703 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
0answers
9 views

Can we use knockout js as a method/approach for some functionality or fix , rather then using simple jQuery with lots of settimeout?

Can we use knockout js as a method/approach for some functionality or fix , rather then using simple jQuery with lots of settimeout for keep observing on the behaviour/clicks in checkout page ?
0
votes
1answer
16 views
1
vote
1answer
1k views

Binding Events On Dynamically Generated DOM Elements Knockout + Magento 2

I am working on a module where i have generated few DOM elements dynamically. But when i am trying to call certain function on some events then its not getting called. Here is the code sample. Here ...
0
votes
0answers
17 views

URL is appended by 'undefined'

After upgrading Magento to 2.3.4 we are facing a strange issue ajax URL is appended by undefined we try an ajax call using knockout js URL is like: /checkout/undefinedrest/default/V1/guest-carts/...
0
votes
1answer
32 views

Magento 2 + Get customer default billing address in custom module js

Is there any way I can get a customer default billing address in custom js ? var defaultBillingAddresses = addressList().filter(function (address) { console.log(address.getType()); ...
0
votes
0answers
16 views

Magento2: How can set same sequence of bundle option in summary box?

I want to do same sequence in summary box like all option is showing of bundle product. Please check below screenshot. I have tried to edit in this path but unable to do this. app/code/Mymodue/...
0
votes
1answer
27 views

knockout template html file in adminhtml area is not rendering

I am trying to initialize the knockout component in the admin html area, the respective code is below. phtml file to initialize ko template <?php /** * @var \JC\ChatSupport\Block\Adminhtml\...
0
votes
1answer
13 views

conditional knockout with ajax response

I created an default template for items in the minicart. The difference to the default template should be shown only under a specific condition. <!-- ko if: $parent.myvalueactive(product_sku)==...

1
2 3 4 5
14