Download the PHP package bestit/commercetools-filter-bundle without Composer

On this page you can find all versions of the php package bestit/commercetools-filter-bundle. 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 commercetools-filter-bundle

bestit/commercetools-filter-bundle

Add filter and search implementation for commerce tools. It still uses the commmercetools/php-sdk under the hood.

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

Step 3: Configure the Bundle

Minimum configuration (only all required fields)

Maximum configuration (all required and optional fields)

Usage

Listing

Just execute the listing method of the filter manager in your listing controller. It need the Symfony Request object and the current listing category (Commercetools Object) for creating the listing request.

Example:

Search

Just execute the search method of the filter manager in your listing controller. It need the Symfony Request object and the search string for creating the search request.

Example:

Product Normalizer

In most cases, products need to be normalized for the frontend. You can choose one of the base normalizer from filter bundle or use your own if you implement the ProductNormalizerInterface and add the service id to the app config. The filter bundle contains two base normalizer:

EmptyProductNormalizer will be use if you don't fill the _product_normalizerid Parameter (@ config.yml).

Term Normalizer

There are cases where you have to normalize facet terms. Commercetools only ships enum keys and categories id for example, which aren't enough for your frontend. This bundle contains two default normalizers:

But you can define your own TermNormalizer as well. Just implement the TermNormalizerInterface and add the tag best_it_commercetools_filter.term_normalizer to your service. Remember to disable the default normalizer in your config.

If you want to skip a term, just throw a SkipTermException. No further normalizer will be applied and the term will not be shown at frontend.

Config Provider id

You can add you own filter config provider. Just implement the FacetConfigProviderInterface and add your service id to _config_providerid (@ config.yml). The filter bundle default provider will be use if you don't fill the _config_providerid Parameter (@ config.yml), which returns no filters.

Url generator

The filter bundle need to create urls, but the route names can vary between projects. So you can add your own url generator for creating the correct urls with the _url_generatorid parameter. The generator need to implement the FilterUrlGeneratorInterface. The bundle will use his own default generator if you do not fill the field.

Events

Request events

You can modify the commercetools client request with the filter and suggest post events. Check all events @ SuggestEvent and FilterEvent class.

Example usage: Extend request


All versions of commercetools-filter-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
symfony/symfony Version ^3.1
commercetools/php-sdk Version ^1.2.1 || ^2.0
amstaffix/pagination Version ^1.1@dev
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 bestit/commercetools-filter-bundle contains the following files

Loading the files please wait ....