Questions tagged [knockoutjs]
Denotes questions related to Knockout use in Magento2
802
questions
0
votes
0
answers
10
views
how to get store name display in a shipping method
I'm new here, please help. when you click shipping method a display of store view name show below using knock out js to display.
0
votes
0
answers
15
views
Knockout DateTime Picker - how to set custom Default Date
I have added a date-time picker in my custom form using the below code in HTML file.
<label class="label">Delivery
<div class="control">
<input ...
1
vote
1
answer
20
views
Insert child UI component inside existing one
I have 2 modules where each one has an UI component on frontend. Module A contains the main component and component of Module B should be displayed inside the component of module A. I'm not ...
1
vote
0
answers
12
views
Magento 2: this.performPayment() not working from callback function payment js
I am creating a payment module, but I am getting issue in my payment js,My js code is below:
app/code/Namespace/Magento/view/frontend/web/js/view/payment/method-renderer/abc.js
define(
[
...
0
votes
0
answers
13
views
html template is not rendering in modal of admin side in Magento 2
I am trying to load the HTML template in the modal of the admin side in Magento 2 but unfortunately, the HTML template is not rendering in the modal but it's working outside the modal. I am loading ...
0
votes
0
answers
29
views
Checkout After uncheck billing same as shipping checkbox Billing address form is not displaying
In Checkout after unchecking My billing address same as the shipping checkbox, then not able to add a new address or not show any billing address form.
Please help.
0
votes
0
answers
27
views
Magento 2 remove loader/spinner from the checkout input fields
in Magento 2 checkout page whenever we update or change any input field it triggers an ajax call with the loading spinner. I want to remove that loader spinner on the selected input field.
But not ...
0
votes
2
answers
30
views
How to extends checkout-loader.js
I am using magento 2.3.5-p2
I want to add an event without modifying the core codes of checkout-loader.js which are located here
vendor/magento/module-checkout/view/frontend/web/js/checkout-loader.js
...
0
votes
1
answer
23
views
Get product data from wishlist_id in wishlist.js
I am using Magento2.3.5-p2
In vendor/magento/module-wishlist/view/frontend/web/js/wishlist.js
I want to be able to get the product data from the wishlist_id
the code is like this
_beforeAddToCart: ...
0
votes
1
answer
34
views
How to remove out of stock items from the minicart in magento 2?
scenario- when the user doing his shopping he added some products to the basket, that are shown in the minicart by default. But when the click on mini cart (or) when the user refresh the page i need ...
0
votes
1
answer
72
views
Understanding data bind at minicart in magento 2
I am using magento 2
in mini cart, I am trying to get the event during which product is being added and removed, a specific item not by cart
shown is the item that exists in mini cart, I want that ...
0
votes
0
answers
13
views
knockoutjs set value in another function
I'm trying to set the value inside another function but it's not working
HTML Code as below:
<!-- ko if: isDisplayedCustomdiscount() -->
<tr class="totals customdiscount excl">
...
0
votes
1
answer
17
views
Custom Knockout template not picked in checkout - Magento 2
I wanted to show a message on checkout page (above the 'complete checkout' button) only if customer is on certain store views (id_id or id_en). Here what I have done so far. Please help me to find ...
0
votes
1
answer
33
views
jQuery listen to ko data bound input
I have a component with for a "quantity changer", comprising of an input field and plus/minus buttons. The input and buttons are connected via data-binding on a KO observable. This works as ...
0
votes
1
answer
23
views
How to disable a knockout generated dropdown option by default
I am trying to disable a certain option of select generated from knockout on the checkout page. I tried what was mentioned on the knockout documentation i.e. to call optionsAfterRender. But this gives ...
1
vote
1
answer
351
views
How can I access the selected value when bind a change event using knockout JS in Magento 2
Knockout Template
<select data-bind="event:{ change: permissionChanged}">
<option data-bind="i18n: 'Yes', value: 'yes'"></option>
<option data-bind=&...
0
votes
0
answers
8
views
I have to catch the KO variable's value spontaneously on the checkout page for postcode in order to call ajax request as soon as 6 digits are complete
I want to fire an ajax request as soon as the postcode variable completes 6th digit of postcode number in order to call ajax request to api to populate the city and state fields. I am getting the ...
0
votes
0
answers
14
views
Magento 2 displayArea component not working
Hope someone can help me
I have a custom checkout_index_index.xml layout so I can show my own components on checkout, I'm trying to get 2 different components like this:
<page xmlns:xsi="http:/...
0
votes
0
answers
21
views
Magento 2 how to access external JS variables and functions in my html template?
I need to access to an external javascript variables and functions so the template does not throws error.
I have my template.html template doing this:
<!-- ko template: "Vendor_ManualShipping/...
0
votes
0
answers
35
views
How i can change email validation magento 2
When customer go to create account (phat : /customer/account/create/) the email validation fail in this case daniel@example.cm, how i can change this validation to improve this ?.
0
votes
1
answer
62
views
Magento 2 - Use knockoutjs and html instead of phtml
How can I use html and knockoutjs on a custom site which is accessible from a custom controller?
For example my controller route is threepartment/vault/index
If I go to:
www.example.com/threepartment/...
0
votes
2
answers
50
views
how to override elementTmpl for billing address fields properly in checkout_index_index.xml?
I would like to change the way the company field is rendered in the billing address and I'm trying to apply a new elementTmpl that I've defined and works well for shipping address fields.
Here's the ...
0
votes
0
answers
26
views
Error on Payment Method
When I try to load first time the checkout page the following error is shown on the console
My Tabby payment method is not being loaded at the payment method section
when I again reload the checkout ...
0
votes
1
answer
74
views
Magento 2: Custom Checkout Field Validation
I have a module already built for ExtraFee, I just want to add the checkbox below for terms & conditions so I found a template and added a checkbox like this:
<div class="field amexfee-...
0
votes
0
answers
11
views
How do I add javascript code to handle callback events after submission of coupon register?
I am using Magento 2.3.5-p2
I am required to trigger a javascript code as below once a user has successfully registered their coupon
dataLayer.push({
'event': 'trackEvent',
'eventDetails.category': '...
0
votes
1
answer
15
views
Extend Core Js File in magento2
I want to extend vendor/magento/Magento_Customer/view/frontend/web/js/address/js to my custom module.Please help
0
votes
0
answers
16
views
How to modify the shipping-address form only at specific locations?
I modified the shipping-address form following this guide to show a legal text on top of the form: Add new field in address form
I used a text field with a default value that gets translated for ...
0
votes
0
answers
6
views
Render content on the fly based on current quantity - Product View Page
So I have a product view page, I want to get the current quantity (e.g. onChange()) of the product and then pass it to the PHP class to perform some calculations. After calculation, I want to render ...
0
votes
0
answers
78
views
How to get cart subtotal and subtotal in checkout shipping page?
I want to show cart subtotal and subtotal on Magento 2 shipping page How to do that?
I have extended the file in my child theme but how to get these price details can anyone help me.
app/design/...
0
votes
0
answers
30
views
Magento 2 Get Event When User View List Product, Sorting, Filter, Clear Options, Pagination, Add Wish List
I am using Magento 2.3.5-p2
As stated in the title, I want to capture an event by the user when the user does any of the processes below
User View List Product
User Sort Product
User Filter Product
...
0
votes
0
answers
153
views
The requested URL was rejected while trying to save the address book using special characters
Steps to Reproduce:
Go to the storefront
Log in as a customer
Go to My Account
Now go to Address Book and click on add new address button
Fill the address form ( add special characters in mandatory ...
0
votes
0
answers
25
views
How to know the method available for Magento_Customer/js/customer-data
I am doing a Google Tag Integration on Magento 2.3.5-p2 which require me to capture an event that happens during add to cart and remove it from the cart
to capture this event I put in code as below at ...
2
votes
1
answer
222
views
Magento 2 - Can not get the customer data from customer-data.js file in Magento 2.3.6 p1
I'm using Magento 2.3.6 p1. And I want to observe the customers when they logged in. I used this in my Js file but it returned undefined when I console.log the first name value. It happened both when ...
0
votes
1
answer
33
views
Translation missing
This is my resulting html
<div data-ui-id="checkout-cart-validationmessages-message-error">
The requested qty is not available
</div>
Probably generated by :
<div data-...
0
votes
0
answers
13
views
Show Original Price and Sale Price in checkout sidebar
At the moment if a product is discounted it only shows the sale price against the product and not the original price in the checkout sidebar. Is there a way of doing this as I checked mage-cache-...
0
votes
0
answers
41
views
Checkout js file called in custom ui component : M2
I want to called this "Magento_Checkout/js/model/resource-url-manager" file in my custom component .
phtml file is:
<?php
$mycollection = $block->getMyCollection();
?>
<?php if ...
0
votes
0
answers
64
views
How to save a frontend user uploaded image in desired folder using knockout js
I want to put a file upload button in my gift message extended module(file path is: Vendor/Magento_GiftMessage/web/template/gift-message.html. I could add the button and display the image as well, now ...
0
votes
0
answers
19
views
Adding Style Into LayoutProcessor
I am using Magento2.3.5-p2
I have added a LayoutProcessor code as below
// 1- shipping address
$jsLayoutResult['components']['checkout']['children']['steps']['children']['shipping-step']
['children']['...
0
votes
0
answers
103
views
Changes on LayoutProcessor to make TEXTAREA field input in full width
I am using Magento 2.3.5-p2
on the checkout page to modify its input I have added the content such as below on this file
app/code/SR/ModifiedCheckout/Plugin/Block/LayoutProcessor.php
// 1- shipping ...
0
votes
3
answers
410
views
Failed to load the component. : M2
phtml file:
<?php
$mycollection = $block->getMyCollection();
?>
<?php if ($mycollection) : ?>
<div id="my-component" data-bind="scope:'myComponent'">
...
0
votes
0
answers
66
views
How to bind a custom configuration value in a html template
I'm working on a module that adds a note to explain the shipping method that the customer selects in checkout. For example, when a customer selects 'Warehouse Pickup', a note will display explaining ...
0
votes
3
answers
160
views
How to add if condition in html ko file
Validation field with admin Yes/No config value, so that am adding helper file to get config enable value to validate the field. So i want to call this value with if condition in html ko file.
&...
0
votes
1
answer
94
views
How to change Newsletter subscription message on order success page
When a new order is create and the customer has checked the Subscribe to Newsletter box, below is how the checkout/onepage/success page appears.
I will like to change the text Thank you for your ...
0
votes
0
answers
48
views
Remove name from billing address new address form magento 2
How can I remove the name field from the new billing address field from Magento 2 checkout payment page?
I tried the below code which is not working.
I used a plugin for this class Magento\...
0
votes
1
answer
114
views
Onclick bind image using knockout js
I want to show image from allDoorColorStandard.
HTML:
Onclick "color-data" div , i want to update image.
In alert i'm getting image URL, now need to bind in image tag.
<div data-bind=&...
0
votes
0
answers
80
views
knockout js nested for each loop issue : M2.4
I'm trying to get color_name from colors.standard.
I have try as given below html but both are showing same array.
HTML - Not Working
<div data-bind="foreach: { data: doorColorList, as: '...
0
votes
0
answers
22
views
Magento 2 : Knockoutjs data-bind issue in Inner Loop
HTML:
<span class="color-name" data-bind="text: $parent.selectedDoorColorName"></span>
<div class="standard-color" data-bind="foreach: $parent....
0
votes
1
answer
94
views
Magento 2 : Knockoutjs data-bind not Working in Inner Loop
Case 1: -- Working
HTML
Test::<span data-bind="text: $parent.testText"></span>
<button data-bind="click: $parent.testbtn"></button>
JS
numberOfClicks : ko....
0
votes
2
answers
850
views
Uncaught TypeError: Unable to process binding "afterRender: function(){return renderReCaptcha() }" on checkout page
On the checkout page I am getting the error message Uncaught TypeError: Unable to process binding "afterRender: function(){return renderReCaptcha() }". I searched for the renderReCaptcha() ...
0
votes
0
answers
19
views
how to change menu display on click in magento 2
I don't like Magento way of showing the dropdown menu on the phone screen. Is there a way to change how the menu click is displayed like https://www.jqueryscript.net/demo/Multi-level-Side-Menu-Plugin-...