Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 17945

Override Shopware 6 JS Plugin

$
0
0

I would like to overwrite the CountryStateSelectPlugin JS Plugin with my own PLugin in Shopware 6. I have followed the documentation. Unfortunately it does not work. Nothing happens at all. What am I doing wrong? Do I have a syntax error?

Here is the new plugin JS:

import CountryStateSelectPlugin from 'src/plugin/forms/form-country-state-select.plugin';export default class IntediaFormCountryStateSelectPlugin extends CountryStateSelectPlugin {    init() {        super.init();        alert('IntediaFormCountryStateSelectPlugin');    }}

Here is the main.js

import MatomoOptOutPlugin  from "./plugin/matomo-opt-out/matomo-opt-out.plugin";import NewsletterPlugin  from "./plugin/newsletter/newsletter.plugin";import ProductListingHeaderLinkPlugin from "./plugin/product-listing-header-link/product-listing-header-link";import ProductListingSortingFilterPlugin from "./plugin/product-listing-sorting-filter/product-listing-sorting-filter";import IntediaFormCountryStateSelectPlugin from "./plugin/forms/intedia-form-country-state-select.plugin";const PluginManager = window.PluginManager;PluginManager.register('MatomoOptOut', MatomoOptOutPlugin, 'div#matomo-opt-out');PluginManager.register('NewsletterPlugin', NewsletterPlugin, '[data-intedia-newsletter-widget]');PluginManager.register('ProductListingHeaderLinkPlugin', ProductListingHeaderLinkPlugin, '.product-listing-header--content-inner');PluginManager.register('ProductListingSortingFilterPlugin', ProductListingSortingFilterPlugin, '.cms-block-product-listing');PluginManager.override('CountryStateSelect', IntediaFormCountryStateSelectPlugin, '[data-country-state-select]');PluginManager.initializePlugins();

The override should work.


Viewing all articles
Browse latest Browse all 17945

Trending Articles