SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à 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
 
Plug in development
Plug in developmentPlug in development
Plug in developmentLucky Ali
 
Cakephp's Cache
Cakephp's CacheCakephp's Cache
Cakephp's Cachevl
 
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 practicesSynapseindiappsdevelopment
 
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 DeploymentJoshua 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 shortcodeRakesh Kushwaha
 
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 3Vishal 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 DevelopmentEdureka!
 
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 2016Peter Martin
 
Dependency Injection for PHP
Dependency Injection for PHPDependency Injection for PHP
Dependency Injection for PHPmtoppa
 
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 MethodCeline George
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesAndy Wallace
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesChris Davenport
 

Similaire à 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
 

Plus de Hem Pokhrel

Software/System Development Life Cycle
Software/System Development Life CycleSoftware/System Development Life Cycle
Software/System Development Life CycleHem 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 IHem 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 TypesHem 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 BusHem Pokhrel
 
Touch Screens and Scanner
Touch Screens and ScannerTouch Screens and Scanner
Touch Screens and ScannerHem Pokhrel
 
BBA First Semester | Course introduction
BBA First Semester | Course introductionBBA First Semester | Course introduction
BBA First Semester | Course introductionHem 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 HandoutHem 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 TipsHem Pokhrel
 
BBA 6th Orientation
BBA 6th OrientationBBA 6th Orientation
BBA 6th OrientationHem Pokhrel
 
Computer Network | BBA First Semester
Computer Network | BBA First SemesterComputer Network | BBA First Semester
Computer Network | BBA First SemesterHem Pokhrel
 
Short Questions Collections | BBA First Semester
Short Questions Collections | BBA First SemesterShort Questions Collections | BBA First Semester
Short Questions Collections | BBA First SemesterHem 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 |BBAHem Pokhrel
 
Firewall and It's Types
Firewall and It's TypesFirewall and It's Types
Firewall and It's TypesHem Pokhrel
 
Electronic Data Interchange (EDI) | E-Commerce
Electronic Data Interchange (EDI) | E-CommerceElectronic Data Interchange (EDI) | E-Commerce
Electronic Data Interchange (EDI) | E-CommerceHem Pokhrel
 
Internet Marketing Basics | E-Commerce
Internet Marketing Basics | E-CommerceInternet Marketing Basics | E-Commerce
Internet Marketing Basics | E-CommerceHem Pokhrel
 
Computer History, Generations, Types and IO
Computer History, Generations, Types and IOComputer History, Generations, Types and IO
Computer History, Generations, Types and IOHem Pokhrel
 
COLOR THEORY | COLOR COMBINATION AND USAGES
COLOR THEORY | COLOR COMBINATION AND USAGESCOLOR THEORY | COLOR COMBINATION AND USAGES
COLOR THEORY | COLOR COMBINATION AND USAGESHem Pokhrel
 

Plus de 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
 

Dernier

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 

Dernier (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

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