:::: MENU ::::
Monthly Archives: November 2019

PrestaShop get current user information

Today we talk about PrestaShop get current user information. In this tutorial, we focus on how to get customer information. User email, User name, User id, and other users related information.
You can get the context variable by following.

in the Controller file.

 $contextObject = $this->context;

Other files

 $contextObject = Context::getContext();

You can get the following user information using the $contextObject.

$contextObject->customer->id;
$contextObject->customer->firstname
$contextObject->customer->lastname
$contextObject->customer->email
Author: Qaisar Satti
Category: Prestashop
Last Modified: November 28, 2019


PrestaShop database configuration

Today we talk about how in PrestaShop database configuration work. Sometimes you need to edit database connection manually for moving one server to another or local server to live server. I recently find difficulty to find the database configuration. SO we focus on where the PrestaShop database connection file exists or edit from the back office. There are two ways to way to change the database configuration.

Admin Panel

Login to the back office.You can go to Preferences > Database to change the database settings

Database Configuration file in 1.6

Location of file in following directory.

config/settings.inc.php

Database Configuration in file 1.7

Location of file in following directory.

app/config/parameters.php
Author: Qaisar Satti
Category: Prestashop
Last Modified: November 28, 2019


Magento 2 call a phtml file in static block

Today we talk about how to in Magento 2 call a phtml file in static block. Calling a phtml file is no different as compared to Magento 1 calling. But if you are calling it in cms block you have to use a class instead of type.

Calling a phtml file on the static block. Just add class and template path.

My current file location for the module is.

app/code/QaisarSatti/HelloWorld/Block/HelloWorld/view/frontend/templates/helloworld.phtml

{{block class="QaisarSatti\HelloWorld\Block\HelloWorld" template="QaisarSatti_HelloWorld::helloworld.phtml"}}

My current phtml location for the theme is.

app/design/frontend/QaisarSatti/helloworld/Magneto_Theme/templates/helloworld.phtml

{{block class="QaisarSatti\HelloWorld\Block\HelloWorld" template="helloworld.phtml"}}

If you want to add phtml with general magento class. Use following code.

{{block class="Magento\Framework\View\Element\Template" template="helloworld.phtml"}}
Author: Qaisar Satti
Category: Magento 2
Last Modified: November 28, 2019