vldmr-k / sylius-viewed-products-plugin
Package info
github.com/vldmr-k/sylius-viewed-products-plugin
Type:sylius-plugin
pkg:composer/vldmr-k/sylius-viewed-products-plugin
Requires
- php: ^8.1
- sylius/mailer-bundle: ^1.8 || ^2.0@beta
- sylius/sylius: ^1.12
- symfony/webpack-encore-bundle: ^1.15
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- phpspec/phpspec: ^7.2
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^1.8.1
- phpstan/phpstan-doctrine: 1.3.60
- phpstan/phpstan-strict-rules: ^1.3.0
- phpstan/phpstan-webmozart-assert: ^1.2.0
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- sylius-labs/coding-standard: ^4.2
- symfony/browser-kit: ^5.4 || ^6.0
- symfony/debug-bundle: ^5.4 || ^6.0
- symfony/dotenv: ^5.4 || ^6.0
- symfony/flex: ^2.2.2
- symfony/intl: ^5.4 || ^6.0
- symfony/web-profiler-bundle: ^5.4 || ^6.0
- vimeo/psalm: 5.21.1
Suggests
None
Provides
None
Conflicts
- symfony/framework-bundle: 6.2.8
Replaces
None
This package is auto-updated.
Last update: 2026-10-20 18:59:07 UTC
README
It's plugin show customers last viewed products.
This simple plugins helps your customers compare and looking the best product for themself
How to install?
composer require vldmr-k/sylius-viewed-products-plugin
Import config file into _sylius.yml
imports: .... - { resource: "@VldmrkSyliusViewedProductsPlugin/Resources/config/config.yml" }
By default, this plugins render last viewed products on product show page, event block name sylius.shop.product.show.content.
If you want to add this block to another page, add this code to block events which you want
sylius_ui: events: sylius.shop.product.show.content: # <--- default blocks: viewed_products: template: "@VldmrkSyliusViewedProductsPlugin/_viewed_products.html.twig" priority: 20
Storage
The ids of viewed products (the last viewed first) are kept in one of two storages:
session(default): in the session, under_viewed_product. A visitor who views a product gets a session.cookie: in a cookie of its own (viewed_products=812.77.4031, HttpOnly, SameSite=Lax). Viewing products does not start a session, and every view extends the cookie lifetime.
# config/packages/vldmrk_sylius_viewed_products.yaml vldmrk_sylius_viewed_products: storage: type: cookie # session | cookie limit: 20 # how many products are remembered cookie: name: viewed_products lifetime: 2592000 # seconds (30 days)
The chosen storage is the service vldmrk.viewed_product.storage.product_viewed_storage, also autowired as
Vldmrk\SyliusViewedProductsPlugin\Storage\ViewedProductsStorageInterface.
To keep the list somewhere else, implement that interface and point the alias at your service.
That's all :)
Development
See FORDEVREADME.md