Magento Commerce Cloud Installation.
1. Copy theme files from Theme Files (Magento Commerce) folder (only
app and pub folders) in the root of your magento installation.
2. Before you commit any files to Commerce Cloud Github repository, apply patch
from ‘Patches/Magento Commerce Cloud patch’ by following below steps:
Step 1.
Copy the content of ‘Patches/Magento Commerce Cloud patch’
folder into the root of your Magento installation.
Step 2.
After patch files are copied, on UNIX / MAC OS systems run the
pearl_cloud_setups.sh script using this command in the CLI in
the root of your project, where your copied the files:
./pearl_cloud_setups.sh
Once the script is executed you should receive the message "DONE" in your CLI.
In order to make sure that patch was successfully applied you can verify that symlinks were created at these locations; 'css' should be a symlink/alias and not a directory:
app/code/WeltPixel/CategoryPage/view/frontend/web/css
app/code/WeltPixel/CustomHeader/view/frontend/web/css
app/code/WeltPixel/FrontendOptions/view/frontend/web/css
app/code/WeltPixel/ProductPage/view/frontend/web/css
app/code/WeltPixel/QuickCart/view/frontend/web/css
Step 3.
Pearl Theme code is now ready to be committed to Github and deployed on your Cloud environment. Commit the code to your Commerce Cloud repository. The environment should automatically deploy the code to the magento installation coresponding to the git repository where the code was comitted.
For more details about installing Pearl Theme you can check the detailed article on Pearl Theme Commerce Cloud Installation using UNIX systems from our Support Center.
Important:
After deploy, go to Cache Management section of your Magento Admin and
Regenerate Pearl Theme LESS/CSS files in order to correctly apply all theme options.
You can automate the Pearl Theme LESS/CSS generation by adding the corresponding commands in .magento.app.yaml file from the root of your cloud installation, this commands will be automatically executed with each deploy. Please find below deploy hook structure of .magento.app.yaml file.
# The hooks executed at various points in the lifecycle of the application.
hooks:
# We run build hooks before your application has been packaged.
build: |
php ./bin/magento magento-cloud:build
# We run deploy hook after your application has been deployed and started.
deploy: |
php ./vendor/magento/magento-cloud-configuration/pre-deploy.php
php ./bin/magento magento-cloud:deploy
php ./bin/magento weltpixel:less:generate
php ./bin/magento weltpixel:css:generate --store=default
Step 4.
Woohoo! Pearl Theme is installed and your store should be already looking awesome!
Theme layout Pre-configuration via SSH
Page layout configuration can be done also from Magento Admin, if you want to customize the theme using Pearl Theme admin options skip below instructions and continue to Step 4.
Some users may prefer using SSH import settings to pre-configure pages layout. If you find yourself in this case you can use the theme configuration options below to setup the layout for each page type.
Visit Pearl Demo Store and choose the layout you like for each page type. Available options below:
[--homePage[="..."]] = v1, v2, v3, v4, v5, v6, v7, v8, v9, v10
[--header[="..."]] = v1, v2, v3, v4
[--categoryPage[="..."]] = 2columns, 3columns, 4columns, 5columns
[--productPage[="..."]] = v1, v2, v3, v4
[--footer[="..."]] = v1, v2, v3, v4
[--store="..."] = default, GLOBAL
[--demoVersion] = v1, v2, v3, v4, v5, v6, v7, v8, v9, v10
When changing between sample home pages make sure to run corresponding import options as each homepage comes with predefined theme settings.
php bin/magento weltpixel:import:demo [--store="..."] [--demoVersion]
php bin/magento weltpixel:theme:configurator [--store="..."] [--homePage[="..."]] [--header[="..."]] [--categoryPage[="..."]] [--productPage[="..."]] [--footer[="..."]]
php bin/magento weltpixel:cleanup
php bin/magento weltpixel:less:generate
php bin/magento ca:cl
Example how to set Homepage V8 with coresponding V8 theme options, Header Version 1, Category Page on 3 columns, Product Page Version 1, Footer Version 3:
php bin/magento weltpixel:import:demo --store=GLOBAL --demoVersion=v8
php bin/magento weltpixel:theme:configurator --store=GLOBAL --homePage=v8 --header=v1 --categoryPage=3columns --productPage=v1 --footer=v3
php bin/magento weltpixel:cleanup
php bin/magento weltpixel:less:generate
php bin/magento ca:cl
How Commerce Cloud Patch Works.
Note: If you still getting the 'path is not writable' errors when saving admin
options, it means the Commerce Cloud patch was not succesfully applied. Make sure you are
running the script pearl_cloud_setups.sh on UNIX OS in the root of your project
before committing the files to your Commerce Cloud Github repository.
In read-only environments a write limitation is encountered when generating theme
LESS files based on theme admin options, as Cloud environments are read-only we
cannot generate dynamic LESS files inside the theme modules. Because of this reason
in this patch we changed default location of LESS files from 'app/code/WeltPixel'
(read-only) to 'pub/media/css_weltpixel' (read / write).
When the pearl_cloud_setups.sh shell script is executed, it removes the css
directories under non writable location 'app/code/WeltPixel/...' and creates
symlinks to 'pub/media/css_weltpixel/MODULE_NAME/css directories' (as these
are writable on the cloud as well.)
Commerce Cloud patch also contains the initial module less files for 5 modules where
we generate less on the fly. (CategoryPage, CustomHeader,
FrontendOptions, ProductPage, QuickCart).
Once patch is applied, you should not encounter any LESS file generation
restrictions when saving Pearl Theme options in your Commerce Cloud environment.