Download the PHP package nedac/sylius-minimum-order-value-plugin without Composer

On this page you can find all versions of the php package nedac/sylius-minimum-order-value-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sylius-minimum-order-value-plugin

This plugin adds the option of configuring a minimum order value for each channel.

When a minimum order value is configured it is not possible to checkout the order if the subtotal of all of the items in the cart is lower the configured minimum.

Configuration by administrator:

Configuring a minimum order value is possible by logging in as an administrator and navigating to the channel configuration:

Choose to edit an existing channel or to add a new one:

This plugin adds a segment to the add/edit pane that can be used to set the desired minimum order value in the base currency:

By default the toggle is set to the off position and the field to enter the minimum order value is disabled. To configure the desired value use the toggle to enable the minimum order value and enter the value in the field.

What do visitors see?

When visiting the shop and not having added enough items to the shopping cart they will not be able to proceed to checkout:

The checkout button is disabled and a message is displayed, providing more insight in the current status:

When clicking the cart widget button, the checkout button is hidden:

If a visitor tries to skip ahead to the checkout process (for example by entering the url manually), the visitor will automatically be redirected to the cart summary page.

How does it work?

Technically what this plugin does is a few things. It adds an optional field to the channel entity and the option to configure the fields value through the admin system.

This value is used by the MinimumOrderValueReached class, which is configured as a guard on all of the transitions of the "sylius_order_checkout" state machine.

By overriding the "sylius.resolver.checkout" service and disabling the original service, the plugin is able to redirect the visitor to the cart summary page when the guard blocks the transition.

Overriding that service also means that the service needs to be configured slightly differently then before (only applicable if you have a customised checkout resolver configuration):

Whereas before the the checkout resolver could be configured through key "sylius_shop", it now needs to be done through key "nedac_sylius_minimum_order_value":

This is the default configuration added by this plugin in src/Resources/config/config.yaml. It can be overridden on an application level as with any Symfony bundle configuration.

Please see the official Sylius docs on how to configure the checkout resolver, should there be any need to do so.

Supported Sylius versions:
1.10

NOTE: This plugin requires PHP 7.4 or up

Installation:

  1. Install using composer:

  2. Generate and run database migration:

  3. Install assets:

The flex recipe should take care of enabling the bundle, copying the configuration file and copying the templates that need to be overridden. It is quite possible that you're already overriding one or more templates. In that case you'll have to edit/merge those templates manually with the templates that can be found in src/Resources/templates.


All versions of sylius-minimum-order-value-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
sylius/sylius Version >=1.10.2 <1.11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nedac/sylius-minimum-order-value-plugin contains the following files

Loading the files please wait ....