Skip to content

Instantly share code, notes, and snippets.

@aragon999
Created December 21, 2022 17:00
Show Gist options
  • Save aragon999/81187035f0f07f78f9e9a7fb31d1de47 to your computer and use it in GitHub Desktop.
Save aragon999/81187035f0f07f78f9e9a7fb31d1de47 to your computer and use it in GitHub Desktop.
<?php declare(strict_types=1);
namespace Swkweb\PayPalRemoveTracking\Storefront\Data;
use Shopware\Storefront\Pagelet\Footer\FooterPageletLoadedEvent;
use Swag\PayPal\Storefront\Data\FundingSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class PayPalRemoveTrackingSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
FooterPageletLoadedEvent::class => ['removeFundingAvailabilityData', -100],
];
}
public function removeFundingAvailabilityData(FooterPageletLoadedEvent $event): void
{
$pagelet = $event->getPagelet();
if (!$pagelet->hasExtension(FundingSubscriber::FUNDING_ELIGIBILITY_EXTENSION)) {
return;
}
$pagelet->removeExtension(FundingSubscriber::FUNDING_ELIGIBILITY_EXTENSION);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment