26 lines
517 B
PHP
26 lines
517 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KupShop\GTMBundle\ServerSideGTMEvent;
|
|
|
|
use KupShop\OrderingBundle\Event\CartItemEvent;
|
|
use Symfony\Contracts\EventDispatcher\Event;
|
|
|
|
class CartRemoveItemEvent extends CartAddItemEvent
|
|
{
|
|
public function getPayload(Event|CartItemEvent $event): array
|
|
{
|
|
if (!$event->getProduct()) {
|
|
return [];
|
|
}
|
|
|
|
return parent::getPayload($event);
|
|
}
|
|
|
|
protected function getEventName(): string
|
|
{
|
|
return 'remove_from_cart';
|
|
}
|
|
}
|