custom/static-plugins/GlobusSW6/src/Core/Checkout/Cart/IaneoCartCollector.php line 27

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace GlobusSW6\Core\Checkout\Cart;
  3. use GlobusSW6\Service\StoreLocator\Struct\PickupStoreStruct;
  4. use Shopware\Core\Checkout\Cart\Cart;
  5. use Shopware\Core\Checkout\Cart\CartBehavior;
  6. use Shopware\Core\Checkout\Cart\CartDataCollectorInterface;
  7. use Shopware\Core\Checkout\Cart\LineItem\CartDataCollection;
  8. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  9. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  10. class IaneoCartCollector implements CartDataCollectorInterface
  11. {
  12.     /** @var SessionInterface */
  13.     private $session;
  14.     public function __construct(SessionInterface $session)
  15.     {
  16.         $this->session $session;
  17.     }
  18.     public function collect(CartDataCollection $dataCart $originalSalesChannelContext $contextCartBehavior $behavior): void
  19.     {
  20.         //TODO SMN Ist das sicher?
  21.         $storeId $this->session->get('ianeoCurrentStore');
  22.         $original->addExtension(
  23.                 "ianeo_pickup_data",new PickupStoreStruct($storeId,'pickup')
  24.         );
  25.     }
  26. }