Skip to content

Commit

Permalink
Add missing service definition
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Dec 19, 2023
1 parent 2364d97 commit 69e8d67
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Setono\SyliusPlausiblePlugin\Event\AlterEvent;
use Setono\SyliusPlausiblePlugin\Event\Plausible\Event;
use Setono\SyliusPlausiblePlugin\Event\Plausible\Events;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Order\Context\CartContextInterface;
use Sylius\Component\Order\Context\CartNotFoundException;
Expand All @@ -26,6 +27,10 @@ public static function getSubscribedEvents(): array

public function populate(AlterEvent $event): void
{
if ($event->event->getName() === Events::PAGEVIEW) {
return;
}

try {
$order = $this->cartContext->getCart();
} catch (CartNotFoundException) {
Expand Down
7 changes: 7 additions & 0 deletions src/Resources/config/services/event_subscriber.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,12 @@

<tag name="kernel.event_subscriber"/>
</service>

<service id="setono_sylius_plausible.event_subscriber.populate_order_related_properties"
class="Setono\SyliusPlausiblePlugin\EventSubscriber\PopulateOrderRelatedPropertiesSubscriber">
<argument type="service" id="sylius.context.cart"/>

<tag name="kernel.event_subscriber"/>
</service>
</services>
</container>

0 comments on commit 69e8d67

Please sign in to comment.