Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

Filter by
Sorted by
Tagged with
0
votes
1answer
12 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
0answers
13 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
0answers
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
0answers
18 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
0answers
12 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
0answers
22 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
0answers
12 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
1answer
15 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
1answer
13 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
0answers
7 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
0answers
21 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
0answers
19 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
0answers
14 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
0answers
29 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
3answers
127 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
0answers
51 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
3answers
55 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
1answer
33 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
0answers
18 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
1answer
27 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
0answers
38 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
0answers
19 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
1answer
27 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
0answers
99 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
0answers
11 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-...
1
vote
5answers
752 views

Magento 2.4.3 - Checkout JS knockout error - renderReCaptcha

We upgrade to Magento 2.4.3 and now face the following JS knockout error in the checkout: TypeError: Unable to process binding "afterRender: function (){return renderReCaptcha() }" Message: ...
0
votes
0answers
53 views

How to open a new popup box besides Edit Link in each and every shipping address section of Magento 2 Onepage Checkout page

I have debugged and tried a lot to add a new popup box like Edit link in each and every shipping address in Magento 2 Checkout page. Normally, it has been added a button in Vendor/Custom Theme/...
0
votes
0answers
13 views

Highlight the products added in the cart

I am trying to make functionality on the category page in which the product which is in the cart shows a right mark beside the product name. I am able to achieve it for the norma add to cart but I am ...
0
votes
1answer
46 views

Region select not showing in checkout after upgrade to Magento 2.4

Are in the process of upgrading from M2.3.5 to the current version of Magento - 2.4.3 However, after having done so the Region select dropdown no longer appears in the checkout (on either billing or ...
0
votes
0answers
22 views

How to add attribute disable proceed to checkout button magento 2?

I'm trying to create a mandatory purchase condition. If the customer purchases less than 10 products, the checkout button cannot be used. I have attached the disabled attribute if the product is not ...
0
votes
1answer
24 views

Add dynamic rows to list using KnockoutJS

I have added a custom step in checkout where we list all the uploaded prescription by the customers and they can upload new file also. So once the customer upload the file, on "Next step" we ...
0
votes
0answers
12 views

adding a custom attribute to minicart using ko:

I know that I can do something like text: product_sku to display the products sku in the minicart. but what about any other custom product attributes? Please assist and tyvm
0
votes
1answer
65 views

How to refresh or observe the Item is been added to cart using knockout JS UI component?

I have added a custom function which checks if the product has already been added in a quote or not. This works fine and shows button text accordingly. The only issue that it requires to refresh the ...
0
votes
0answers
14 views

Checkout Page: Custom Boolean Checkbox won't save value on Quote and Order

Hi I'm trying to capture/detect if the Shipping Address is changed or Selected. If New Address is added it should return true as well as it should check the custom checkbox I created. Same with old ...
0
votes
0answers
23 views

How to hide/show html with ajax in frontend?

How to hind / show HTML content (CSS class) via ajax? I have to show / hide products price via the button. I know that it can be done via display: none property, but what are the steps and how to save ...
0
votes
1answer
203 views

Magento 2.3.5 : Editing Billing Address and Shipping Address form.html

I am using magento 2.3.5 and require to change the shipping address and billing address field input during checkout, what I required to do is change addresses input field label as per desired change ...
0
votes
0answers
25 views

How to bind shipping address fields with shipping method?

I want to show/hide some fields based on the selected shipping method. For example: Show "Shipping Method 1 Field" on the selection of "Shipping Method 1", hide it otherwise. How ...
0
votes
3answers
121 views

Magento 2 ui component form checkbox pre-checked. Checked as default

Hi I'm stucked on a simple checkbox. I'm wondering if there is a way to make a custom checkbox checked as default. Basically, I created a custom field on the Checkout Page. <item name="...
0
votes
0answers
15 views

Magento 2: render specific checkout step outside of foreach

I have morphed the authentication form to be another step in the checkout. This works well so far but since it is part of the regular rendering of the checkout steps it limits my needs. <!-- ko ...
0
votes
1answer
16 views

Font family select is not applying at the same time, its getting updated when I select next font family

this is my select option in html <div class="control"> <select id="selected_font_id" data-bind="value: getObservable('selected_font'), ...
1
vote
0answers
26 views

Magento 2 - New Tax rule page showing "require is not defined" error in console

When I try to add new tax rule I am getting "require is not defined" error in console which cause properly loading issue for Tax Rate, Customer Tax Class and Product Tax Class field (see ...
1
vote
2answers
20 views

To show div block after pressing preview button - magento 2 Form using KO JS

I'm trying to hide a div block, it should show after I press preview button, can anyone help? Code: gift-message-form.html <div class="actions-toolbar"> <div class="...
0
votes
0answers
46 views

How to change email validation textInput event to focus-out event in checkout

In the checkout page, there is "Billing Email Address" input field which is validated when keyup event is triggered. This element has this data-bind attribute: data-bind="textInput: ...
1
vote
1answer
24 views

Magento 2: knockout function automatically call without click

I have call one function on button click but right now its call on page load automatically. It should be call only when click on button. Knockout js define([ 'ko', 'uiComponent' ], function (ko,...
1
vote
2answers
37 views

Magento 2 - Dynamic custom validation error message not working

i'm using Magento 2.4.1 and i add custom validation with a custom error message to detect which character is wrong and add it to the message: define([ 'jquery' ], function ($) { return ...
0
votes
1answer
23 views

Call CMS Block in Non-Checkout KO Template

I am using the WeltPixel theme and want to add add a CMS block to the ajaxlogin-popup.html file below the "Forgot Password" link. I am getting this error in console: Uncaught TypeError: ...
0
votes
0answers
78 views

Download a csv file by js in magento 2

I would like to know how can I download a CSV file after clicking on the export button through ajax call. Here is my code: Controller Code public function execute() { try { $...
0
votes
0answers
21 views

Admin Grid Filters Expanded on the base of Configuration

I am trying to create the configuration to expanded Magento 2 all grids filters, I overrider these 2 files its work, var config = { map: { '*': { 'Magento_Ui/js/grid/filters/...
0
votes
0answers
26 views

The code looks wrong but works correctly. Is it possible to optimize it and make it more logical?

I have a knockout component that shows or hides my items by tag. I do not work well with js and knockout is new to me, I would like to improve my filtering logic so that it works correctly and locally....
0
votes
0answers
22 views

How to filter array and change data on front end KO

I using knockout to create a list with my custom collection data. <div data-bind="scope: 'myData'"> <!-- ko template: getTemplate() --><!-- /ko --> <script type=&...

1
2 3 4 5
16