Created
December 21, 2022 17:00
-
-
Save aragon999/81187035f0f07f78f9e9a7fb31d1de47 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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