custom/plugins/SwagCustomizedProducts/src/Core/Checkout/Customer/SalesChannel/SalesChannelWishListSubscriber.php line 28

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /*
  3.  * (c) shopware AG <info@shopware.com>
  4.  * For the full copyright and license information, please view the LICENSE
  5.  * file that was distributed with this source code.
  6.  */
  7. namespace Swag\CustomizedProducts\Core\Checkout\Customer\SalesChannel;
  8. use Shopware\Storefront\Page\Wishlist\WishListPageProductCriteriaEvent;
  9. use Shopware\Storefront\Pagelet\Wishlist\GuestWishListPageletProductCriteriaEvent;
  10. use Swag\CustomizedProducts\Migration\Migration1565933910TemplateProduct;
  11. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  12. class SalesChannelWishListSubscriber implements EventSubscriberInterface
  13. {
  14.     public static function getSubscribedEvents(): array
  15.     {
  16.         return [
  17.             GuestWishListPageletProductCriteriaEvent::class => 'addCustomizedProductsToWishList',
  18.             WishListPageProductCriteriaEvent::class => 'addCustomizedProductsToWishList',
  19.         ];
  20.     }
  21.     /**
  22.      * @param GuestWishListPageletProductCriteriaEvent|WishListPageProductCriteriaEvent $event
  23.      */
  24.     public function addCustomizedProductsToWishList($event): void
  25.     {
  26.         $criteria $event->getCriteria();
  27.         $criteria->addAssociation(Migration1565933910TemplateProduct::PRODUCT_TEMPLATE_INHERITANCE_COLUMN);
  28.     }
  29. }