SlideShare a Scribd company logo
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
29/05/2015
Ecommerce Meetup
6 April 2018
Nayabazar, Kathmandu
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
2
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
3PrestaShop Introduction
▪ PrestaShop is a free, open source e-commerce
content management solution.
▪ Used by more than 250,000 e-commerce shops
worldwide
▪ Available in 60 different languages.
▪ Current version 1.7.x
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
4
PrestaShop 1.7
Improve the UX in the back-office
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
5
PrestaShop 1.7
Stay up to date!
Check regularly
http://build.prestashop.com/
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
29/05/2015
PrestaShop Modules
Introduction
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
7
PrestaShop Modules
▪ 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.
▪ Consists of a main PHP file other PHP supporting files as needed, and all
the necessary contents including images, JavaScript and template (.tpl)
files necessary to display the information.
▪ PrestaShop's modules are found in the /modules folder, which is at the
root of the PrestaShop main folder.
▪ Modules can also be part of a theme if they are really specific to it. In
that case, they would be in the theme's own /modules folder, and
therefore under the following path: /themes/[my-theme]/modules
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
8
PrestaShop File Structure
▪ 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.
▪ Consists of a main PHP file other PHP supporting files as needed, and all the
necessary contents including images, JavaScript and template (.tpl) files
necessary to display the information.
▪ Let's see an example with PrestaShop's blockuserinfo module:
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
9
PrestaShop Modules
▪ Let's see an example with PrestaShop's blocktopmenu module:
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
10
PrestaShop Modules: files and folders organization for a PrestaShop 1.6 module
▪ 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.
▪ Consists of a main PHP file other PHP supporting files as needed, and all the
necessary contents including images, JavaScript and template (.tpl) files
necessary to display the information.
▪ PrestaShop's modules are found in the /modules folder, which is at the root of
the PrestaShop main folder.
▪ Modules can also be part of a theme if they are really specific to it. In that case,
they would be in the theme's own /modules folder, and therefore under the
following path: /themes/[my-theme]/modules
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
11
Module Development
▪ Let's create a simple first module; this will enable us to better describe its
structure. We will name it "My module".
▪ First, create the module's folder, in the /modules folder. It should have the same
name as the module, with no space, only alphanumerical characters, the hyphen
and the underscore, all in lowercase: /mymodule.
▪ This folder must contain the main file, a PHP file of the same name as the folder,
which will handle most of the processing: mymodule.php.
That is enough for a very basic module, but obviously more files and folders can be
added later.
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
12
Module Development
▪ The main mymodule.php file must start with the following test:
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
▪ Next task is to create our main class extending Module parent class
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
13
Module Development: The main class
▪ The main file must contain the module's main class (along with other classes if
needed). PrestaShop uses Object-Oriented programming, and so do its modules.
▪ That class must bear the same name as the module and its folder, in CamelCase
(see http://en.wikipedia.org/wiki/CamelCase).
In our example: MyModule.
▪ Furthermore, that class must extend the Module class, in order to inherit all its
methods and attributes.
class MyModule extends Module
{
…………………
…………………………………
………………………………..
}
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
14
Module Development: Adding constructor method to the main class
▪ Now, let's fill the class' code block with the essential constructor lines.
▪ A constructor is a function in a class that is automatically called when you create
a new instance of a class with new.
▪ In the case of a PrestaShop, the constructor class is the first method to be called
when the module is loaded by PrestaShop.
▪ This is therefore the best place to set most of its details.
class MyModule extends Module
{
public function __construct()
{
Statements here;
}
}
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
15
Module Development: Adding constructor method to the main class
▪ The __constructor() method
public function __construct()
{
$this->name = 'mymodule';
$this->tab = 'front_office_features';
$this->version = '1.0.0';
$this->author = 'Firstname Lastname';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('My module');
$this->description = $this->l('Description of my module.');
$this->confirmUninstall = $this->l('Are you sure you want to uninstall?');
if (!Configuration::get('MYMODULE_NAME')) {
$this->warning = $this->l('No name provided');
}
}
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
16
Module Development: Adding constructor method to the main class
▪ Here tabs attribute is the title for the section that shall contain this
module in PrestaShop's back office modules list.
▪ It’s value may be one from below or you’re free to add your own tab as
well.
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
17
Module Development: Adding install and uninstall methods in main class
▪ Your module might need to perform actions on installation, such as
checking PrestaShop's settings or to registering its own settings in the
database.
▪ Likewise, if you changed things in the database on installation, it is highly
recommended to change them back (or remove them) when uninstalling
the module.
▪ The install() and uninstall() methods make it possible to control what
happens when the store administrator installs or uninstalls the module.
▪ They must be included in the main class' block of code (in our example,
the MyModule class) – at the same level as the constructor method.
public function install()
{
if (!parent::install()) {
return false;
}
return true;
}
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
18
Module Development: Adding install and uninstall methods in main class
▪ Your module might need to perform actions on uninstallation as
well, that would delete the data added to the database during the
installation
If any of the lines in the testing block fails, the method returns false and the installation does not happen.
public function uninstall()
{
if (!parent::uninstall() ||
!Configuration::deleteByName('MYMODULE_NAME')
) {
return false;
}
return true;
}
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
19
Module Development: Adding install and uninstall methods in main class
▪ Your module might need to perform actions on installation, such as
checking PrestaShop's settings or to registering its own settings in the
database.
public function install()
{
if (Shop::isFeatureActive()) {
Shop::setContext(Shop::CONTEXT_ALL);
}
if (!parent::install() ||
!$this->registerHook('leftColumn') ||
!$this->registerHook('header') ||
!Configuration::updateValue('MYMODULE_NAME', 'my friend')
) {
return false;
}
return true;
}
If any of the lines in the testing block fails, the method returns false and the installation does not happen.
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
20
Module Development: Display Content in the front office
▪ Need to take care of hooks at the time of install() method definition
To know more about hooks in PS 1.6 or 1.7, http://doc.prestashop.com/display/PS17/Hooks+in+PrestaShop+1.7.x
public function install()
{
if (Shop::isFeatureActive())
Shop::setContext(Shop::CONTEXT_ALL);
return parent::install() &&
$this->registerHook('leftColumn') &&
$this->registerHook('header') &&
Configuration::updateValue('MYMODULE_NAME', 'my
friend');
}
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
21
Module Development: Display Content in the front office
▪ Need to take care of hooks at the time of installmethod() definition
▪ Attaching code to a hook requires a specific method for each:
hookDisplayLeftColumn(): will hook code into the left column – in our case, it will fetch the MYMODULE_NAME module setting
and display the module's template file, mymodule.tpl, which must be located in the /views/templates/hook/ folder.
hookDisplayRightColumn(): will simply do the same as hookDisplayLeftColumn(), but for the right column.
hookDisplayHeader(): will add a link to the module's CSS file, /css/mymodule.css
public function hookDisplayLeftColumn($params)
{
$this->context->smarty->assign(
array(
'my_module_name' => Configuration::get('MYMODULE_NAME'),
'my_module_link' => $this->context->link->getModuleLink('mymodule', 'display')
)
);
return $this->display(__FILE__, 'mymodule.tpl');
}
public function hookDisplayRightColumn($params)
{
return $this->hookDisplayLeftColumn($params);
}
public function hookDisplayHeader()
{
$this->context->controller->addCSS($this->_path.'css/mymodule.css', 'all');
}
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
22
Module Development: Display Content in the front office
▪ Now that we have access to the left column, we should display
something there for the customer to see.
▪ The visible part of the module is defined in .tpl files placed in specific
View folders:
/views/templates/front/: front office features.
/views/templates/admin/: back office features.
/views/templates/hook/: features hooked to a PrestaShop (so can be
displayed either on the front office or the back office).
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
23
Module Development: Display Content in the front office
<!-- Block mymodule -->
<div id="mymodule_block_home" class="block">
<h4>Welcome!</h4>
<div class="block_content">
<p>Hello,
{if isset($my_module_name) && $my_module_name}
{$my_module_name}
{else}
World
{/if}
!
</p>
<ul>
<li><a href="{$my_module_link}" title="Click this link">Click me!</a></li>
</ul>
</div>
</div>
<!-- /Block mymodule -->
Here is our template file, located at /views/templates/hook/mymodule.tpl:
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
24
Module Development: Display Content in the front office
In addition to that, we’ll to create a CSS file, and save it as /css/mymodule.css in the module's folder (or any sub-folder you like
to keep you CSS in):
div#mymodule_block_home
p {
font-size: 150%;
font-style:italic;
}
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
25
Module Development: Display Content in the front office
Add display.php to register our template to current theme
File should be in /views/templates/ directory as mentioned earlier
<?php
class mymoduledisplayModuleFrontController extends ModuleFrontController
{
public function initContent()
{
parent::initContent();
$this->setTemplate('display.tpl');
}
}
For this we need to create display.tpl file that we passed as parameter above. Show some message such as ‘Welcome to my module’
there.
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
29/05/2015
DEMO
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
29/05/2015
ABOUT
PRESTASHOP AMBASSADORS
PROGRAM
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
28
Rewarding our Best Community Members
Building a network of volunteer Ambassadors to initiate activities that drive
local awareness and educate our Community about ecommerce, throughout
the World.
http://ambassadors.prestashop.com
PrestaShop Ambassador Program
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
29
As of Today
Ambassadors are
worldwide
Germany, Senegal, Nigeria, Italy, Colombia,
Argentina, Peru, Brazil, Canada, Australia,
Nepal, India, Bangladesh….
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
30
Community Worldwide
Madrid
Buenos Aires
Gijon
Malaga
Montréal
NepalParis Dakar
Düsseldo
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
31Join Us
PRESTASHOP FORUM
Head to our forum for general help, ecommerce tips and best practices.
It’s the perfect place to find answers and get the most from your online store.
https://www.prestashop.com/forums/
TRANSLATE PRESTASHOP IN NEPALI LANGUAGE
Submit and vote for translations on PrestaShop's CrowdIn page to help the community sell across
the world.
https://crowdin.com/project/prestashop-official/ne-NP
MEETUP GROUP
Find people with similar interests and attend our future meetups
https://www.meetup.com/PrestaShop-Kathmandu-Ecommerce-Meetup/
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
32Keep in touch with PrestaShop
Facebook: https://www.facebook.com/prestashop
Twitter: https://twitter.com/PrestaShop
YouTube: https://www.youtube.com/prestashop
Instagram: https://www.instagram.com/prestashop/
Pinterest: https://www.pinterest.com/prestashop/
LinkedIn: https://www.linkedin.com/company/prestashop/
Reddit: https://www.reddit.com/r/prestashop/
GitHub: https://github.com/PrestaShop/PrestaShop
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
33
Sagar Pokhrel
Prestashop Ambassador
geeksagar@prime.edu.np
9803082585
© PrestaShop 2015
THANK YOU
WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com
34References
http://doc.prestashop.com/display/PS16/PrestaShop+1.6+documentation
http://doc.prestashop.com/display/PS16/Creating+a+PrestaShop+Module
https://www.prestashop.com/en/community

More Related Content

Similar to PrestaShop Kathmandu Ecommerce Meetup #2

Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Damien Carbery
 
Oscommerce Presentation
Oscommerce PresentationOscommerce Presentation
Oscommerce Presentation
Rightway Solution (I) Pvt. Ltd
 
Plug in development
Plug in developmentPlug in development
Plug in developmentLucky Ali
 
Cakephp's Cache
Cakephp's CacheCakephp's Cache
Cakephp's Cache
vl
 
Wordpress as a framework
Wordpress as a frameworkWordpress as a framework
Wordpress as a framework
Aggelos Synadakis
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practices
Synapseindiappsdevelopment
 
A Successful Magento Project From Design to Deployment
A Successful Magento Project From Design to DeploymentA Successful Magento Project From Design to Deployment
A Successful Magento Project From Design to Deployment
Joshua Warren
 
WordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeWordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcode
Rakesh Kushwaha
 
Php
PhpPhp
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010singingfish
 
Designing for magento
Designing for magentoDesigning for magento
Designing for magentohainutemicute
 
Learning puppet chapter 3
Learning puppet chapter 3Learning puppet chapter 3
Learning puppet chapter 3
Vishal Biyani
 
PHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web DevelopmentPHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web Development
Edureka!
 
Ot valuapat ps14_user_guide_v1.0
Ot valuapat ps14_user_guide_v1.0Ot valuapat ps14_user_guide_v1.0
Ot valuapat ps14_user_guide_v1.0jar kosih
 
Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016
Peter Martin
 
Steps to Setup Magento Multi-Stores
Steps to Setup Magento Multi-StoresSteps to Setup Magento Multi-Stores
Steps to Setup Magento Multi-Stores
magentodeveloperindia
 
Dependency Injection for PHP
Dependency Injection for PHPDependency Injection for PHP
Dependency Injection for PHP
mtoppa
 
How to Build a Module in Odoo 15 Scaffold Method
How to Build a Module in Odoo 15 Scaffold MethodHow to Build a Module in Odoo 15 Scaffold Method
How to Build a Module in Odoo 15 Scaffold Method
Celine George
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
Andy Wallace
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic Templates
Chris Davenport
 

Similar to PrestaShop Kathmandu Ecommerce Meetup #2 (20)

Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
 
Oscommerce Presentation
Oscommerce PresentationOscommerce Presentation
Oscommerce Presentation
 
Plug in development
Plug in developmentPlug in development
Plug in development
 
Cakephp's Cache
Cakephp's CacheCakephp's Cache
Cakephp's Cache
 
Wordpress as a framework
Wordpress as a frameworkWordpress as a framework
Wordpress as a framework
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practices
 
A Successful Magento Project From Design to Deployment
A Successful Magento Project From Design to DeploymentA Successful Magento Project From Design to Deployment
A Successful Magento Project From Design to Deployment
 
WordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeWordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcode
 
Php
PhpPhp
Php
 
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
 
Designing for magento
Designing for magentoDesigning for magento
Designing for magento
 
Learning puppet chapter 3
Learning puppet chapter 3Learning puppet chapter 3
Learning puppet chapter 3
 
PHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web DevelopmentPHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web Development
 
Ot valuapat ps14_user_guide_v1.0
Ot valuapat ps14_user_guide_v1.0Ot valuapat ps14_user_guide_v1.0
Ot valuapat ps14_user_guide_v1.0
 
Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016
 
Steps to Setup Magento Multi-Stores
Steps to Setup Magento Multi-StoresSteps to Setup Magento Multi-Stores
Steps to Setup Magento Multi-Stores
 
Dependency Injection for PHP
Dependency Injection for PHPDependency Injection for PHP
Dependency Injection for PHP
 
How to Build a Module in Odoo 15 Scaffold Method
How to Build a Module in Odoo 15 Scaffold MethodHow to Build a Module in Odoo 15 Scaffold Method
How to Build a Module in Odoo 15 Scaffold Method
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic Templates
 

More from Hem Pokhrel

Software/System Development Life Cycle
Software/System Development Life CycleSoftware/System Development Life Cycle
Software/System Development Life Cycle
Hem Pokhrel
 
Network Infrastructure for E-commerce | Part I
Network Infrastructure for E-commerce | Part INetwork Infrastructure for E-commerce | Part I
Network Infrastructure for E-commerce | Part I
Hem Pokhrel
 
Marketing Information System (MkIS)
Marketing Information System (MkIS)Marketing Information System (MkIS)
Marketing Information System (MkIS)
Hem Pokhrel
 
Primary Memory: RAM, ROM and their Types
Primary Memory: RAM, ROM and their TypesPrimary Memory: RAM, ROM and their Types
Primary Memory: RAM, ROM and their Types
Hem Pokhrel
 
OUTPUT DEVICES: MONITORS (CRT, LCD, LED, PLASMA)
OUTPUT DEVICES: MONITORS (CRT, LCD, LED, PLASMA)OUTPUT DEVICES: MONITORS (CRT, LCD, LED, PLASMA)
OUTPUT DEVICES: MONITORS (CRT, LCD, LED, PLASMA)
Hem Pokhrel
 
Introduction to Bus | Address, Data, Control Bus
Introduction to Bus | Address, Data, Control BusIntroduction to Bus | Address, Data, Control Bus
Introduction to Bus | Address, Data, Control Bus
Hem Pokhrel
 
Touch Screens and Scanner
Touch Screens and ScannerTouch Screens and Scanner
Touch Screens and Scanner
Hem Pokhrel
 
BBA First Semester | Course introduction
BBA First Semester | Course introductionBBA First Semester | Course introduction
BBA First Semester | Course introduction
Hem Pokhrel
 
Software Agents & Their Taxonomy | Ecommerce BBA Handout
Software Agents & Their Taxonomy | Ecommerce BBA HandoutSoftware Agents & Their Taxonomy | Ecommerce BBA Handout
Software Agents & Their Taxonomy | Ecommerce BBA Handout
Hem Pokhrel
 
How to be THIN and SKINNY - 5 Simple Tips
How to be THIN and SKINNY - 5 Simple TipsHow to be THIN and SKINNY - 5 Simple Tips
How to be THIN and SKINNY - 5 Simple Tips
Hem Pokhrel
 
BBA 6th Orientation
BBA 6th OrientationBBA 6th Orientation
BBA 6th Orientation
Hem Pokhrel
 
Computer Network | BBA First Semester
Computer Network | BBA First SemesterComputer Network | BBA First Semester
Computer Network | BBA First Semester
Hem Pokhrel
 
Short Questions Collections | BBA First Semester
Short Questions Collections | BBA First SemesterShort Questions Collections | BBA First Semester
Short Questions Collections | BBA First Semester
Hem Pokhrel
 
Detailed format for E-commerce project report |BBA
Detailed format for E-commerce project report |BBADetailed format for E-commerce project report |BBA
Detailed format for E-commerce project report |BBA
Hem Pokhrel
 
Firewall and It's Types
Firewall and It's TypesFirewall and It's Types
Firewall and It's Types
Hem Pokhrel
 
E-environment
E-environmentE-environment
E-environment
Hem Pokhrel
 
Electronic Data Interchange (EDI) | E-Commerce
Electronic Data Interchange (EDI) | E-CommerceElectronic Data Interchange (EDI) | E-Commerce
Electronic Data Interchange (EDI) | E-Commerce
Hem Pokhrel
 
Internet Marketing Basics | E-Commerce
Internet Marketing Basics | E-CommerceInternet Marketing Basics | E-Commerce
Internet Marketing Basics | E-Commerce
Hem Pokhrel
 
Computer History, Generations, Types and IO
Computer History, Generations, Types and IOComputer History, Generations, Types and IO
Computer History, Generations, Types and IO
Hem Pokhrel
 
COLOR THEORY | COLOR COMBINATION AND USAGES
COLOR THEORY | COLOR COMBINATION AND USAGESCOLOR THEORY | COLOR COMBINATION AND USAGES
COLOR THEORY | COLOR COMBINATION AND USAGES
Hem Pokhrel
 

More from Hem Pokhrel (20)

Software/System Development Life Cycle
Software/System Development Life CycleSoftware/System Development Life Cycle
Software/System Development Life Cycle
 
Network Infrastructure for E-commerce | Part I
Network Infrastructure for E-commerce | Part INetwork Infrastructure for E-commerce | Part I
Network Infrastructure for E-commerce | Part I
 
Marketing Information System (MkIS)
Marketing Information System (MkIS)Marketing Information System (MkIS)
Marketing Information System (MkIS)
 
Primary Memory: RAM, ROM and their Types
Primary Memory: RAM, ROM and their TypesPrimary Memory: RAM, ROM and their Types
Primary Memory: RAM, ROM and their Types
 
OUTPUT DEVICES: MONITORS (CRT, LCD, LED, PLASMA)
OUTPUT DEVICES: MONITORS (CRT, LCD, LED, PLASMA)OUTPUT DEVICES: MONITORS (CRT, LCD, LED, PLASMA)
OUTPUT DEVICES: MONITORS (CRT, LCD, LED, PLASMA)
 
Introduction to Bus | Address, Data, Control Bus
Introduction to Bus | Address, Data, Control BusIntroduction to Bus | Address, Data, Control Bus
Introduction to Bus | Address, Data, Control Bus
 
Touch Screens and Scanner
Touch Screens and ScannerTouch Screens and Scanner
Touch Screens and Scanner
 
BBA First Semester | Course introduction
BBA First Semester | Course introductionBBA First Semester | Course introduction
BBA First Semester | Course introduction
 
Software Agents & Their Taxonomy | Ecommerce BBA Handout
Software Agents & Their Taxonomy | Ecommerce BBA HandoutSoftware Agents & Their Taxonomy | Ecommerce BBA Handout
Software Agents & Their Taxonomy | Ecommerce BBA Handout
 
How to be THIN and SKINNY - 5 Simple Tips
How to be THIN and SKINNY - 5 Simple TipsHow to be THIN and SKINNY - 5 Simple Tips
How to be THIN and SKINNY - 5 Simple Tips
 
BBA 6th Orientation
BBA 6th OrientationBBA 6th Orientation
BBA 6th Orientation
 
Computer Network | BBA First Semester
Computer Network | BBA First SemesterComputer Network | BBA First Semester
Computer Network | BBA First Semester
 
Short Questions Collections | BBA First Semester
Short Questions Collections | BBA First SemesterShort Questions Collections | BBA First Semester
Short Questions Collections | BBA First Semester
 
Detailed format for E-commerce project report |BBA
Detailed format for E-commerce project report |BBADetailed format for E-commerce project report |BBA
Detailed format for E-commerce project report |BBA
 
Firewall and It's Types
Firewall and It's TypesFirewall and It's Types
Firewall and It's Types
 
E-environment
E-environmentE-environment
E-environment
 
Electronic Data Interchange (EDI) | E-Commerce
Electronic Data Interchange (EDI) | E-CommerceElectronic Data Interchange (EDI) | E-Commerce
Electronic Data Interchange (EDI) | E-Commerce
 
Internet Marketing Basics | E-Commerce
Internet Marketing Basics | E-CommerceInternet Marketing Basics | E-Commerce
Internet Marketing Basics | E-Commerce
 
Computer History, Generations, Types and IO
Computer History, Generations, Types and IOComputer History, Generations, Types and IO
Computer History, Generations, Types and IO
 
COLOR THEORY | COLOR COMBINATION AND USAGES
COLOR THEORY | COLOR COMBINATION AND USAGESCOLOR THEORY | COLOR COMBINATION AND USAGES
COLOR THEORY | COLOR COMBINATION AND USAGES
 

Recently uploaded

Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
vrstrong314
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 

Recently uploaded (20)

Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 

PrestaShop Kathmandu Ecommerce Meetup #2

  • 1. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 29/05/2015 Ecommerce Meetup 6 April 2018 Nayabazar, Kathmandu
  • 2. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 2
  • 3. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 3PrestaShop Introduction ▪ PrestaShop is a free, open source e-commerce content management solution. ▪ Used by more than 250,000 e-commerce shops worldwide ▪ Available in 60 different languages. ▪ Current version 1.7.x
  • 4. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 4 PrestaShop 1.7 Improve the UX in the back-office
  • 5. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 5 PrestaShop 1.7 Stay up to date! Check regularly http://build.prestashop.com/
  • 6. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 29/05/2015 PrestaShop Modules Introduction
  • 7. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 7 PrestaShop Modules ▪ 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. ▪ Consists of a main PHP file other PHP supporting files as needed, and all the necessary contents including images, JavaScript and template (.tpl) files necessary to display the information. ▪ PrestaShop's modules are found in the /modules folder, which is at the root of the PrestaShop main folder. ▪ Modules can also be part of a theme if they are really specific to it. In that case, they would be in the theme's own /modules folder, and therefore under the following path: /themes/[my-theme]/modules
  • 8. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 8 PrestaShop File Structure ▪ 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. ▪ Consists of a main PHP file other PHP supporting files as needed, and all the necessary contents including images, JavaScript and template (.tpl) files necessary to display the information. ▪ Let's see an example with PrestaShop's blockuserinfo module:
  • 9. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 9 PrestaShop Modules ▪ Let's see an example with PrestaShop's blocktopmenu module:
  • 10. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 10 PrestaShop Modules: files and folders organization for a PrestaShop 1.6 module ▪ 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. ▪ Consists of a main PHP file other PHP supporting files as needed, and all the necessary contents including images, JavaScript and template (.tpl) files necessary to display the information. ▪ PrestaShop's modules are found in the /modules folder, which is at the root of the PrestaShop main folder. ▪ Modules can also be part of a theme if they are really specific to it. In that case, they would be in the theme's own /modules folder, and therefore under the following path: /themes/[my-theme]/modules
  • 11. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 11 Module Development ▪ Let's create a simple first module; this will enable us to better describe its structure. We will name it "My module". ▪ First, create the module's folder, in the /modules folder. It should have the same name as the module, with no space, only alphanumerical characters, the hyphen and the underscore, all in lowercase: /mymodule. ▪ This folder must contain the main file, a PHP file of the same name as the folder, which will handle most of the processing: mymodule.php. That is enough for a very basic module, but obviously more files and folders can be added later.
  • 12. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 12 Module Development ▪ The main mymodule.php file must start with the following test: <?php if (!defined('_PS_VERSION_')) { exit; } ▪ Next task is to create our main class extending Module parent class
  • 13. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 13 Module Development: The main class ▪ The main file must contain the module's main class (along with other classes if needed). PrestaShop uses Object-Oriented programming, and so do its modules. ▪ That class must bear the same name as the module and its folder, in CamelCase (see http://en.wikipedia.org/wiki/CamelCase). In our example: MyModule. ▪ Furthermore, that class must extend the Module class, in order to inherit all its methods and attributes. class MyModule extends Module { ………………… ………………………………… ……………………………….. }
  • 14. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 14 Module Development: Adding constructor method to the main class ▪ Now, let's fill the class' code block with the essential constructor lines. ▪ A constructor is a function in a class that is automatically called when you create a new instance of a class with new. ▪ In the case of a PrestaShop, the constructor class is the first method to be called when the module is loaded by PrestaShop. ▪ This is therefore the best place to set most of its details. class MyModule extends Module { public function __construct() { Statements here; } }
  • 15. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 15 Module Development: Adding constructor method to the main class ▪ The __constructor() method public function __construct() { $this->name = 'mymodule'; $this->tab = 'front_office_features'; $this->version = '1.0.0'; $this->author = 'Firstname Lastname'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('My module'); $this->description = $this->l('Description of my module.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); if (!Configuration::get('MYMODULE_NAME')) { $this->warning = $this->l('No name provided'); } }
  • 16. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 16 Module Development: Adding constructor method to the main class ▪ Here tabs attribute is the title for the section that shall contain this module in PrestaShop's back office modules list. ▪ It’s value may be one from below or you’re free to add your own tab as well.
  • 17. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 17 Module Development: Adding install and uninstall methods in main class ▪ Your module might need to perform actions on installation, such as checking PrestaShop's settings or to registering its own settings in the database. ▪ Likewise, if you changed things in the database on installation, it is highly recommended to change them back (or remove them) when uninstalling the module. ▪ The install() and uninstall() methods make it possible to control what happens when the store administrator installs or uninstalls the module. ▪ They must be included in the main class' block of code (in our example, the MyModule class) – at the same level as the constructor method. public function install() { if (!parent::install()) { return false; } return true; }
  • 18. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 18 Module Development: Adding install and uninstall methods in main class ▪ Your module might need to perform actions on uninstallation as well, that would delete the data added to the database during the installation If any of the lines in the testing block fails, the method returns false and the installation does not happen. public function uninstall() { if (!parent::uninstall() || !Configuration::deleteByName('MYMODULE_NAME') ) { return false; } return true; }
  • 19. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 19 Module Development: Adding install and uninstall methods in main class ▪ Your module might need to perform actions on installation, such as checking PrestaShop's settings or to registering its own settings in the database. public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->registerHook('leftColumn') || !$this->registerHook('header') || !Configuration::updateValue('MYMODULE_NAME', 'my friend') ) { return false; } return true; } If any of the lines in the testing block fails, the method returns false and the installation does not happen.
  • 20. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 20 Module Development: Display Content in the front office ▪ Need to take care of hooks at the time of install() method definition To know more about hooks in PS 1.6 or 1.7, http://doc.prestashop.com/display/PS17/Hooks+in+PrestaShop+1.7.x public function install() { if (Shop::isFeatureActive()) Shop::setContext(Shop::CONTEXT_ALL); return parent::install() && $this->registerHook('leftColumn') && $this->registerHook('header') && Configuration::updateValue('MYMODULE_NAME', 'my friend'); }
  • 21. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 21 Module Development: Display Content in the front office ▪ Need to take care of hooks at the time of installmethod() definition ▪ Attaching code to a hook requires a specific method for each: hookDisplayLeftColumn(): will hook code into the left column – in our case, it will fetch the MYMODULE_NAME module setting and display the module's template file, mymodule.tpl, which must be located in the /views/templates/hook/ folder. hookDisplayRightColumn(): will simply do the same as hookDisplayLeftColumn(), but for the right column. hookDisplayHeader(): will add a link to the module's CSS file, /css/mymodule.css public function hookDisplayLeftColumn($params) { $this->context->smarty->assign( array( 'my_module_name' => Configuration::get('MYMODULE_NAME'), 'my_module_link' => $this->context->link->getModuleLink('mymodule', 'display') ) ); return $this->display(__FILE__, 'mymodule.tpl'); } public function hookDisplayRightColumn($params) { return $this->hookDisplayLeftColumn($params); } public function hookDisplayHeader() { $this->context->controller->addCSS($this->_path.'css/mymodule.css', 'all'); }
  • 22. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 22 Module Development: Display Content in the front office ▪ Now that we have access to the left column, we should display something there for the customer to see. ▪ The visible part of the module is defined in .tpl files placed in specific View folders: /views/templates/front/: front office features. /views/templates/admin/: back office features. /views/templates/hook/: features hooked to a PrestaShop (so can be displayed either on the front office or the back office).
  • 23. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 23 Module Development: Display Content in the front office <!-- Block mymodule --> <div id="mymodule_block_home" class="block"> <h4>Welcome!</h4> <div class="block_content"> <p>Hello, {if isset($my_module_name) && $my_module_name} {$my_module_name} {else} World {/if} ! </p> <ul> <li><a href="{$my_module_link}" title="Click this link">Click me!</a></li> </ul> </div> </div> <!-- /Block mymodule --> Here is our template file, located at /views/templates/hook/mymodule.tpl:
  • 24. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 24 Module Development: Display Content in the front office In addition to that, we’ll to create a CSS file, and save it as /css/mymodule.css in the module's folder (or any sub-folder you like to keep you CSS in): div#mymodule_block_home p { font-size: 150%; font-style:italic; }
  • 25. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 25 Module Development: Display Content in the front office Add display.php to register our template to current theme File should be in /views/templates/ directory as mentioned earlier <?php class mymoduledisplayModuleFrontController extends ModuleFrontController { public function initContent() { parent::initContent(); $this->setTemplate('display.tpl'); } } For this we need to create display.tpl file that we passed as parameter above. Show some message such as ‘Welcome to my module’ there.
  • 26. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 29/05/2015 DEMO
  • 27. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 29/05/2015 ABOUT PRESTASHOP AMBASSADORS PROGRAM
  • 28. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 28 Rewarding our Best Community Members Building a network of volunteer Ambassadors to initiate activities that drive local awareness and educate our Community about ecommerce, throughout the World. http://ambassadors.prestashop.com PrestaShop Ambassador Program
  • 29. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 29 As of Today Ambassadors are worldwide Germany, Senegal, Nigeria, Italy, Colombia, Argentina, Peru, Brazil, Canada, Australia, Nepal, India, Bangladesh….
  • 30. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 30 Community Worldwide Madrid Buenos Aires Gijon Malaga Montréal NepalParis Dakar Düsseldo
  • 31. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 31Join Us PRESTASHOP FORUM Head to our forum for general help, ecommerce tips and best practices. It’s the perfect place to find answers and get the most from your online store. https://www.prestashop.com/forums/ TRANSLATE PRESTASHOP IN NEPALI LANGUAGE Submit and vote for translations on PrestaShop's CrowdIn page to help the community sell across the world. https://crowdin.com/project/prestashop-official/ne-NP MEETUP GROUP Find people with similar interests and attend our future meetups https://www.meetup.com/PrestaShop-Kathmandu-Ecommerce-Meetup/
  • 32. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 32Keep in touch with PrestaShop Facebook: https://www.facebook.com/prestashop Twitter: https://twitter.com/PrestaShop YouTube: https://www.youtube.com/prestashop Instagram: https://www.instagram.com/prestashop/ Pinterest: https://www.pinterest.com/prestashop/ LinkedIn: https://www.linkedin.com/company/prestashop/ Reddit: https://www.reddit.com/r/prestashop/ GitHub: https://github.com/PrestaShop/PrestaShop
  • 33. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 33 Sagar Pokhrel Prestashop Ambassador geeksagar@prime.edu.np 9803082585 © PrestaShop 2015 THANK YOU
  • 34. WeCommerce is bettereCommerce. The world’s #1 free eCommerce platform. prestashop.com 34References http://doc.prestashop.com/display/PS16/PrestaShop+1.6+documentation http://doc.prestashop.com/display/PS16/Creating+a+PrestaShop+Module https://www.prestashop.com/en/community