Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

Filter by
Sorted by
Tagged with
0
votes
2answers
914 views

How to implement jQuery click event in magento knockout JS function

how to implement below jQuery code into knockout js, Actually I'm trying to call this function on a button click event using knockout js, but it's not working HTML code: <div> <ul class=&...
0
votes
1answer
130 views

Mini cart js is not working properly the count is not showing some times

Minicart is not showing cart count properly at the time of not logging in. I had tried to show statically into the id condition but the when loading the 0 is shown after load it is not showing, I ...
1
vote
0answers
78 views

Magento 2: How to make new billing address form shows up in popup in checkout just like new shipping address form?

In magento 2 checkout page there will be a pop up form when we add new address instead of using current shipping address, but for billing address the new billing address form is below the dropdown, is ...
0
votes
1answer
974 views

Magento 2.3.4: Refresh window.checkoutConfig

We are adding shipping price of quote object to myTestData which is pulled onto the page using window.checkoutConfig.myTestData: use Magento\Checkout\Model\ConfigProviderInterface; class Config ...
0
votes
0answers
79 views

Jquery callback function cannot read property of undefined using knockout js

1.lets assume placeOrderClick function is called.within this there is a eprotect API success callback function called submitAfterEprotect. i'm trying to call placeorder function using self in ...
0
votes
1answer
31 views

Magento 2: How to translate knockout html file for word that contains hyperlink?

I have a text like this: To contact us please email us at joe@mail.com, will be waiting! when the user clicked on the email it will redirect the user to mail link, using phtml i can easily achieve it ...
2
votes
1answer
573 views

Uncaught TypeError: Cannot read property 'status' of undefined misc.js:181 checkout shipping page Magento 2.3.5

I am facing below console error in our site so that some of our extension stopped working in checkout shipping page Magento 2.3.5 pub/static/frontend/Vendor/Theme/en_GB/mage/utils/misc.js define([ ...
2
votes
1answer
209 views

Wishlist not working for login customer in magento2 with caching if once i add product then wishlist icon remove by KO wishlist().counter?

How can I set my wishlist for logged on customer and log gout customer with knockout JS if I logged on then I only add product once then wishlist icon remove because of knockout JS how to write ...
1
vote
1answer
126 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
26 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
25 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
16 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
130 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
31 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
14 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
121 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
26 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
17 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
111 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
86 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.
1
vote
0answers
116 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
1answer
73 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
379 views

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
219 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">&...
1
vote
1answer
70 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
154 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
222 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
1answer
73 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
1answer
166 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-...
1
vote
0answers
556 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
1answer
136 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
453 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
122 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
130 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)....
1
vote
0answers
180 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
126 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
1
vote
0answers
26 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
0answers
150 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
1answer
42 views

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

Advantages of js & css merge , minify in magento 2?
0
votes
1answer
397 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
1answer
150 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
20 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
1answer
193 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': { '...
0
votes
1answer
1k views

Magento 2 : Calling a JS function from another JS file?

This Accessing a JS function from another JS file solution not mapped on my problem ,Please give me direction that how can i call getPureValue: function () from tax.js into some where in minicart.js ...
1
vote
1answer
54 views

How can I get Payments Details In an block below Order Summary in Checkout

I know the way to get the block but not about the payment info.
0
votes
1answer
270 views

How to apply Custom CSS on magento 2 checkout page(shipping and checkout)

i have added two fields in my magento 2 checkout at shipping address tab. My fields are check boxes and and i want to add some css to those check boxes therefore i have added custom css file but as i ...
1
vote
2answers
488 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 ...
0
votes
1answer
402 views

Magento 2: Prevent “Add to Cart” Error Message Autohide

On product page, if you try to put more than available product count into the shopping cart, there appears a red error message "The requested qty is not available" thats good. But in my magento ...
1
vote
1answer
3k views

Add custom javascript in afterRender in Magento 2 with knockout

I`m trying to load a custom script after a custom-template for minicart items is rendered. I created a javascript file vendor\module\view\frontend\web\js\test.js: define('jquery', function($) { ...
1
vote
1answer
84 views

Magento 2 - Where Knockout js variable are defined?

In Magento 2 I don't understand how knockout js templates work. In this file : vendor/magento/module-checkout/view/frontend/web/template/summary/item/details.phtml <div class="product-item-inner"&...

1 2
3
4 5
15