Skip to content

Commit

Permalink
NTR: force javascript use shopware in 6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalij Mik committed May 22, 2024
1 parent c0c17af commit f6f9a31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Resources/app/storefront/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import MollieRegistration from './register';
// if it's however necessary to use the built-in all.js, then this would
// also work, as long as its built in the Shopware version that uses it.

const molliePlugins = new MollieRegistration();

molliePlugins.register();
if (window.mollie_javascript_use_shopware !== undefined && window.mollie_javascript_use_shopware === '1') {
const molliePlugins = new MollieRegistration();
molliePlugins.register();
}
1 change: 1 addition & 0 deletions src/Subscriber/StorefrontBuildSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public function onStorefrontRender(StorefrontRenderEvent $event): void
if ($this->versionCompare->gte('6.6')) {
$molliePayments = $this->pluginRegistry->getConfigurations()->getByTechnicalName('MolliePayments');
$mollieJavascriptAlreadyExists = $molliePayments && ($molliePayments->getScriptFiles()->count() > 0);
$event->setParameter('mollie_javascript_use_shopware', true);
}
$event->setParameter('mollie_javascript_already_exists', $mollieJavascriptAlreadyExists);
}
Expand Down

0 comments on commit f6f9a31

Please sign in to comment.