Skip to content

Instantly share code, notes, and snippets.

@anavdesign
Last active July 15, 2023 16:04
Show Gist options
  • Save anavdesign/7d460ad8a8335e9787a1128def877c34 to your computer and use it in GitHub Desktop.
Save anavdesign/7d460ad8a8335e9787a1128def877c34 to your computer and use it in GitHub Desktop.
Drupal: Commerce eStore Installation

Drupal Commerce eStore Installation

Resources

Drupal

Drush

eStore Theme

Bootstrap 3

Drupal Commerce Kickstart Install

  1. Drupal Commerce Installer

    Configure and Download Drupal Commerce Installer

  2. Move Installer

    Rename installer drupal and move into project folder

  3. Composer Install

    Run Composer Install

    $ cd drupal
    $ composer install
    
  4. Create Symbolic Link to Site Directory

    cd ../ && ln -s drupal/web/ www
    

Install Libraries

  1. Webform

    https://www.drupal.org/node/3003140

    Edit the composer.json file of your website and under the extra: { section add:

    "merge-plugin": {
        "include": [
            "web/modules/contrib/webform/composer.libraries.json"
        ]
    }
    
  2. StackTable.js

    Edit the composer.json file of your website and under the repositories: { section add:

    "stacktable": {
        "type": "package",
        "package": {
            "type": "drupal-library",
            "name": "johnpolacek/stacktable.js",
            "version": "1.0.3",
            "source": {
                "url": "https://github.com/johnpolacek/stacktable.js.git",
                "type": "git",
                "reference": "1.0.3"
            }
        }
    }
    
  3. Bootstrap

    Download the Bootstrap library and extract in into the /libraries/bootstrap folder.

Contributed Modules

  1. Required Modules

    composer require drupal/fontawesome;
    composer require drupal/commerce_wishlist;
    composer require drupal/views_bootstrap;
    composer require drupal/webform;
    composer require johnpolacek/stacktable.js;
    composer require wikimedia/composer-merge-plugin;
    
  2. Download Webform Libraries

    Run composer update to download webform libraries

    composer update;
    
  3. Recommended Modules

    composer require drupal/betterlogin;
    composer require drupal/block_class;
    composer require drupal/bootstrap_layouts;
    composer require drupal/coffee;
    composer require drupal/colorbox;
    composer require drupal/estore;
    composer require drupal/eu_cookie_compliance;
    composer require drupal/features;
    composer require drupal/filefield_paths;
    composer require drupal/google_analytics;
    composer require drupal/google_analytics_reports;
    composer require drupal/honeypot;
    composer require drupal/image_url_formatter;
    composer require drupal/metatag;
    composer require drupal/module_filter;
    composer require drupal/page_manager;
    composer require drupal/panels;
    composer require drupal/paragraphs;
    composer require drupal/pathauto;
    composer require drupal/redirect;
    composer require drupal/responsive_favicons;
    composer require drupal/token_filter;
    composer require drupal/token_custom;
    composer require drupal/xmlsitemap;
    composer require drupal/yoast_seo;
    

Site Install

  1. CD Drupal Root

    cd drupal/web/
    
  2. Drush Site Install

    Drush Site Install Command

    drush si commerce_base --db-url=mysql://root:root@127.0.0.1/SITENAME_loc --account-mail="noreply@email.com" --account-name=admin --account-pass=admin --site-mail="noreply@email.com" --site-name="SITE NAME" -y
    

Drupal Permissions

Drupal Files and Directory Permissions

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 444 .htaccess;
chmod 555 sites/default/;
chmod 744 sites/default/settings.php;
find sites/default/files -type d -exec chmod 775 {} \;
find sites/default/files -type f -exec chmod 644 {} \;

Drupal Settings

Enable Public and Private files directory in sites/default/settings.php

# Public file path:
$settings['file_public_path'] = 'sites/default/files';

# Private file path
$settings['file_private_path'] = 'sites/default/files/private';

Enable eStore Theme

  1. Enable Bootstrap Theme

    Enable and Set Bootstrap theme as default at /admin/appearance

  2. Enable Required Modules

    Drush Enable Command

    drush en admin_toolbar_tools -y;
    drush en coffee -y;
    drush en commerce_wishlist -y;
    drush en block_class -y;
    drush en bootstrap_layouts -y;
    drush en colorbox -y;
    drush en eu_cookie_compliance -y;
    drush en filefield_paths -y;
    drush en fontawesome -y;
    drush en honeypot -y;
    drush en image_url_formatter -y;
    drush en metatag -y;
    drush en module_filter -y;
    drush en page_manager page_manager_ui -y;
    drush en panels panels_ipe -y;
    drush en paragraphs -y;
    drush en pathauto -y;
    drush en redirect redirect_404 -y;
    drush en responsive_favicons -y;
    drush en token_filter -y;
    drush en token_custom -y;
    drush en views_bootstrap -y;
    drush en webform -y;
    drush en webform_bootstrap webform_node webform_ui -y;
    drush en xmlsitemap -y;
    drush en yoast_seo -y;
    
  3. Enable eStore Theme

    Enable and Set estore theme as default at /admin/appearance

  4. Enable Optional Modules

    drush en betterlogin -y;
    drush en features -y;
    drush en google_analytics -y;
    drush en google_analytics_reports -y;
    
  5. Enable Homepage

    1. Go to the Modules list page (/admin/modules) and enable the "eStore homepage feature" this module will provide a homepage (/home).

    2. Set front page path to (/home) at (/admin/config/system/site-information)

  6. Configure Store

  7. Configure Product Type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment