This plugin adds a small form to each and every product card in the shop. The form allows customers to add products to their cart without having to visit the product detail and cart summary page.
As can be seen in the image above, this works best when using the "match" product variant selection method. Please see the official Sylius documentation on how to setup the product variant selection method in the shop.
1.10 |
NOTE: This plugin requires PHP 7.4 or up
-
Install using composer:
composer require nedac/sylius-order-now-plugin
-
If you have overridden the
ProductAssociation
,Product
and/orProductReview
controller in your project, please make sure they use the corresponding trait:ProductAssociation
->Nedac\SyliusOrderNowPlugin\Controller\ProductAssociationControllerTrait
Product
->Nedac\SyliusOrderNowPlugin\Controller\ProductControllerTrait
ProductReview
->Nedac\SyliusOrderNowPlugin\Controller\ProductReviewTrait
NOTE: If the methods in the traits have already been implemented in the controller in your project then the logic will have to be merged.
-
If you have overridden controllers in your project and you've gone through step 2, please do not change your Sylius configuration for those controllers. Otherwise:
# config/packages/_sylius.yaml # ... sylius_product: resources: product: classes: controller: Nedac\SyliusOrderNowPlugin\Controller\ProductController product_association: classes: controller: Nedac\SyliusOrderNowPlugin\Controller\ProductAssociationController # ... sylius_review: resources: product: review: classes: controller: Nedac\SyliusOrderNowPlugin\Controller\ProductReviewController
-
Install assets:
bin/console sylius:install:assets
It might be necessary to clear the cache after installation:
bin/console cache:clear
The plugin should now be successfully installed.