vendor/store.shopware.com/maxiacrossvariantdiscounts6/src/MaxiaCrossVariantDiscounts6.php line 9

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Maxia\MaxiaCrossVariantDiscounts6;
  3. use Shopware\Core\DevOps\Environment\EnvironmentHelper;
  4. use Shopware\Core\Framework\Plugin;
  5. use Symfony\Component\DependencyInjection\ContainerBuilder;
  6. class MaxiaCrossVariantDiscounts6 extends Plugin
  7. {
  8.     public function build(ContainerBuilder $container): void
  9.     {
  10.         parent::build($container);
  11.         $priority EnvironmentHelper::getVariable(
  12.             'MAXIA_CROSS_VARIANT_DISCOUNTS_PROCESSOR_PRIORITY',
  13.             getenv('MAXIA_CROSS_VARIANT_DISCOUNTS_PROCESSOR_PRIORITY')
  14.         );
  15.         if ($priority) {
  16.             $container->getDefinition('Maxia\MaxiaCrossVariantDiscounts6\Cart\Checkout\CrossVariantPriceProcessor')
  17.                 ->setTags(['shopware.cart.processor' => [
  18.                     => ['priority' => (int)$priority]
  19.                 ]]);
  20.         }
  21.     }
  22. }