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
0
votes
0answers
18 views

Magento 2 fonts showing 404 for .woff/.woff2 when using the .ttf fonts

I am trying to add custom fonts to the theme and the .lib-font-face() mixin is throwing 404 errors for .woff and .woff2 when trying to use the .ttf fonts only. In _typography.less file, I have the ...
0
votes
0answers
19 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
32 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
0answers
31 views

Adding custom/extension attribute to shipping/billing address :: js set-shipping-infromation-mixin.js error

Magento 2.3.1 I referred to following link for adding a custom/extension attribute to shipping address https://devdocs.magento.com/guides/v2.3/howdoi/checkout/checkout_new_field.html However, when ...
0
votes
1answer
32 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
46 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
1answer
143 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 scratch and ...
1
vote
1answer
227 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', '...
0
votes
1answer
108 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
45 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"; ...
1
vote
1answer
150 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
0answers
136 views

Magento 2 - js mixin

I am trying to overwrite some methods from my original js file. My original file path is: app/code/vendor/theme/view/base/web/js/file.js. In my file-mixin.js file I want override few things from ...
0
votes
1answer
88 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
46 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
101 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?
1
vote
1answer
705 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
48 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
55 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
44 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 */ ...
2
votes
1answer
806 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
89 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
319 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
49 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
970 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
200 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
419 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
177 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 ...
4
votes
1answer
842 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/...
3
votes
0answers
397 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
149 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
141 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
274 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
573 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(@...
6
votes
2answers
1k 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
261 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
3k 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: { ...
16
votes
2answers
6k views

How to rewrite widget function with mixins Magento 2.1.1

We have swatch-renderer.js In this file there are some widgets. .... $.widget('mage.SwatchRenderer', { .... /** * @private */ _init: function () { if (this.options....
15
votes
2answers
6k views

How Are the Things Magento 2 calls “mixins” Implemented?

Magento 2's RequireJS based object systems contains a feature called "mixins". A Magento 2 mixin isn't what a software engineer would normally think of as a mixin/trait. Instead, a Magento 2 mixin ...