Simply QuickShopping's Managment into Sylius Shop
- Add multiple variants to your shopping cart by name or sku
-
run
composer require asdoria/sylius-quick-shopping-plugin
-
Add the bundle in
config/bundles.php
.
Asdoria\SyliusQuickShoppingPlugin\AsdoriaSyliusQuickShoppingPlugin::class => ['all' => true],
- Import routes in
config/routes.yaml
asdoria_quick_shopping:
resource: "@AsdoriaSyliusQuickShoppingPlugin/Resources/config/routing.yaml"
- Import config in
config/packages/_sylius.yaml
imports:
- { resource: "@AsdoriaSyliusQuickShoppingPlugin/Resources/config/config.yaml"}
- Paste the following content to the
src/Repository/ProductVariantRepository.php
:
<?php
declare(strict_types=1);
namespace App\Repository;
use Asdoria\SyliusQuickShoppingPlugin\Repository\Model\ProductVariantRepositoryAwareInterface;
use Asdoria\SyliusQuickShoppingPlugin\Repository\ProductVariantRepositoryTrait;
use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductVariantRepository as BaseProductVariantRepository;
final class ProductVariantRepository extends BaseProductVariantRepository implements ProductVariantRepositoryAwareInterface
{
use ProductVariantRepositoryTrait;
}
- Configure repositories in
config/packages/_sylius.yaml
:
sylius_product:
resources:
product_variant:
classes:
model: App\Entity\Product\ProductVariant
+ repository: App\Repository\ProductVariantRepository
You can try the QuickShopping 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.
- In the shop office, go to /en_US/quick-shopping route.