Documentation is now live! Read | Stay in the loop with Lightna updates - Keep me updated
|||
Content

Magento Setup for Contribution

System Requirements

  • Ubuntu or macOS
  • PHP 8.1, 8.2, or 8.3
  • Required PHP extensions: pdo, yaml, redis, ctype

Setup Magento Project

You need to have a working Magento project before plugging Lightna into it. Set up it into project/magento-os folder

Set developer mode and allow symlinks

php bin/magento deploy:mode:set developer
php bin/magento config:set dev/template/allow_symlink 1

Install Packages

cd entry/magento-os && \
make install && \
cd ../..

Symlink Modules and Themes to Magento

export magentoAppDir=`realpath project/magento-os/app` && \
export lightnaModulesDir=`realpath code` && \
mkdir -p $magentoAppDir/code/Lightna && \
mkdir -p $magentoAppDir/design/frontend/Lightna && \
ln -sf $lightnaModulesDir/magento/lightna-frontend $magentoAppDir/code/Lightna/Frontend && \
ln -sf $lightnaModulesDir/magento/lightna-demo $magentoAppDir/code/Lightna/Demo && \
ln -sf $lightnaModulesDir/magento/lightna-theme $magentoAppDir/design/frontend/Lightna/Lightna && \
ln -sf $lightnaModulesDir/magento/lightna-lane-theme $magentoAppDir/design/frontend/Lightna/Lane

Enable Lightna Rendering

mv project/magento-os/pub/index.php project/magento-os/pub/magento_index.php && \
ln -sf ../../../entry/magento-os/index.php project/magento-os/pub/index.php

Setup lightna_entry in Magento

Create the Lightna configuration file in Magento at project/magento-os/app/etc/lightna.php with the following content:

<?php
 
return [
// Specify the correct path to the Lightna entry folder
'lightna_entry' => __DIR__ . '/../../../../entry/magento-os',
];

Enable Lightna Theme and Module

php project/magento-os/bin/magento setup:upgrade, then change the current Magento theme to Lightna

Configure Lightna

  • Copy the env.php file from the Lightna magento-pack to the Magento project:
    cp code/lightna/magento-pack/entry/edition/main/env.php entry/magento-os/edition/main/env.php
  • Edit entry/magento-os/env.php, follow the comments to verify and finish the configuration. Make sure there is no **** left in the files after edits.
  • Ensure Elasticsearch and session settings match the Magento setup. Check Integrating Lightna into a Magento Project for details.

Build & Reindex

cd entry/magento-os && \
make build && \
make schema.update && \
./cli index.update.all

Setup Lightna Indexer Cron Job

* * * * * { cd [lightna_entry_path] && ./cli index.queue.watch; } 2>&1 >> [logs_path]/lightna-index.log

⚙️  Documentation Review

Noticed an issue or need more details? Submit your feedback for this page.
Leave a Feedback