asdoria/sylius-marketing-cart-plugin

Create the page products with muti criteria for you shop


README

Asdoria Marketing Cart Bundle

Simply create pages with products from several criteria such as similar attributes, taxon into Sylius Shop

Features

  • Create pages with products from several criteria such as similar attributes, taxon,

Installation

  1. run composer require asdoria/sylius-marketing-cart-plugin

  2. Add the bundle in config/bundles.php.

Asdoria\SyliusMarketingCartPlugin\AsdoriaSyliusMarketingCartPlugin::class => ['all' => true],
  1. Import routes in config/routes.yaml
asdoria_marketing_cart:
    resource: "@AsdoriaSyliusMarketingCartPlugin/Resources/config/routing.yaml"
  1. Import config in config/packages/_sylius.yaml
imports:
    - { resource: "@AsdoriaSyliusMarketingCartPlugin/Resources/config/config.yaml"}
  1. Paste the following content to the src/Repository/ProductRepository.php:
  <?php

  declare(strict_types=1);

  namespace App\Repository;

  use Asdoria\SyliusMarketingCartPlugin\Repository\Model\Aware\ProductMarketingCartRepositoryAwareInterface;
  use Asdoria\SyliusMarketingCartPlugin\Repository\Traits\ProductMarketingCartRepositoryTrait;
  use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository as BaseProductRepository;
  
  final class ProductRepository extends BaseProductRepository implements ProductMarketingCartRepositoryAwareInterface
  {
      use ProductMarketingCartRepositoryTrait;
  }
  1. Configure repositories in config/packages/_sylius.yaml:
 sylius_product:
     resources:
         product:
             classes:
                 model: App\Entity\Product\Product
+                repository: App\Repository\ProductRepository

Demo

You can try the MarketingCart plugin online by following this link: here!.

Note that we have developed several other open source plugins for Sylius, whose demos and documentation are listed on the following page.

Usage

  1. In the shop office, go to /en_US/marketing-carts route.