Skip to content

Commit

Permalink
PIPRES-488: added additional validation then adding the product which…
Browse files Browse the repository at this point in the history
… causes incorrect behavior on some themes
  • Loading branch information
GytisZum committed Nov 18, 2024
1 parent d45dd80 commit 38d861a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use Mollie\Subscription\Install\DatabaseTableInstaller;
use Mollie\Subscription\Install\HookInstaller;
use Mollie\Subscription\Install\Installer;
use Mollie\Subscription\Config\Config as SubscriptionConfig;
use Mollie\Subscription\Provider\SubscriptionProductProvider;
use Mollie\Subscription\Repository\LanguageRepository as LanguageAdapter;
use Mollie\Subscription\Repository\RecurringOrderRepositoryInterface;
Expand Down Expand Up @@ -1124,6 +1125,19 @@ public function hookActionAjaxDieCartControllerDisplayAjaxUpdateBefore(array $pa
return;
}

$isSubscriptionEnabled = Configuration::get(Config::MOLLIE_SUBSCRIPTION_ENABLED);

$groups = Tools::getValue('group');
if (!(bool)$isSubscriptionEnabled || !is_array($groups)) {
return;
}

$subscriptionGroup = Configuration::get(SubscriptionConfig::SUBSCRIPTION_ATTRIBUTE_GROUP);

if (!in_array($subscriptionGroup, $groups, true)) {
return;
}

$response = json_decode($params['value'], true);

$hasError = $response['hasError'] ?? false;
Expand Down

0 comments on commit 38d861a

Please sign in to comment.