Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

Filter by
Sorted by
Tagged with
0
votes
0answers
10 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
20 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
79 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
31 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
23 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
14 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
16 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
30 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
215 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 ...
0
votes
0answers
12 views

Magento2 - How to Disable Meta information input data binding When creating a new Product?

When we create a new product in Magento2 from back end, the meta title & keyword will bind the value of the product name, and the meta description will bind the value of the product description &...
0
votes
0answers
31 views

Magento 2 how to use Mixins

I have a module which overriding the following core js file vendor/magento/module-checkout/view/frontend/web/js/view/billing-address.js Im overriding with my custom module, here is the require-...
1
vote
1answer
51 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
65 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
150 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
0answers
14 views

Magento 2: How to explore a javascript object in j.js file?

The whole object comes from this.cart variable, i want to get item id from this object how can we access it?
0
votes
0answers
14 views

Show Message to customer that they will leave magento website for payment in checkout page

we implemented a new payment method in magento2 where when user clicks on place order button, he will redirect to external payment page to complete the payment.We need to show a message to customers ...
0
votes
1answer
81 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
584 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($) { ...
0
votes
1answer
42 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"&...
0
votes
1answer
34 views

input element not getting disabled when I change it's property “disabled”

I have created a custom module to add some fields to the order checkout however I have some troubles enabling them conditionally. I have a radio button and 4 elements When the radio is clicked, ...
0
votes
1answer
36 views

Magento 2 overwrite html file in custom module

I would like to overwrite the following file row_incl_tax.html in my custom module: vendor/magento/module-weee/view/frontend/web/template/checkout/summary/item/price/row_incl_tax.html app/code/...
0
votes
1answer
87 views

Magento 2: How to show the number of cart items in a custom phtml using KnockoutJS?

I'm trying to get total number of cart items in my custom_header.phmtl. But I'm unbale to get the result. I've tried using KnockoutJS. I added minicart UI component to my block, which allowed me to ...
0
votes
0answers
39 views

Magento 2:Add another new Custom mini-cart?

I want to add new Minicart like shown in the following screenshot, using KnockOut Js, Give me some logic how can I cater to this problem
4
votes
0answers
108 views

Using Custom JS for magento 2 KO datepicker in checkout page error required field

I tried to add a custom datepicker with custom js in my Magento 2 checkout for delivery date, the custom js datepicker is showing and when i click the date it fills the value, but when i click next to ...
0
votes
1answer
52 views

Magento2 - Translate title property in knockout js html template

I have href html tag that looks like this in my knockout html template <a data-fancybox data-src="#price_policy" href="javascript:void(0);" title="Shipping Cost" data-bind="i18n: 'Shipping will ...
0
votes
1answer
89 views

How to get already selected Shipping method and shipping Carrier using ajax in Checkout page Magento 2?

Basically I am trying to get the pre-selected shipping method and shipping carrier on the page load. Also it should capture the shipping method and shipping carrier as soon as the customer selects ...
0
votes
1answer
109 views

Magento2: How to get current product category id?

I want to get the current product category ids by Knockout JS. Please help.
0
votes
0answers
60 views

Magento 2 Knockout Shipping Method initial checked

I successfully managed to add a "is-selected" class on the checkout shipping method row element on click using a mixin like this : var mixin = { /** * @param {Object} shippingMethod * @...
0
votes
1answer
31 views

Get custom attribute in one step checkout

I'm trying to get a custom attribute (mgs_brand) in MagePlaza's One Step Checkout. I've created a catalog_attributes.xml file like so - <?xml version="1.0"?> <config xmlns:xsi="http://www....
0
votes
0answers
30 views

Magento 2 custom modal Close button redirect to footer

I have a custom modal in Magento 2 , using knokoutjs. This modal has a Continue Shopping button : 'buttons': [ { text: 'Continue Shopping', click: function () { ...
2
votes
1answer
107 views

Magento 2 UI Component conflicts between observable value

I try to add UI Component to product item on product list due to difficult FE login for each item. But I was wondering when conflicts between components appeared. All components for each item has a ...
1
vote
1answer
32 views

Knockout js - unknown syntax error

This is a part from Magento_Checkout/web/template/minicart/item/default.phtml file: <dl class="product options list"> <!-- ko foreach: { data: options, as: 'option' } --> <dt ...
1
vote
0answers
29 views

Magento 2 Check if Shipping Method title is abc add some Text

I am working On Shipping Methods where I want to display text as per the shipping method Title. I got the file methods.html file and there are display shipping methods by Knockout js. Now I want to ...
0
votes
1answer
166 views

Magento2 Knockout js - translate variable text

I'm trying to translate text that comes from a variable in Knockout html file, but I can;t find the right way. Here's some things I tried: <dt class="label" data-bind="html: i18n(option.label)">...
0
votes
0answers
267 views

Magento 2 : ko observable variable checking in template file

I have created a custom payment method using knockout js. I want to display a form only for selecting a drop-down value "Add new card". I have created a KO variable and assign the value initially as ...
2
votes
1answer
61 views

Multiple form in admin form Magento 2

I'm using magento 2.3.4, I have a database structure like this: //event |event_id | name | +---------+-------+ | 1 | Art | | 2 | Expo3 | // score | event_id | judge | score |...
0
votes
1answer
89 views

Magento2: How to pass data from model file to knockout.js?

I want to pass the data from model file to knockout.js in Magento2. My Code: Model file: <?php namespace Amy\MyPackage\Model\Total\Quote; /** * Class Custom * @package Mageplaza\HelloWorld\Model\...
0
votes
1answer
128 views

Magento 2: Checkout order summary show custom product attribute failed to load component issue

I'm trying to show custom product attribute in checkout order summary section. I have achieved this by override vendor/magento/module-checkout/view/frontend/web/js/view/summary/item/details.js and ...
0
votes
0answers
84 views

Magento 2.3.3 - How to remove city field from shipping address and billing address from checkout

I want to remove city field from both shipping address and billing address on checkout page. I did manage to remove them using them checkout_index_index.xml but getting error "City is required field". ...
0
votes
0answers
20 views

Custom address attribute binding on checkout page

In my Magento installation I have customer address attribute address_type_indicator for Fedex Residential/Commercial delivery. We need create a select on checkout page for customers, who has no such ...
0
votes
1answer
60 views

Order Summary Knockout.js how is work?

Hi I am focusing the Order Summary on my shopping cart, I found below file /magento/module-checkout/view/frontend/web/template/summary/item/details.html Inside above, there has a line of code, how ...
0
votes
0answers
15 views

Magento 2.3.x - How to set max lenght attribute and add placeholder in region input on checkout

I need to set the maximum length of two characters and add a placeholder to the region field of the checkout
0
votes
1answer
54 views

How Shopping Cart, Order Summary get quantity value?

I found this page vendor/magento/module-checkout/view/frontend/web/ template/summary/item/details.html <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license ...
0
votes
0answers
29 views

Magento 2.3 - Edit Shipping Address Block Checkout

I added a custom radio button to the checkout form, with the ID switch_field, and it shows up in the 'Ship To' block summary; how do I prevent/remove this? I've checked these files; /vendor/magento/...
0
votes
1answer
114 views

Add Iframe in knockout js template

I am working on custom payment method with SnapPay integration. I want to add iframe in vendor/magento/module-payment/view/frontend/web/template/payment/cc-form.html <iframe id="tokenFrame" width="...
1
vote
0answers
28 views

How to edit current Billing and Shipping address in checkout page

How can I edit current Billing and shipping address and update the same address in customer address table? Currently We are only adding a new address, but I need to edit current address and same ...
1
vote
0answers
18 views

Magento 2 : Cart keeps returning original quantity

I am trying to update the value of the qty in the shopping cart page with a Knockout on click, but it seems to revert the value to it's original state. This is the script for the button : <td ...
0
votes
0answers
7 views

Display button in mini cart , if items are there in cart and redirect to another page with hidden params

I need to add a button in minicart which displays, if there are items in cart.When we click that button i need to redirect to a controller with hidden params in the request.Can anyone give me a ...

1
2
3 4 5
14