Prestashop How-to for Developers
By Gediminas Šukys for Shoppers Team

Start working on PS project, for Shoppers Team Members

Ask for full PrestaShop project .zip file. Download and install it on your Local Machine. 
Look into This Project bitbucket repository, for database export file - project_db.sql which has to be in the root folder of the project. If there is no, or it is old - please ask me.
To work on localhost change DB table “ps_shop_url”, change both domains to “localhost”, then folder from “/”, to your folder where your app is, example “http://localhost/presta_juneta”, then folder will be “/presta_juneta/”.
To turn of SSl check for DB table “ps_configuration”, find for name “PS_SSL_ENABLED” set to 0, then search for “PS_SSL_ENABLED_EVERYWHERE” set to 0.
When project has started on your Local PHP server - go to it’s folder and do “git pull”. If there is some conflicts, do hard “git pull” to overwrite local changes:
https://stackoverflow.com/questions/1125968/how-do-i-force-git-pull-to-overwrite-local-files 



Editing Classic Theme, 
Creating New Themes
How to find some part of the Website in PrestaShop files?
Use search function in /prestashop-app/ folder, search for some kind of keyword, div class, title, html code or anything to find where it has been places in files.
Or you can go directly to /prestashop-app/themes/your-theme/templates/ and look for files where it can be logically found.
When you open *.tpl file which generates code, it might be that you will see NOT all code in that file, but only few parts. In this case you need to look for Template Which Is Included in that part OR Module Which Is Included.
If you see the line {include file='catalog/_partials/product-activation.tpl'} it means there is additional code of this template.
If you see the line {hook h='displayAfterBodyOpeningTag'} it means you should open /prestashop-app/themes/your-theme/config/theme.yml and look for that Hook. Once you find it, you will see it renders, like an example, these models: ps_emailsubscription and ps_socialfollow. To find these models you should go to:
Open Modules of This Theme /prestashop-app/theme/your-theme/modules and look for ps_emailsubscription, then look for *.tpl files in it
If you can’t find there, look for General Modules in /prestashop-app/modules, then look for *.tpl files in it.
Make pagination products per page
https://stackoverflow.com/questions/46500861/prestashop-1-7-products-per-page-dropdown-list-in-category 
Main Template File
/web/presta_techno2/themes/presta_techno2/templates/layouts/layout-both-columns.tpl

Landing page template File
/web/presta_techno2/themes/presta_techno2/templates/index.tpl

DisplayTop Changing, Search field:
/web/presta_rogirda/themes/rogirda/modules/ps_searchbar/ps_searchbar.tpl

DisplayTop Changing, MENU part field:
/web/presta_rogirda/themes/rogirda/modules/ps_mainmenu/ps_mainmenu.tpl

What displayTop hook brings to the Top you can select in:
Back-office: Design>Positions
/web/presta_rogirda/themes/rogirda/config/theme.yml

Upload limits, 2mb for photos and etc.:
Advanced Parameters -> Administration -> Upload Quota
All file structure with provided what is required.
https://belvg.com/blog/prestashop-1-7-templates-file-structure.html 

Assets Management. Files by priority.
https://devdocs.prestashop.com/1.7/themes/getting-started/asset-management/ 

Managing header menu:
Open homepage design tab on “Design>Theme&Logo”, select menu area

Footer links edit:
Module “Link Widget”. Or go to “Išvaizda > Link Widget”

Turn off SSL
In Database Table ps_configuration, values PS_SSL_ENABLED and PS_SSL_ENABLED_EVERYWHERE 

Turn of Caching




Classic Theme Files
Assets
Config
Modules
Plugins
Templates
    _partials
    Catalog
    Checkout
    Cms
    Customer
    Errors
    Layouts
    Contact.tpl    
    Index.tpl
    Page.tpl


Changing Back-office 
Changing Products Listing:
src/PrestaShopBundle/Controller/Admin/ProductController.php 
src/PrestaShopBundle/Resources/views/Admin/Product/CatalogPage/Lists/list.html.twig 

Mantas commit for Technoratas Tire parameters:
https://bitbucket.org/shopperslt/presta_techno2/commits/dd049153af92a84a4635230e4842d73f8d818e03 
CSS by PS standard, building _dev
Install npm to folder /theme/_dev. Get folder from:
/web/presta_example/themes/classic/_dev 
Go to that folder via Bash:
Cd /web/bybodesign.se/themes/bybodesign/_dev
Install npm:
npm install
When changing some scss, build css:
npm run build
Watch
npm run watch
Nice tutorial for this
https://belvg.com/blog/how-to-create-a-theme-for-prestashop-1-7.html 

Setup on NGINX server
Chmod
directories: 755
files: 644
Problem with connecting MySQL?
Something caches parameters. Even if error shows different user name, but still connection goes wrong. In the morning everything is OK. - delete dirs /var/cache/*
Once configuration is OK, be aware of changing URL, because even MYSQL Credentials will be good, there will be same error page but with different URL.
Set     'database_host' => 'localhost',

Modules for NGINX
apt install php-fpm php-mysql php7.2-xml php7.2-intl php7.2-mbstring
Problem with Back-office half pages not working:
https://gitmemory.com/issue/PrestaShop/PrestaShop/15864/539903661 
Spredimas yra šiame nginx confige (admin dalies rewrite):
https://raw.githubusercontent.com/PrestaShop/PrestaShop/develop/docs/docker/nginx_fpm/prestashop-nginx/prestashop-nginx.conf 
Pasiredaguoti reikia dvi vietas:
admin dalies rewrite ir fastcgi_pass pathą iki savo php-fpm:
fastcgi_pass unix:/run/php/php7.2-fpm.sock;

MODULES
Lietuviški moduliai
https://elpresta.eu/en/prestashop-modules 
Change left menu categories view:
"Category tree links" module in Back-office
Show blocks of categories in homepages - with photos and descriptions. Tested.
https://prestashop.modulez.ru/en/frontend-features/31-categories-on-the-homepage.html?utm_source=prestashop.com&utm_medium=organic&utm_campaign=forum-starting-topic&utm_content=buy-link&utm_term=homecategoriez 

Show subcategories blocks in current category content area:
https://mypresta.eu/prestashop-17/display-available-subcategories.html 
Software for mass products management:
https://l.facebook.com/l.php?u=https%3A%2F%2Fstore.emagicone.com%2Fstore-manager-for-prestashop-pro-edition-bundle.html%3Faw_affiliate%3DeyJjYW1wYWlnbl9pZCI6IjEiLCJ0cmFmZmljX3NvdXJjZSI6Im5vX3NvdXJjZSIsImFjY291bnRfaWQiOjg1fQ%26fbclid%3DIwAR0aw58rhZffiz34LRX-Pjy8VxYYwAcdEGkR4ssRvsRFQHdCp5eBft6gjEg&h=AT0bDXnRNkQnmKxSzGZW24-Kdr8gTLJ62UZAgFErIoDuXtxnHCseJ0FOVsqcyYvBvI6q2KHWRND5Ciy36aH2wxXMVlSoIYooMzHW6cLgpRqOrBLLrGp72krQWGCNTRGf-qhSydcis3M 

CHECKOUT, CART
Checkout, privacy, terms, gdpr

Find ps_dataprivacy module in modules page and turn of/edit
Turn on GDPR to make custom text there with links as in https://gemisense.com 

Best practice is here:

Customer Address Fields Edit:


Post_code format for Lithuania: LL-NNNNN


COD title edit. “Atsiskaityti už prekes kurjeriui….”
Change this in:
BO -> Vertimai -> Moduliai > codwfeeplus >


“Atsiskaitymas kurjeriui kortele : +1,50 €  (užsakymą apmokėsite tik kurjeriui pristačius prekes)”
Change this in:
“/web/presta_juneta/modules/codwfeeplus/translations/lt.php”


Visos paskutinės antraštės yra angliškoje vertimų versijoje, juos galima perkopijuot į lt.php ir pakeisti reikšmes.
“/web/presta_juneta/modules/codwfeeplus/translations/lt.php”
Path of this modal -> app/themes/presta_techno2/modules/ps_shoppingcart/modal.tpl


Make Phone Field Required:
BO > Customers > Addresses > bottom of the page has button which defines required fields
Remove Social Titles
https://www.sunnytoo.com/7855/remove-social-title-mr-mrs-date-birth-registration 

Removing Birth Date:
Titles can be changed in. Maybe also turned off.
Parduotuves nustatymai -> Klientu nustatymai
Translate “I agree to the terms and conditions and the privacy policy” english phrase
BO > Go directly to GDPR module > Consest checkbox customisation

Here:
Pakeisti tą patį visose keturiose langeliuose, nes kitus du rodo prie užklausos formos


Changing “Mokėti čekiu”:


Adding all bank details to the final step of the CHECKOUT:

Here


OTHER
Change Mail Alerts in:
Back-Office->International>Translations>Email Translation>Body>YourTheme>YourLanguage
Email template not changing
Please comment mail dir in theme dir

Select which events send via email:
nustatymai-uzsakymai-busenos
Translations files is at:
app/Resources/translations/lt-LT/
Path of App on Localhost:

Even if localhost working on 127.0.0.1
Get Version of Prestashop:
line 34 of app/AppKernel.php 
Can’t connect to mysql even if credentials are ok
/web/presta_rogirda/var/cache/dev/appParameters.php - change params here, they are cached
/var/cache  - prod and dev folder can be renamed, PrestaShop will create new ones
Sending email after client purchase:
back-office > Modules > Module Catalog > Mail Alerts
Also informs about out of stock, order edit and etc.
Limiting ps_mainmenu depth:
http://nemops.com/prestashop-top-menu-limit-subcategories/#.XlTejUOxXok 
AKCIJOS on homepage 
Use Featured Products (Populiariausios prekes) free module
Path: ps_featuredproducts
* works on https://Juneta.lt in this way)
NAUJIENOS on homepage
Use Featured Category module (works on https://Juneta.lt in this way)
If thumbnails dissapears:
Shop Parms-->seo & urls-->scroll down-->disable friendly url, if already disableD then enable---->click save 

Check logged user details in Front-office:
{if $customer.is_logged}
    {$customer.id}
    {$customer.firstname}
    {$customer.lastname}
    {$customer.email}
{/if}

Clear Cache Manually:
/var/cache  - prod and dev folder can be renamed, PrestaShop will create new ones

img/tmp
cache/smarty/cache
cache/smarty/compile

/cache/cachefs/
/themes/your_theme/cache/
Change url of Shop:
Change in table “ps_shop_url”
Change in .htaccess
Turn on filters in categories:
Module: “Faceted search”, lithuanian title “Filtrai”
Debug on/off:
In file config/defines.inc.php
define('_PS_MODE_DEV_', true);

LINKS
Official PrestaShop Forum
https://www.prestashop.com/forums/ 

Most Recommends to create new theme from Classic theme:
http://prestacraft.com/creating-your-own-theme-for-prestashop-1-7-beginner-guide/# 

Directory structure:
https://devdocs.prestashop.com/1.7/themes/reference/templates/templates-layouts/?_ga=2.126260877.1676841807.1573222972-2017786882.1569874967 

Free themes:
https://www.prestashop.com/forums/topic/994771-free-prestashop-themes-17-list/ 

Product page hooks:
https://www.hiddentechies.com/blog/prestashop/list-of-hooks-product-page-prestashop/ 

Bought Themes

Optima Theme Decor [Original, unchanged, never], Jewellery themes with content installation
http://localhost/pos_optima2/ 
http://localhost/pos_optima2/admin6176tp6bi  
User: demo@posthemes.com / admin123
Db: pos_optima

Optima Theme Decor - ByBoDesign Start, Jewellery themes with content installation
http://localhost/bybodesign.se/  
http://localhost/bybodesign.se/admin6176tp6bi   
User: demo@posthemes.com / admin123
Db: pos_optima
PrestaShop Categories Import:
First line is for providing categories
Parent categories has to be importet first
Improvements for Import:
Please add refresh button - I edit CSV on error and it would be super nice to have refresh, becaue all the time I have to adjust all 10 fields for importing, options and etc. It goes for tens and sometimes hundreads of times… This would improve user experience enourmously…
CSV on import isn’t checked completely what makes endless repeats on every fix until all forbiden characters are removed from all kind of fields. This takes so much time. It would be cool to have completely checked documment and all errors list to not repeat all process again and again while getting first 1 or 2 errors…
Providing column names doesn’t work. Even if they are providing they doesn’t fit with selection boxes on importing interface.

Developers

RIVILE Developers
https://www.facebook.com/simjank86
Galetų pakodinti modulius, siūlėsi Rivilės
https://www.facebook.com/ricardasSmaizys
PrestaShop CEO. Riviles modulis 450eur
https://www.facebook.com/andrius.misiukas
500-600eur Rivile.


Smarty

You can access to this variables in your TPL files
https://catalogo-onlinersi.net/en/content/33-prestashop-17-global-variables 

{print_r($smarty.server)}
Array
(
    [REDIRECT_REWRITEBASE] => /presta_techno2/
    [REDIRECT_HTTP_MOD_REWRITE] => On
    [REDIRECT_STATUS] => 200
    [REWRITEBASE] => /presta_techno2/
    [HTTP_MOD_REWRITE] => On
    [HTTP_HOST] => localhost
    [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:75.0) Gecko/20100101 Firefox/75.0
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_CONNECTION] => keep-alive
    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
    [HTTP_PRAGMA] => no-cache
    [HTTP_CACHE_CONTROL] => no-cache
    [PATH] => /usr/bin:/bin:/usr/sbin:/sbin
    [SERVER_SIGNATURE] => 
    [SERVER_SOFTWARE] => Apache/2.2.34 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.2.14 mod_ssl/2.2.34 OpenSSL/1.0.2o DAV/2 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.9 Perl/v5.24.0
    [SERVER_NAME] => localhost
    [SERVER_ADDR] => ::1
    [SERVER_PORT] => 80
    [REMOTE_ADDR] => ::1
    [DOCUMENT_ROOT] => /web
    [SERVER_ADMIN] => you@example.com
    [SCRIPT_FILENAME] => /web/presta_techno2/index.php
    [REMOTE_PORT] => 54528
    [REDIRECT_QUERY_STRING] => back=history
    [REDIRECT_URL] => /presta_techno2/lt/prisijungimas
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => back=history
    [REQUEST_URI] => /presta_techno2/lt/prisijungimas?back=history
    [SCRIPT_NAME] => /presta_techno2/index.php
    [PHP_SELF] => /presta_techno2/index.php
    [REQUEST_TIME_FLOAT] => 1587573728.086
    [REQUEST_TIME] => 1587573728
    [argv] => Array
        (
            [0] => back=history
        )

    [argc] => 1
)


PrestaShop professionals
Darius Dvilinskas
25eur/val+PVM
10years, since 1.3 Prestashop experience

https://webdevelopers.lt 



PrestaShop Back-End
Dominykas Zazimka 10/10
25eur/h
Prof 10/10
https://www.facebook.com/esnyper

Iš prestos, tai turiu side job'ą vienoj įmonėj, dirbu prie tokių projektų kaip: 
creolink.lt, balticsofa.com
---
paskutiniu metu aš dirbu prie vieno projekto:
coinspace.com
Datos rinkimas, agregavimas, saugojimas. Infrastruktūrą sudaro 8 servai iš jų 4 data, tai čia +/- suprast apimtį. 
---
Dirbęs su tecdoc
Mantas Pudžiavis
Back-End, little Front-End (not clean html)
10eur/hour
mpudziavis@gmail.com


Aš pats turiu patirties su Opencart, Oxid (jeigu teko girdėti), Sylius ir dabar pradedu vėl su Prestashop dirbti. Seniau teke yra dirbti, bet dėl kitų sistemų, buvau apstojas
--
Dabar baiginėju atnaujinimus su www.fightershopkaunas.lt
Keičiau dizainą, importai visokie darėsi iš partnerių ir pan. Dar kol kas ne viską pasibaigiau. 
Bet čia opencart sistema. 
Aš šiaip dar įmonėje dirbu ir papildomai individualiai dirbu, mūsų įmonė pagrinde prie el. parduotuvių dirba, ganėtinai dideli projektai. Bet nelabai noriu juos reklamuoti nes ne viską pats dariau. :)
Tomas Marčiulionis
25/val.
https://www.facebook.com/ventuke 

Sveikas, jeigu nėra degantys, atrasčiau laiko, bet tikrai ne artmiausiu metu. 
Toma Nom
10eur/val bet dar nemoka PrestaShop



Simas Jankunas
https://www.facebook.com/simjank86
30eur/val
Sudėtingi darbai: XML integracijos, pristatymo mobuliai, buhalterinės integracijos - dirba pateikus specifikaciją. Kuria individualius modelius.
Priima manau 200+eur užsakymus
--
Apsiimtų visą shopą pagal specifikaciją
https://www.facebook.com/rimantas.balke
paklausti



