Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

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

Magento 2: how to get product details using Magento_Checkout/js/model/quote

In Magento 2 how we can get the product details using Magento_Checkout/js/model/quote
2
votes
0answers
13 views

Magento 2: How to bind an element in phtml with minicart js model function?

I want to print the items count in somewhere else, so i create a new phtml like this: <?php /** @var $block \Magento\Checkout\Block\Cart\Sidebar */ ?> <div class="test-cart" data-...
1
vote
0answers
15 views

Magento 2 - Save data of customer from a form in database

I wish I could create a form with several inputs dedicated to the customer's attributes in my first custom checkout step. This form will have to save the data in the database, in the customer ...
2
votes
0answers
10 views

Magento 2.3.4: Not able to search admin grids

Recently upgraded from 2.3.1 to 2.3.4-p2 and now we're not able to use the keyword search above admin grids like Catalog > Products, Sales > Orders, etc. We can still use the filter boxes, but ...
1
vote
3answers
48 views

How to get store logo url in Javascript file in Magento 2?

I want to load store logo image URL in javascript so i can bind it to my knockout element, how can i achieve that?
0
votes
0answers
15 views

Magento 2 - Create repeatable field in checkout and saving the data to model

I am trying to create fields for each product in the cart. Some extra data needs to be filled in per product and the wish was for it to be found in the address section of the checkout form. I can ...
1
vote
0answers
11 views

How to initiate tabs widget when all payment methods are rendered

I want to initialize tabs widget on payment methods on checkout. How would I know if all the payment methods are rendered and it is now safe to initialize tabs. Thanks
0
votes
0answers
13 views

Create dynamic div using for loop

Suppose i have array like this [ ['suplier1'] ['suplier1'] ['suplier1'] ['suplier2'] ['suplier2'] ['suplier3'] ['suplier3'] ['suplier4'] ] And I want to create html ...
0
votes
0answers
21 views

magento2 select data form more form

I am doing save data to database. But i have three form in here But when i submit. The data received only one final form This is my code public function execute() { $resultRedirect = $this-&...
0
votes
0answers
8 views

Magento 2 Add option in section “Please select in shipping and billing address are same” drop down

I want to add option "Please select" on checkout page when unchecked "My billing and shipping address are the same" checkbox in drop down.I have checked all module-checkout module ...
0
votes
0answers
10 views

Magento 2: Error Disable some dates in jquery Datepicker

I try to add datepicker in magento 2 checkout page like this: ko.bindingHandlers.datepicker = { init: function (element, valueAccessor, allBindingsAccessor) { var $el = $(...
0
votes
1answer
27 views

Magento2: How to get country list in custom HTML template

I need to display a country list with dropdown in the custom knockout HTML template. Help would be appreciated.
0
votes
0answers
23 views

Magento 2.3.4 In checkout form, Customer Address Custom attribute not getting displayed. Getting knockout error

I'm using magento 2.3.4. I have added custom attributes in customer_address. the attribute is properly saved and displayed too in my customer account. But in checkout, I'm getting error of knockout. ...
0
votes
0answers
12 views

How can i Stop calling event bind with data-mage-init

I am implementing infinite scroll in a custom collection which is working perfectly but in my case when i filter out this collection and update collection item with ajax response still the previously ...
0
votes
0answers
9 views

SKU switcher based on configurable selection

I am trying to update the product SKU based on the product selection chosen.. I have the following code that works, but only works if the configurable product is in stock (eg at least one of the ...
0
votes
1answer
31 views

Unable to process binding on product page Magento 2.3.5

Hello i'm facing an error that i absolutly not understand. I just to upgrade my magento from 2.3.2 to 2.3.5 and i have a knockout.js error on my product page and an infinite loader . I don't no where ...
3
votes
1answer
72 views

Magento 2.3.4: How to bind an event handler to 'street[0]' input on the checkout page?

I've been trying to ensure an alert displays on a user typing in PO BOX number in the street address field on the checkout page, saying we don't ship to PO BOX. My jQuery code doesn't seem to bind a ...
0
votes
1answer
24 views

Magento 2.x knockoutjs dispaly data from observable Json Object

to display data from observable array one can do: Component: myObject: ko.observableArray([{name: 'test'}]), Html: <ul data-bind="foreach: myObject"> <li data-bind="text: name">&...
0
votes
1answer
33 views

How to populate Purchase Order Number with a random rumber?

Magento 2.3.x Purchase Order used as a payment method requieres a purchase order number. Some of our customers don't have that number, so we need to pre-populate this input field with a random content ...
0
votes
1answer
22 views

'getFormattedPrice' undefined on checkout

I need to get a list under each product in the form: - Unit price - Amount - Amount based on price and quantity Rewrite template: vendor/magento/module-checkout/view/frontend/web/template/summary/...
1
vote
1answer
36 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
34 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
10 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
19 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
42 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
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 ...
0
votes
1answer
23 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
2answers
72 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 ...
1
vote
1answer
32 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 ...
0
votes
0answers
21 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
9 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 ...
1
vote
0answers
38 views

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

How to use if / else condition in html template file ?
1
vote
2answers
33 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
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( '...
1
vote
0answers
19 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....
1
vote
0answers
33 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\...
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
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
17 views

About Advantages of js & css merge , minify in magento 2?

Advantages of js & css merge , minify in magento 2?
0
votes
0answers
18 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
58 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
28 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
0answers
18 views

Issues with <!— ko if: messages().messages && messages().messages.length > 0 -->

I had problem with file : /vendor/magento/module-theme/view/frontend/templates/messages.phtml. I'm using Magento version 2.2.3 . In current, when I run test with add product bundle from list product ...
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)==...
0
votes
0answers
15 views

How to generate a drop down select box using knockout JS

I Have below code. <ul class="giftcard-amount"> <!-- ko foreach: {data: amounts, as: 'amount'} --> <li class="giftcard-design-button-container" data-bind="...
0
votes
1answer
22 views

Magento 2 Hide Shipping Price on Checkout with Mixin

I have added a mixin for checkout shipping.js: requirejs-config.js var config = { config: { mixins: { 'Magento_Checkout/js/view/shipping': { '...

1
2 3 4 5
14