Data providers¶
Data providers define where product information is stored.
You can use one of two data providers: the content model data provider and the eContent data provider.
Switching the data provider¶
You can switch the data provider either with the command line or manually. Only one data provider can be activated per installation.
Command line switching¶
The silversolutions:switchdataprovider
command switches between the content model data provider and eContent.
It is useful especially for testing purposes.
The command takes the following options:
Option | Notes |
---|---|
--new-root-node |
Default value is 56 for content model data provider, 2 for eContent |
--location-id |
Default value is 56 . This is the Location ID of the "Product catalog" Content item in Ibexa Platform. If you are using another Location ID, change this parameter |
1 2 3 4 5 6 7 |
|
Remember to clear the cache after you execute the command:
1 |
|
Data provider switch process¶
Switching the data provider introduces some changes to your project:
Changes to config/packages/ecommerce.yml
¶
1 2 3 4 5 |
|
Changes to the "Product catalog" Content item¶
The Product catalog's root node is set accordingly.
- For eContent, the root node is set to
2
by default, for content model it is56
(in case the demo data is used). - The Location ID for the Product catalog can be set to a different value by using the
--location-id parameter
.
Manual switching¶
1. Load root element¶
First, ensure that you are loading the correct root element for your provider.
2. Change configuration¶
The following settings are already set up in the configuration files econtent_search.yml
or ez_search.yml
:
1 2 3 |
|
3. Configure search services¶
Change the alias for search services for every type (product, catalog, content).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
4. Set up search groups¶
Set up search groups and configuration accordingly.
Check the complete configuration from the vendor as well:
vendor/silversolutions/silver.e-shop/src/Siso/Bundle/SearchBundle/Resources/config/econtent_search.yml
vendor/silversolutions/silver.e-shop/src/Siso/Bundle/SearchBundle/Resources/config/ez_search.yml
The path for products in econtent e.g. is /2/
and for eZ /1/2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|