Skip to content

Commit

Permalink
improved attribute group check
Browse files Browse the repository at this point in the history
  • Loading branch information
GytisZum committed Nov 19, 2024
1 parent 38d861a commit b7328a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
use Mollie\Repository\PaymentMethodRepositoryInterface;
use Mollie\Service\ExceptionService;
use Mollie\ServiceProvider\LeagueServiceContainerProvider;
use Mollie\Subscription\Config\Config as SubscriptionConfig;
use Mollie\Subscription\Handler\CustomerAddressUpdateHandler;
use Mollie\Subscription\Handler\UpdateSubscriptionCarrierHandler;
use Mollie\Subscription\Install\AttributeInstaller;
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 @@ -1128,13 +1128,14 @@ public function hookActionAjaxDieCartControllerDisplayAjaxUpdateBefore(array $pa
$isSubscriptionEnabled = Configuration::get(Config::MOLLIE_SUBSCRIPTION_ENABLED);

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

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

if (!in_array($subscriptionGroup, $groups, true)) {
// Note: groups = ['attribute_group_id => 'attribute_id']
if (!array_key_exists($subscriptionGroup, $groups)) {
return;
}

Expand Down

0 comments on commit b7328a2

Please sign in to comment.