my-cookie-permission, as it's extending the default
<plugin root>/src/Resources/app/storefront/src/my-cookie-permissiondirectory and put an empty file
my-cookie-permission.plugin.jsin there. The latter will be your main plugin class file.
cookie-permissionplugin class, so you can extend from it.
this.options.cookieNameis set in the
init()method and make sure this value is always set to an empty string, which will evaluate to
init()method of the original plugin.
_hideCookieBar()function to show the dialogue and only call the parent implementation if the user clicks "OK" in the confirm dialogue. So your whole plugin now looks like this:
main.jsin the directory
PluginManagerfrom the global window object for this. But instead of using the
register()function to register a new plugin, you use the
override()function to indicate that you want to override an existing plugin.