TYPO3/Configure multiple shops

From Aimeos documentation

TYPO3
Other languages:
English 100% • ‎русский 17%


Aimeos is multi-site capable and allows storing several shops in one database. In order to tell TYPO3 which shop should be used in what page tree, you have to add a TypoScript configuration for each shop page tree. This is not necessary for the page tree that should contain the first shop (site: default).

Create new site

Since version 2.3 of the Aimeos TYPO3 extension, creating a new site is very easy. In the Aimeos configuration settings within the extension manager, you can enter a site code for which a new site will be created. If it already exists, it will get updated with the required entries for the used extension version.

Aimeos-typo3-multishop-sites.png

  • Admin Tools::Extension Manager:
    1. Search for "Aimeos web shop"
    2. Click on the extension name
    3. Enter a new site code in the corresponding input field
    4. Save and return
    5. Click on the update icon of the Aimeos extension

You will see a list of checks that have been done and at the end the types of data that has been added to the new site.

If you update Aimeos from a previous version, you need to run the update script for all sites you've created! Otherwise, required records may be missing and existing data isn't migrated.

For older versions of the Aimeos TYPO3 extension, you have to rename the "default" site in the administration interface to a new name and run the update script in the extension manager as described above. Afterwards, you may rename your new "default" site to another name and rename the old "default" site back.

Don't forget to create the appropriate "locale" entries for your new site in the administration interface!

Page TS config

Some plugins display e.g. the category tree of the shop/site to be able to select one of those categories. To display the available options from the required shop/site, please insert an additional line into the PageTS field of the page:

Aimeos-typo3-multishop-pagets.png

  • Web::Page, "<second-shop-page>" in page tree:
    1. Edit page
    2. Tab Resources, section TypoScript Configuration
  1. tx_aimeos.mshop.locale.site = <code of site>

Click on the icon forSave and close document at the top to store the change. Repeat these steps for each page tree where an other shop site other than the "default" site should be used. Clear all TYPO3 caches when you are done.

Manual TypoScript configuration

To tell the front-end that it should use another shop/site by default instead of the standard one ("default"), add a line of TypoScript to the setup config:

Aimeos-typo3-multishop-setupts.png

  1. Web::Template, "<second-shop-page>" in page tree
    • Choose Info/Modify in the drop-down at the top
    • Click on Setup in the box below
  1. plugin.tx_aimeos.settings.mshop.locale.site = <code of site>

Click on the icon for Save and close document at the top to store the change. Repeat these steps for each page tree where an other shop site other than the "default" site should be used. Clear all TYPO3 caches when you are done.

Automatic selection via parameter

Users can switch between multiple shops if the loc-site parameter is included in the URL. Depending on your RealURL configuration, the parameter value can also be at a fixed position of your URL, so the user won't see the "loc-site" parameter name. To insert the site code at the beginning of all URLs, add this to your RealURL configuration:

  1. $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['preVars'][] = array(
  2.     'GETvar' => 'loc-site',
  3.     'valueDefault' => 'default',
  4. );

In existing installations, your site parameter may be named differently. Since Aimeos TYPO3 2.0 you can configure the name of the parameter (loc-site by default) to a different name in the TypoScript setup section:

  1. plugin.tx_aimeos.settings.typo3.param.name.site = <name of the site parameter>

For example, if you use the parameter "C" for the countries and that matches the site code too, then you have to add this configuration to your TypoScript setup:

  1. plugin.tx_aimeos.settings.typo3.param.name.site = C