Download the PHP package ecoco/sylius-base-price-plugin without Composer
On this page you can find all versions of the php package ecoco/sylius-base-price-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ecoco/sylius-base-price-plugin
More information about ecoco/sylius-base-price-plugin
Files in ecoco/sylius-base-price-plugin
Package sylius-base-price-plugin
Short Description Sylius base price plugin will show product base price next to its price and in cart
License MIT
Informations about the package sylius-base-price-plugin
Ecocode Sylius Base Price Plugin
Plugin that calculates and shows product base price
Documentation
Sylius Base Price Plugin allows you to add extra information to your shop about product base price. After installation you will need to set up product variable mass or volume or other unit. This value will be used to calculate base unit price and will show up in product detail page and cart.
Features
- Installs base_price_unit and base_price_value columns in sylius_product_variant table.
- "Base Price" tab in admin product variant page
- Base price display in product detail page
- Base price display in cart for each product
Installation
Download and install
Enable plugin
*this step is done automatically by symfony.
Register the plugin by adding it to your config/bundles.php file
Configure
You need to copy config file to project:
config/packages/ecocode_sylius_base_price_plugin.yaml
Advanced configuration
If you want to have more control over what metrics are visible and how it will be converted then you should update:
ecocode_sylius_base_price: (uncomment from above)
Its default values are defined in src/Resources/config/config.yaml
Extend ProductVariant entity
Add trait and interface to existing entity.
src/Entity/Product/ProductVariant.php
Run migration
or update schema without defining migration
Clear cache
Usage
1. Select product unit
2. Set product unit value
3. See it in product detail page
4. See it in cart
Testing
Using docker-compose (suggested)
First you will need to edit edit behat.yml.dist and uncomment lines related to docker-compose.
Then you can boot it up. Prepare database and run tests.
Using docker
Using this test method you will not be able to test behat so easily
Locally (complex)
1) You will need to have database running. You can use locally installed one or run it using docker.
2) Then edit and make sure database configuration is correct:
Edit tests/Application/.env.test file. And add database configuration there
3) Export test env (then commands dont require -e test)
Installation
Continue with setup
Come back to root directory
Then you should be able to run phpunit and other static code analysis checks.
PhpUnit
Static code analysis
Psalm
PHPStan
Behat (JS scenarios)
1. [Install Symfony CLI command](https://symfony.com/download).
2. Start Chrome (all other chrome sessions needs to be closed first):
Headless
Normal
3. Install SSL certificates (only once needed) and run test application's webserver on `127.0.0.1:8080`:
4. Run Behat:
Uncomment local configuration in `behat.yml.dist` (and comment out docker-compose one)All versions of sylius-base-price-plugin with dependencies
ext-intl Version *
ext-curl Version *
ext-simplexml Version *
ext-gd Version *
ext-mbstring Version *
ext-exif Version *
php Version ^7.3
friendsofsymfony/oauth-server-bundle Version ^1.6 || >2.0.0-alpha.0 ^2.0@dev
jordanbrauer/unit-converter Version ^0.8
sylius/sylius Version ^1.8 || ^1.9

