PrestaShop interview questions

PrestaShop Interview Questions

What is Prestashop?

Prestashop is a free rich featured open source e-commerce solution published under Open Software License (OSL). It allows users to create online stores.

Download PrestaShop Interview Questions PDF

Below are the list of Best PrestaShop Interview Questions and Answers

Prestashop is free rich featured open source e-commerce solution published under Open Software License (OSL).
It allows users to create online stores.It is written in the PHP programming language with support for the MySQL database management system.
Below are the list features supported Prestashop:-
  • Hundreds of Store Templates
  • Inbuilt Website Builder
  • Mobile Responsive ready
  • Support over 50 world-class payment solutions and gateways.
  • Supports for shipping Methods
  • Multilingual available in over 25 different languages
PrestaShop is based on a 3-tier architecture:
  • Object/data. Database access is controlled through files in the “classes” folder.
  • Data control. User-provided content is controlled by files in the root folder.
  • Design. All of the theme’s files are in the “themes” folder.

As on Dec 2018 1.7.4.4 is current stable version of PrestaShopwhich was released on November 6, 2018, you can download it free from its official website https://www.prestashop.com/en/download

The folder structure of the Prestashop 1.7
├── CONTRIBUTING.md
├── README.md
├── _dev
│   ├── css
│   │   └── ...
│   ├── js
│   │   └── ...
│   ├── package.json
│   └── webpack.config.js
├── assets
│   ├── css
│   │   ├── ...
│   ├── img
│   │   └── ...
│   └── js
│       └── ...
├── composer.json
├── config
│   └── theme.yml
├── modules
│   └── ...
├── plugins
│   └── ...
├── preview.png
└── templates
    ├── _partials
    │   └── ...
    ├── catalog
    │   ├── _partials
    │   │   └── ...
    │   ├── listing
    │   │   └── ...
    │   └── ...
    ├── checkout
    │   ├── _partials
    │   │   └── ...
    │   └── ...
    ├── cms
    │   ├── _partials
    │   │   └── ...
    │   └── ...
    ├── contact.tpl
    ├── customer
    │   ├── _partials
    │   │   └── ...
    │   └── ...
    ├── errors
    │   ├── ...
    │   └── static
    │       └── ...
    ├── index.tpl
    ├── layouts
    │   ├── layout-both-columns.tpl
    │   ├── layout-content-only.tpl
    │   ├── layout-error.tpl
    │   ├── layout-full-width.tpl
    │   ├── layout-left-side-column.tpl
    │   └── layout-right-side-column.tpl
    ├── page.tpl
    └── wrapper.tpl
Source: http://developers.prestashop.com/themes/gettingstarted/index.html
Prestashop Modules are small programs that make use of PrestaShop’s functionality and changes them or add to them in order to make PrestaShop easier to use or more customized.All modules in Prestashop are located in modules folder of the application.
In PrestaShop, all table names must begin with the PrestaShop “_DB_PREFIX_” prefix.They must be singular and have the same name as the object they reflect.
In Prestashop basically, two types of modules are present. They are
  • Fronted Modules
  • Backend Modules

Also Read  PHP Interview Questions

To enable multistore mode in Prestashop. Please follow below steps
  1. Log-in to your shop’s administration.
  2. Go to the "Preferences" menu and select the "General" page.
  3. Find the "Enable multistore" option, select "Yes".
  4. Save your changes.
Steps to install a Module in Prestashop:-
  1. In the modules tab, click on add a new module
  2. If a file of the module exists online, specify its URL in the Module URL field and then click on Download this module
  3. If the file is on your computer, click on Browse to open the dialogue box letting you search your computer, select the file then validate the dialogue box.
  4. Finally click on Upload this module.
  5. If the following error message appears:
    Error message
    This means that the PHP extension php_zip is not installed on your server. You will need to install it or have it installed by your web host.
  6. If the installation is successful, the following message will appear:
    Success message
    The module will then appear in your list of modules under the Module tab.
  7. Click on the install button to install the module.
    Install module
  8. If the Configuration note appears in the module insert, click on it to configure it.
    Configure module

Source:- https://addons.prestashop.com/en/content/21-how-to

Hooks are a way to associate your code to some specific PrestaShop events.Most of the time, they are used to insert content in a page.Hooks can also be used to perform specific actions under certain circumstances (i.e. sending an e-mail to the client).

To know more about Prestashop hooks visit http://build.prestashop.com/news/new-updated-hooks-1-7-1-0/

There are four Payment Option types supported by Prestashop they are
  • Offline
  • External
  • Embedded
  • Iframe

$this->context->customer->isLogged() method is used to check user is logged in or not in PrestaShop.

$smarty.server.REQUEST_URI is used to get the URL of the current page in Prestashop using smarty.

For read, remove a key/value from Cookie, you can use key/value as a property of cookie object for example: echo $cookie->key1; for read and $cookie->key1 = null for remove. And for write you can use: $cookie->write();

To create your own hook in Prestashop you can follow the given steps:

  • Go to Theme directory / config / theme.yml file and find the block “hooks”
  •  Inside the hooks block add     

           custom_hooks:

                   - name: yourCustomHookName

          title: yourCustomHookName

          description: Adds Block before the footer block

  • Now, you need to place hook in the template file. For example, Go to : Theme directory > templates > _partials > footer.tpl
  • Now add the custom hook : {hook h='yourCustomHookName'}

The steps to create a payment module for PrestaShop 1.7 are:

  • Declaring a new module.
  • Adding an icon to the module.
  • Installing the module.
  • Working with hooks.
  • Creating a validation controller.