Switching to the legacy Smarty template engine

If required, install the Smarty template engine.

We assume you have OXID eShop Version 7 already installed from the metapackage.

We will give an example for the Enterprise Edition.

Background

The Smarty template engine is not part of the OXID eShop Compilation Version 7.

Nevertheless, you can install the Smarty template engine and use Smarty-compatible themes.

Important

We strongly recommend using the Twig template engine and Twig-compatible themes.

Building a custom metapackage

We have a little shortcoming of composer with removing components via composer which are not required by the root package. Composer cannot do that.

This means, you first have to change your root composer.json file from including metapackages to directly including all packages currently installed.

Procedure

  1. In the OXID eShop`s root directory, run the following command:

    composer show --locked
    

    All components currently installed are displayed with their exact version numbers.

  2. Convert this output into composer.json format:

    "oxid-esales/oxideshop-ce":"v7.0.1",
    "oxid-esales/oxideshop-composer-plugin":"v7.1.0",
    "oxid-esales/oxideshop-db-views-generator":"v2.1.0",
    "oxid-esales/oxideshop-demodata-ce":"v8.0.0",
    ....
    
  3. Remove all occurrences of OXID eShop metapackages (oxideshop-metapackage-*) from this list, as their requirements are already included.

  4. Replace the "require": { ...} section in your root composer.json file with this content.

  5. Backup your current composer.lock file.

  6. Run composer update:

    composer update
    
  7. Compare the current composer.lock file with the one you have backed up.

    Make sure the only difference is the missing oxideshop-metapackage-* entries.

Removing Twig and adding Smarty components

Remove Twig and add Smarty components.

Procedure

  1. Remove the Twig components:

    composer remove --no-update --update-with-dependencies oxid-esales/twig-admin-theme
    composer remove --no-update --update-with-dependencies oxid-esales/twig-component-ee
    composer remove --no-update --update-with-dependencies oxid-esales/twig-component-pe
    composer remove --no-update --update-with-dependencies oxid-esales/twig-component
    composer remove --no-update --update-with-dependencies twig/twig
    
  2. Ensure that the demo data is compatible with the Smarty theme:

    Note

    In a shop installed from OXID eShop 7 metapackage, demo data for all editions will be included but only metadata compatible with your edition will be installable by the demodata-installer.

    Decide if and which demodata packages you wish to install.

    composer require --no-update oxid-esales/oxideshop-demodata-ce v7.1.0
    composer require --no-update oxid-esales/oxideshop-demodata-pe v7.1.0
    composer require --no-update oxid-esales/oxideshop-demodata-ee v7.1.0
    
  3. Prepare the Smarty template engine installation:

    composer require --no-update oxid-esales/smarty-component v1.0.0
    composer require --no-update oxid-esales/smarty-component-pe v1.0.0
    composer require --no-update oxid-esales/smarty-component-ee v1.0.0
    
  4. Prepare the installation of a compatible theme, Wave, for example:

    composer require --no-update oxid-esales/smarty-admin-theme v1.0.0
    composer require --no-update oxid-esales/wave-theme v3.0.0
    

    The preparation is finished.

  5. To install Smarty, execute the following command:

    composer update
    
  6. Clear the shop caches:

    ./vendor/bin/oe-console oe:cache:clear
    
  7. Log in to the admin backend and activate the Smarty-compatible theme (Wave, in our example).