Skip to content

How to overwrite a javascript component method? #1864

Closed
@kassner

Description

@kassner

Hi,

I'm looking for a way to overwrite a javascript method in Magento_Checkout/js/payment/default, I'm able to extend it with my own My_Module/js/payment/default and use it without problem, but I need to change every define that is calling it directly by Magento_Checkout.

Is there a way to make requirejs understand that I want to change the file it should lookup? Back in Magento 1 the concept was different, but it was possible to overwrite a JS class method using prototypes, this new structure does not allow it or I'm missing something?

Devdocs say about extending a component (which works when changing the define function) or overwriting a widget, but that one does not work with components.

Thanks!

Metadata

Metadata

Assignees

Labels

Issue: Format is not validGate 1 Failed. Automatic verification of issue format is failed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions