Questions tagged [mixins]

Specify questions related to Mixins – is a generic object-oriented programming term: a class that contains methods for other classes.

Filter by
Sorted by
Tagged with
1
vote
2answers
36 views

Magento 2 - How to override Method getShippingMethodTitle in Magento_Checkout/view/frontend/web/js/view/summary/shipping.js

I need to override the method getShippingMethodTitle which is defined in vendor/magento/module-checkout/view/frontend/web/js/view/summary/shipping.js. The Method gets the shipping method title in the ...
0
votes
1answer
33 views

Magento 2 - how to add methods to a javascript file by using mixins?

I am using the extension amasty/single-step-checkout. They are using this mixin... vendor\amasty\module-single-step-checkout\view\frontend\web\js\view\shipping-mixin.js (A) ...to extend this magento ...
0
votes
0answers
18 views

How to write magento javascript mixin for widget returned as an object?

I need to write magento javascript mixin for the menu.js part which is returned as the object of two multiple widgets. Actual location of the file is lib\web\mage\menu.js which further extends the ...
0
votes
0answers
26 views

Multiple wishlist mixin for mage.promptEditWithList is broken

I have created a mixin to extend the mage.promptEditWithList widget in /vendor/magento/module-multiple-wishlist/view/frontend/web/js/multiple-wishlist.js, but it breaks the edit wishlist functionality ...
2
votes
1answer
136 views

css and js not found in magento 2.3.5

Refused to apply style from http://localhost/magento2-2.3.5-p1/pub/static/version1593595791/adminhtml/Magento/backend/en_US/extjs/resources/css/ext-all.css because its MIME type ('text/html') is not ...
1
vote
0answers
23 views

Magento2.3.5 Custom checkout field custom validation Amazon Error

I have a custom field and customScope added with LayoutProcessor which works fine! But I need to add custom validation stop submission if my custom doesn't meet the requirements : Is just trowing ...
1
vote
1answer
185 views

Magento 2 - advanced JS bundling mixins

I followed this answer to enable JS bundling with success - Magento 2 Advanced Js Bundling. However when I go to checkout, I get JS errors in console. When in developer mode everything is ok. Even in ...
0
votes
2answers
171 views

Magento 2 combine two functionality s using a single mixin js file?

I would like to override Magento_Swatches/js/swatch-renderer.js file using mixins concept. I would like to club two functionalities in a single file. here is the code I have written please Note 2nd ...
0
votes
0answers
80 views

Magento2 mixin with custom component to extend checkout summary totals

I am not sure what I am missing here, I am trying to hide prices on my checkout totals using mixin with a custom component. view/frontend/layout/default.xml <?xml version="1.0"?> <page ...
0
votes
0answers
111 views

How to add custom validation to street field in registration form of customer/create/account page register.phtml in magento 2?

I have been trying to add custom validation to customer account create on street field. At bottom as you can see I am passing validate-street-part1 in street input as I have created that method in ...
1
vote
1answer
51 views

How to Override jquery widget method in Magento 2?

I'm trying to override Magento_Checkout/js/sidebar.js _initContent method. I need to delete two events from it and create my own events instead. Is it possible without copying the full method from the ...
0
votes
1answer
62 views

Magento 2 static files not creating mage folder and mixins.js

After upgrading from Magento 2.2.2 to Magento 2.3.3. While generating static content with command "php bin/magento setup:static-content:deploy -f" it updates all the files in pub/static folder ...
0
votes
1answer
72 views

Magento 2 : Creating JS Mixins for anonymous functions?

I would like turn all my js overwrites into mixins. I'm trying to create a mixin for the following file: view/frontend/web/js/action/place-order.js But the function in there doesn't have a name ' ...
0
votes
2answers
256 views

How to hide proceed to checkout button in mini-cart in magento 2

I managed to hide the chekout button using a custom module. I followed this threads to achieve this. I can hide the checkout button in mini cart now.But i want to add some condition to show the ...
1
vote
2answers
520 views

Magento 2 pass php session variable to minicart & hide proceed to checkout

I would like to pass a PHP session variable flag to mini cart-mixin.js dynamically. I followed the below steps mentioned here using the Config Provider concept I am able to pass variable to only cart ...
0
votes
0answers
37 views

Magento 2 mixin error

I didn't use mixin in my custom theme or anything. But I get the below error. TypeError: mixin is not a function My require-config.js is below. var config = { paths: { 'owl.carousel': '...
1
vote
1answer
222 views

Magento2 Mixins: How to write a requirejs-config.js?

What exactly do I need to add to the requirejs-config.js for adding a mixin? The Magento documentation has an example of this, but I seem to lack some basic understanding of javascript and frontend ...
0
votes
0answers
110 views

How we can use Js Mixins for order scripts.js

I want to override switchPaymentMethod from module-sales/view/adminhtml/web/order/create/scripts.js for that I use mixins: app/code/Vendor/Module/view/adminhtml/requirejs-config.js var config = { ...
0
votes
1answer
398 views

how to use mixin when the theme overrides the js component

I'm experiencing the following issue. I have a theme which overrides the swatch renderer in app/design/frontend/Vendor/Name/Magento_Swatches/web/js/swatch-renderer.js I also have a module which ...
0
votes
1answer
338 views

How to override or extend proceed-to-checkout.js

I need to override or extend Magento's proceed-to-checkout.js file in my module. app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js In my modules requirejs-config.js I have tried ...
0
votes
0answers
337 views

Mixin for Magento_ConfigurableProduct/js/configurable::_reloadPrice not working

I'm trying to follow the example here Magento 2 - Why do SKU not change dynamically in configurable product view page to create a mixin for configurable products that will show dynamically a ...
2
votes
2answers
559 views

Magento 2.3.1 Uncaught TypeError: mixin is not a function

I am configuring a migrated magento site on 2.3.1 and I ran into this error "Uncaught TypeError: mixin is not a function" once before and literally solved it only by reinstalling from ...
1
vote
2answers
2k views

mixin is not a function

Hi I have created a mixin but it gives the error "mixin is not a function". Vendor/CustomCustomer/view/base/web/customercustom.js define([ 'jquery', 'underscore', 'uiRegistry', '...
2
votes
2answers
917 views

How to extend admin js in magento 2 by mixins

I want to overide Magento_Sales/adminhtml/web/order/create/scripts.js I wrote require-config.js for this var config = { config: { mixins: { 'Magento_Sales/adminhtml/web/...
1
vote
1answer
117 views

Magento 2.3 : Mixin function is not rendering

I have a mixin which is extending functionality for validation purpose. See the code below define([ 'jquery', 'Magento_Ui/js/lib/validation/validator' ], function ($, validatorlib) { "use strict"; ...
2
votes
1answer
359 views

.lib-url-check is undefined Magento 2.3 static content deploy error

Magento 2.3 when deploying static content this error occurs: Compilation from source: /var/www/html/MyProject/vendor/magento/theme-frontend-blank/web/css/styles-m.less .lib-url-check is ...
0
votes
1answer
246 views

Requirejs-config.js not working for parent theme's responsive.js file

I would like to change the values for the media property for the files menu.js & responsive.js from media: '(min-width: 768px)' to media: '(min-width: 992px)'. I thought using Magento's JS Mixin ...
0
votes
1answer
110 views

Show “View as” in toolbar before grid and list modes

I want to show "View as" in toolbar just before grid and list modes. I found its already exist in template file but is hidden: vendor/magento/module-catalog/view/frontend/templates/product/list/...
3
votes
1answer
166 views

When to use mixin js in magento2?

I want to change text Payment Method to Payment Information on checkout page. It's need to use mixin js here? Or i can override js here directly?
3
votes
1answer
2k views

Magento 2.2.6 - Mixin does not work

I try to add more KO functions to the Magento_Checkout/template/summary.html I have an own extension "XXX_Checkout" For this i do the follow parts: Create Mixin /app/code/XXX/Checkout/view/...
0
votes
1answer
166 views

Magento_Payment/translate not included in requirejs config for mixins

In a custom module, I am trying to implement a mixin for the Magento_Payment/transparent jQuery widget. My module is installed correctly (other parts are working fine), but the mixin isn't loading. ...
1
vote
0answers
64 views

Extend a default JS component or Use Mixin

Which is better and recommended to use Extend a default js component as explained at https://devdocs.magento.com/guides/v2.1/javascript-dev-guide/javascript/custom_js.html#extend_js or to use Mixins ...
0
votes
0answers
61 views

Magento 2 EE : Override configure function(addbysku.js) of Magento_AdvancedCheckout module using mixins

In addbysku.js file, I want to override the configure function of Magento_AdvancedCheckout module using mixins in Magento Enterprise Edition. And my js code is, define([ /* eslint-disable strict */ ...
4
votes
1answer
5k views

What is mixin in Magento 2?

Does anyone know how Magento has implemented this functionality? What Magento custom mixins plugin is actually is ?
3
votes
0answers
109 views

Overriding\Extending Magento_Sales js files

i need to add my custom function call at the end of function loadArea() which located at Magento_Sales/order/create/scripts.js. I already do this with overriding by requirejs-config.js var config = {...
0
votes
1answer
622 views

Access Variables passed to a function modified/wrapped with a mixin

I want to tidy up this answer i gave here: How to disable a swatch, once it is been selected in Magento2.2? Instead of completely overriding the function i would like to improve it by wrapping the ...
1
vote
2answers
89 views

Please let me know the Areas where we can apply the concept “Mixin” in Magento 2

Recently I came across a strange word "Mixin". Got to know that it is something related to "has-a-relationship" in OOPS. A class can be utilized without inheriting it but by having its object in ...
1
vote
1answer
2k views

How to load shipping methods on country and postcode change?

I have written a custom shipping module, then I want to change custom shipping methods when country and post code changes. I heard there is a method call js mixin. any one have idea about it, need ...
1
vote
0answers
277 views

How to using mixins for “mage/dataPost”?

I try to mixin a widget js file following guide at here. I create a file requirejs-config.js in view/frontend directory. There's view/frontend/requirejs-config.js: var config = { config: { ...
0
votes
0answers
743 views

Magento 2 : How to change UI field(s) dynamically

On checkout page on country selection i want to change postal zip code from text box to select list with options dynamically ( like region_id ). For example, if zip code are available for certain ...
0
votes
1answer
301 views

Magento 2: Background gradient and image

Magento 2.2.1 custom theme which inherits from Magento/blank. I am trying to assign a background which has a radial gradient as the bottom layer and an image as the top layer. Assigning a solid ...
5
votes
2answers
1k views

How to override price-utils.js specific method?

Currently I successfully override the Price display base on local currency on other pages. But I got a problem on Product Details page. The price is override by price-utils.js file: Magento/Catalog/...
6
votes
1answer
802 views

When to use mixins and when to use map?

I'm following magento 2 official documentation to create my checkout step. I'm very new to knockoutjs, requirejs, js components which are massively used in magento 2, specially in checkout. I'm ...
5
votes
1answer
254 views

Overriding Magento 2 core js function

I need to override the 'loadArea' and 'loadAreaResponseHandler' magento core js functions in the file module-sales/view/adminhtml/web/order/create/scripts.js. I tried to use mixin property. Following ...
2
votes
0answers
158 views

JS mixin on a js file with a single return in Magento 2

I'm having trouble with mixin in Magento 2. I would like to override the following file to edit a function. Magento_Checkout/web/js/model/new-customer-address.js: define([ 'underscore' ],...
1
vote
0answers
365 views

Magento 2 Additional step between shipping and payment in checkout

I created a custom step login in checkout which being my first step I used the below mixins: In requirejs-config.js: var config = { 'config': { 'mixins': { 'Magento_Checkout/js/view/...
1
vote
2answers
973 views

Can't get Magento2's .media-width() LESS mixin to work

I'm trying to use Magento2's .media-width() mixin. I followed the instructions from the devdocs and added the mixin in my theme like this: .logo img { width: 125px; height: 29px; .media-width(@...
7
votes
2answers
2k views

Magento 2 javascript plugin after method is executed in wrong time

Following this post answer I have used mixins of shipping.js file to change the result of validateShippingInformation method. My requirers-config.js file is: var config = { config: { ...
2
votes
0answers
316 views

Magento2: Mixin is undefined on deploying static content

I have created several mixins in my custom theme within the file "_mixins.less", these work locally and are loaded properly from my other less files. However, when I want to deploy static content I ...
4
votes
2answers
7k views

How to override Magento 2 js using Mixins?

I want to override the js file in module-checkout/view/frontend/web/js/model/cart/totals-processor/default.js using mixins. Here is my requirejs code: var config = { config: { ...