<?php declare(strict_types=1);
namespace Maxia\MaxiaCrossVariantDiscounts6;
use Shopware\Core\DevOps\Environment\EnvironmentHelper;
use Shopware\Core\Framework\Plugin;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class MaxiaCrossVariantDiscounts6 extends Plugin
{
public function build(ContainerBuilder $container): void
{
parent::build($container);
$priority = EnvironmentHelper::getVariable(
'MAXIA_CROSS_VARIANT_DISCOUNTS_PROCESSOR_PRIORITY',
getenv('MAXIA_CROSS_VARIANT_DISCOUNTS_PROCESSOR_PRIORITY')
);
if ($priority) {
$container->getDefinition('Maxia\MaxiaCrossVariantDiscounts6\Cart\Checkout\CrossVariantPriceProcessor')
->setTags(['shopware.cart.processor' => [
0 => ['priority' => (int)$priority]
]]);
}
}
}