Stack Exchange Network

Stack Exchange network consists of 174 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 [knockout]

The tag has no usage guidance.

0
votes
0answers
28 views

Magento 2: Knockout js dynamic content binding repeats the same element

I have created a custom form in checkout page. It contains a drop down field and one ul list. By default there is few li tags(For example,4). When we change the dropdown the li tags will be changed( ...
1
vote
1answer
71 views

Magento 2: Knockout js dynamic content binding issue

I have created a custom form in checkout page. Everything works fine except one ajax response binding Here is my code template.html <form id="cust-checkout-form" class="form" data-bind="attr: {...
0
votes
0answers
15 views

Knockout : Read parent of parent data

I want to read parent of parent elements data. But, I can't able to read it properly. My Array Screenshot : My Code : <!-- ko foreach: { data: Object.keys($parent.optionParam()[main_id]), as: '...
0
votes
1answer
68 views

Magento 2 : Access ko observable variable into other js file

I want to access ko observable variable from one js file to other js file. I apply some logic using below way. But, it's return undefined. kotemplate.js : define([ 'jquery', 'uiComponent', ...
0
votes
1answer
32 views

Magento 2 : knockout data-bind:click not working

I added phtml file using ajax response. There are two buttons available in that phtml file. Buttons.phtml : <div id="rh-buttons-temp" class="actions" data-bind="scope:'rh-buttons'"> <!--...
0
votes
0answers
24 views

Magento 2 : Bind data on ajax response using knockout not working proper

I want to call phtml file and on button click that function call from knockout js file. buttons.phtml : (File call in ajax response) <div class="actions"> <button type="button" title="...
0
votes
2answers
27 views

Having trouble overwriting JS component in minicart dropdown

Having a tough time trying to overwrite the JS component and template around the product image in the minicart dropdown.Here's what I am trying to achieve: I have a custom Product Type depending on ...
1
vote
0answers
28 views

Magento 2 : add google map in checkout

I want to add google map in Magento 2 checkout page. Added API url and key to phtml using below code <referenceContainer name="after.body.start"> <block class="Test\Vendor\Block\...
0
votes
1answer
37 views

Add/Remove class from div if minicart hasitem/noitem

I want to add a class in parent div if minicart/cart is empty and remove same class if minicart/cart has an item(s).I made changes in minicart.phtml. below is my code for that. <div class="block ...
0
votes
1answer
28 views

How to understand KnowkOutJs in Magento 2?

How to understand KnockOut Js in Magento 2 ? I am working in Checkout and cart page, I debugged a lot but i am not able to understand any single line code of KnockOut Js But without Magento 2, I am ...
1
vote
0answers
25 views

Magento 2 Knockout Component after initialize hook or method

In the knockout component I have initialize: function () { this._super(); var self = this; ....some code.... } I want to move the ....some code.... part into afterInitilize() method, ...
1
vote
1answer
73 views

Checkout - can't go to Payment step

Getting ko_unique_1=flatrate_flatrate#shipping in URL as param when clicking Next button on Shipping step. The page gets redirected to shipping step and customers are unable to proceed.
1
vote
1answer
101 views

Can anyone explain <item name=“customEntry” xsi:type=“string”>shippingAddress.region</item> this line how workin checkout page in magento2?

Can anyone please explain below line in magento2 checkout page <item name="customEntry" xsi:type="string">shippingAddress.region</item>
0
votes
1answer
109 views

Magento2 : How to display custom values in checkout page

I am working on checkout page, I have pass some array values to checkout config provider. How to get those values in knockout JS and display by knockout html. Want to display all applied codes in ...
3
votes
1answer
396 views

Magento 2 : From where and how does knockout retrieve data on checkout

I know the following: That checkout is done with knockoutjs. Somehow data from PHP is passed to knockoutjs Where is this passing made ? If we look at project-root/vendor/magento/module-checkout/...
0
votes
0answers
88 views

Calling knockout js with php params

<span class="aem-image-with-borders-container" data-bind="scope: 'catalog-image'"> <!-- ko template: getTemplate() --><!-- /ko --> <script type="text/x-magento-init"> {...
3
votes
1answer
462 views

How to change a qty text in Minicart?

How to change qty text box into dropdown in minicart place view/frontend/web/template/minicart/item/default.html file ?
1
vote
0answers
29 views

how to set dropdown in magento2?

How to set drop down field in minicart qty place file path view/frontend/web/template/minicart/item/default.html file if anyone knows please explain me
5
votes
1answer
519 views

Pass data to child template in cart-items of checkout page

My site is a market place site where vendors(sellers can sell their product). Now i want to customize the to group items in cart by each vendor like this: http://prntscr.com/hmsam6 ...
6
votes
1answer
4k views

magento2 check if customer is logged in or not in knockout template

How do I check if customer is logged in or not in knockout template? my template <!-- ko if: customer().firstname --> <!-- /ko --> my js define( [ 'ko', 'jquery', ...
2
votes
1answer
298 views

Magento 2 dynamically add rows to tier price

Task : To trigger Add button so that a new row is inserted in tier price block every time the loop runs via jquery I have loop which is triggering the click on Add button but the issue is that the ...
0
votes
0answers
42 views

Magento 2: How to use 2 minicarts with same knockout template?

In my site are use 2 minicarts (in header and sidebar) with same knockout template: app/design/frontend/Vendor/Theme/Magento_Checkout/web/template/minicart/content.html I want to adjust small fixes,...
1
vote
3answers
1k views

Magento 2 : External link in admin order grid not linking when click

I have an extra column in my Magento 2 admin order grid, with a column with external urls. This is working well (I see an overview of al my hyperlinks). But when I click on a url, I go to the order ...
1
vote
2answers
3k views

Best Way Of Getting Base URL Inside KnockoutJS .html File

How can I get the base URL inside a KnockoutJS HTML file? See file below: app/design/frontend/<Vendor>/<Theme>/Magento_Checkout/web/template/<Filename>.html
1
vote
1answer
639 views

Magento 2: Why I'm getting JS errors after removing browser cache?

I'm using Magento 2 Porto theme and I relocate the position of some header elements like language selector etc. its working fine sometimes but after removing the browser cache its showing following js ...
0
votes
1answer
468 views

Magento 2: Update specific input field class via Knockout

I would like to update / add a class to a specific text input field via Knockout (as opposed to just using JQuery). For example, I'd like to add another class to the input below. And, more ...
0
votes
0answers
195 views

shipping address is missing out on checkout

I don't know why but i get an error js on checkout. When I'm on the payment step, The shipping address Below the choice of method of payment is absent. The problem come from an error with Knockout. ...
3
votes
1answer
814 views

Magento 2 custom module override knockout template

How can we override a knockout template in a custom module? I know how we can do this in our own theme but I need this in a module. For example I like to override this file: vendor/magento/module-...
0
votes
0answers
251 views

KnockoutJs tab In magento 2

I am using Magento 2.1.0, and i am trying to create tab on frontend by using knockout js. i checked so many tutorial, in which one i refer http://jsfiddle.net/NLGm8/32/ I created Phtml file <...
2
votes
1answer
430 views

M2 - How to get store information in knockout

How can I get store information in KnockOut? For example: When a customer selects "Pickup @ Store" as shipping method, I need to update the shipping address to the address of the store. The customer ...