Download the PHP package bestit/commercetools-customer-prices-bundle without Composer
On this page you can find all versions of the php package bestit/commercetools-customer-prices-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bestit/commercetools-customer-prices-bundle
More information about bestit/commercetools-customer-prices-bundle
Files in bestit/commercetools-customer-prices-bundle
Package commercetools-customer-prices-bundle
Short Description Provides a commercetools substitute with custom objects to get customer individual prices.
License MIT
Informations about the package commercetools-customer-prices-bundle
bestit/commercetools-customer-prices-bundle
There is no real support for individual customer prices in the the commercetools platform at this moment. You could try to add a lot of "channel prices" for your products, but you will hit some topics like a missing fallback in the search facets for the scopedPrice (no fallback to the normal price, if a channel price is missing), performance losses because of huge product data sets and maybe you hit rock bottom with the maximum document size of the database itself.
So you need a substitute. This bundle will provide you with a substitute based on custom objects like
You can configure the field names for the container, price value, article and customer value!
API
You can inject/use the service best_it_ct_customer_prices.model.customer_price_collection to fetch your price with BestIt\CtCustomerPricesBundle\Model\CustomerPriceCollection::getByArticle(string $articleId). $articleId needs to match the data out of your custom object.
The lazy loaded service best_it_ct_customer_prices.model.customer_price_collection is "created" with a factory, which takes the authed User out of the Security Token Storage.
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
You can define a custom query for searching your custom objects. The following default query will be used
if you not set this field: container="{container}-{currencyValue}-{customerValue}"
You can use placeholders for your query:
Placeholder | Description | Example |
---|---|---|
{container} | Your custom object container name | customer-price |
{articleField} | Your custom object field name for article number | sku |
{customerField} | Your custom object field name for customer number | customerNumber |
{currencyField} | Your custom object field name for currency | currency |
{pricesField} | Your custom object field name for prices | prices |
{customerValue} | Your current customer number | MA4785 |
{currencyValue} | Your current currency | EUR |
Step 4: Mark your user object as usable.
Please implement the BestIt\CtCustomerPricesBundle\Model\CustomerInterface on your user object. The used id needs to match the customer data out of your custom object.
ToDos
- More Docs
All versions of commercetools-customer-prices-bundle with dependencies
php Version ^7.0
symfony/proxy-manager-bridge Version ^3.0
symfony/dependency-injection Version ^3.0
symfony/cache Version ^3.0
symfony/security Version ^3.0
symfony/stopwatch Version ^3.0