Graph-IT

The onlineshop database

Installation

Create the project (onlineshopDir should have enough space to store downloads, resources and other data that might be needed for the shop).

composer create-project -s dev screwerk/onlineshop <onlineshopDir>

Update apache.conf

Alias / "<onlineshopDir>/web"
  <Directory "<onlineshopDir>/web">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    require all granted
  </Directory>

Configure .example Files

General configuration

Copy examples and Customize configuration files

cp web/.htaccess.example web/.htaccess
cp conf/config.json.example conf/config.json

Add paymentUser shop-ID in the config file and in the Payment-API service

ssh web01.hsrobotics.com
nano /home/screwerkde/httpd/payment-api/config/services.json

Add destination path for shop-ID to push-scripts

bin/push_order.php.example
bin/push_application.php.example

The destination path should be supervised by an incron.d entry which calls a script to collect the data and write it to the corresponding database. (see section incron.d)

Add initial id for orders

cp var/order/id.example var/order/id

Change file permissions for id and lock - file

cd var
chmod go+w applications
chmod go+w order
chmod go+w order/id
chmod go+w order/lock
chmod go+w order/tmp

Change file permissions for twig-template caching and translation caching

cd var
chmod go+w twig-cache
chmod go+w trans-cache

Directory structure

xliffpath var/locales

.xlf Translations for all possible locales are stored in

var/locales/<locale>/<file>.<locale>.xlf

Example files are included.

Make sure that the destination path for the specific shopid is added in the push-script (if the translations should be pushed by the graph.graph-it.com ameise-module)

ssh graph.graph-it.com
cd /var/lib/graph/module/ameise/bin
nano push_translations.php

See section incron.d for translation cache clearance if a translation domain file in var/locales/ is updated.

datapath var/shopdaten-example

Data to run the shopgrid and website is stored in a tree structure built like

var/shopdaten-example

The directory is subdevided into different levels to control the update frequency

var/shopdaten-example/10-statisch
var/shopdaten-example/40-dynamisch

The subtree-structure is identical.

artikelkategorie/<kategorie>/artikelkategorie.json
artikelkategorie/<kategorie>/artikelkategorie.sqlite3
artikelkategorie/<kategorie>/<kategorietyp>/kategorietyp.json
artikelkategorie/<kategorie>/<kategorietyp>/<artikelname>/artikel.json

Data is merged for all levels in alphanumerical ascending order. Example files are included. Grid content for the shop is stored in an SQLite3 database which contains a

  1. table grid with n columns whereas the entries are keys
  2. table for every column. The columns are the key intent in every supported language

Make sure that the destination path for the specific shopid is added in the push-script (if the data should be pushed by web01.hsrobotics.com graph onlineshop-module) e.g. screwerk.de graph

ssh web01.hsrobotics.com
cd /home/screwerkde/graph/module/onlineshop/bin
nano push_shopdaten10.php
nano push_shopdaten40.php

downloadpath var/downloads-example

Download-data is stored in a tree structure built like

var/downloads-example

The directory contains language independent 3D data files and directories for each possible locale which contain .pdf download files. Example files are included.

Content/Configuration to run Website/Onlineshop

Onlineshop Configuration

Add configuration of your onlineshop in a json-file structured like the example

var/shopdaten-example/10-statisch/onlineshop.json.example

Individual templates for Google Adwords

Configure the files

cp views/google_tag_manager.html.example views/shopid/<shopid>-google_tag_manager.html
cp views/google_tag_manager_warenkorb.html.twig.example views/shopid/<shopid>-google_tag_manager_warenkorb.html.twig

or disable google tag management in the appropriate templates

views/layout.html.twig
views/shop_cart_payment.html.twig

Set your intern IPs which should be ignored by Google Analytics

cp views/set_internal_js_var.html.twig.example views/shopid/<shopid>-set_internal_js_var.html.twig

Customize the Website

Menu

Main menu

Configure the main menu by adding custom menu and submenu points as exemplified in views/menuepunkt.html.twig to the menu file

cp views/menuepunkt.html.twig views/shopid/<shopid>-hauptmenue.html.twig

Footer menu

Configure the footer menu by adding menu points to the three columns of the footer and the copyright-file

cp views/footer_col_left.html.twig views/shopid/<shopid>-footer_col_left.html.twig
cp views/footer_col_mid.html.twig views/shopid/<shopid>-footer_col_mid.html.twig
cp views/footer_col_right.html.twig views/shopid/<shopid>-footer_col_right.html.twig
cp views/footer-copyright.html.twig views/shopid/<shopid>-footer_copyright.html.twig

Data sections

Index

Configure the Index page content by customizing meta information, slider content and panels

cp views/index_meta.html.twig views/shopid/<shopid>-index_meta.html.twig 
cp views/slider.html.twig views/shopid/<shopid>-slider.html.twig
cp views/panel_list.html.twig views/shopid/<shopid>-panel_list.html.twig

Add a maximum of 3 slider background images in a format like bg-slider-default.jpg or copy default

cd web-src/Widgets/Slider
cp bg-slider-default.jpg bg-slider-1.jpg
cp bg-slider-default.jpg bg-slider-2.jpg
cp bg-slider-default.jpg bg-slider-3.jpg
cp bg-slider-default.jpg bg-slider-unternehmen.jpg

Make sure to adjust the slider-template.

General Terms and Conditions

Add custom general terms and conditions by inserting the content as exemplified in grid_skel_content.html.twig

cp views/grid_skel_content.html.twig views/shopid/<shopid>-agb.html.twig

Delivery

Add custom delivery information by inserting the content as exemplified in grid_skel_content.html.twig

cp views/grid_skel_content.html.twig views/shopid/<shopid>-delivery.html.twig

Impressum

Add custom delivery information by inserting the content as exemplified in grid_skel_content.html.twig

cp views/grid_skel_content.html.twig views/shopid/<shopid>-impressum.html.twig

Data Protection

Add custom data protection information by inserting the content as exemplified in grid_skel_content.html.twig

cp views/grid_skel_content.html.twig views/shopid/<shopid>-datenschutz.html.twig

Sitemap

Configure the sitemap by adding custom chapters for the site content

cp views/sitemap_content.html.twig views/shopid/<shopid>-sitemap_content.html.twig

Contact-Address

Add the individual contact address, e.g. by inserting a trans-tag to the template

cp views/div_adress.html.twig views/shopid/<shopid>-address.html.twig

{% trans from '<shopid>' %}contact.address{% endtrans %}

Run webpack to enable js

cd web-src
npm install
npm run build

Configure incron.d

Create a file for incron.d

/etc/incron.d/website_<shopid>

and add an appropriate entry for an automatic push of applications and orders of the website

<ShopSrcDir>/var/order IN_CLOSE_WRITE <ShopSourceDirectory>/bin/push_order.php <shopid> $@ $#
<ShopSrcDir>/var/applications IN_CLOSE_WRITE <ShopSourceDirectory>/bin/push_application.php <shopid> $@ $#

Add an appropriate entry for each language to monitor translation directory

<ShopSrcDir>/var/locales/<locale> IN_MODIFY,IN_MOVED_TO <ShopSrcDir>/bin/TranslationCacheClear.php $@ $#

In addition, the destination path should be monitored by incron.de to process incoming data in the sense of your application. Create a file for incron.d

/etc/incron.d/website_<shopid>

and add an appropriate entry for an automatic processing of the data with .

<DestDir> IN_MOVED_TO <DestProcessingScript> $@ $#