SlideShare a Scribd company logo
1 of 12
webocreation.com@gmail.com
:@rupaknpl : onlinegyannepal
https://webocreation.com
OpenCart Module Development
OpenCart Library Global Methods
What this video series covers
Making hello world module
Workflow or markup to make hello world module
-- Installing a module
-- Configuration of module
-- Managing layout and position
-- Uninstalling the module
Admin files created to make hello world module
-- Controller creation
-- Language file creation
-- Template file creation
Front end files created to make hello world
-- Controller creation
-- Language file creation
-- Template file creation
OpenCart Flow
• Introduction
• Why OpenCart?
• Features of OpenCart
• Prerequisites
• Downloading example code
• Installing OpenCart
-Steps to create custom URL to work locally
• Describing folders and files of OpenCart
• OpenCart Framework:
-Registry, loader, request, response, database,
session , cache, unlimited colors theme,
language, event, Event Register, Config
Autoload, Language Autoload, Library
Autoload, Model Autoload, Front Controller,
Pre Actions, Dispatch and Output.
• OpenCart Code flow
• Request and Response in OpenCart
• Database table schema
• OpenCart Library Global Methods
Namespace in OpenCart
• A namespace is like a directory and by adding ‘namespace’, Affiliate is
now under ‘Cart’.
• To use ‘Affiliate’, we call or instantiate as new CartAffiliate()
• Adding a ‘namespace’ to a class is like organizing files from one
directory into a bunch of sub-directories.
• The use statement lets us call class by a nickname.
OpenCart Library Global Methods
• Code only what you need, if you missed these global methods then
you may repeat codes
• You can find global methods at system/library
• Opencart has many predefined methods that can be called in
Controller and Model
system/library/cart/affiliate.php
• $this->affiliate->login($email, $password);
• You can find code used at catalog/controller/affiliate/login.php validate()
method.
• Affiliate login script at system/library/cart/affiliate.php is used to provide the
authentication for Affiliate section of OpenCart. Affiliate session is activated
for affiliate_id, firstname, lastname, email, telephone, fax and code.
• $this->affiliate->logout()
• You can find code used at catalog/controller/affiliate/logout.php index()
method.
• Affiliate logout script at system/library/cart/affiliate.php is used to unset the
affiliate session and assign empty value to affiliate_id, firstname, lastname,
email, telephone and fax of Affiliate. By this Affiliate is logged out.
Affiliate
Affiliate contd.
• $this->affiliate->isLogged()
• You can find code used at catalog/controller/affiliate/account.php index()
method.
• Affiliate isLogged script at system/library/cart/affiliate.php is used to check
whether affiliate_id is active or not.
• $this->affiliate->getId()
• You can find code used at catalog/model/affiliate/affiliate.php
editAffiliate($data) method.
• Affiliate getId script at system/library/cart/affiliate.php is used to return
active affiliate_id.
Affiliate contd.
• $this->affiliate->getFirstName()
• You can find code used at catalog/controller/affiliate/login.php index()
method.
• Affiliate getFirstName script at system/library/cart/affiliate.php is used to
return active affiliate first name.
• $this->affiliate->getLastName()
• You can find code used at catalog/controller/affiliate/login.php index()
method.
• Affiliate getLastName script at system/library/cart/affiliate.php is used to
return active affiliate last name.
Affiliate contd.
• $this->affiliate->getEmail()
• You can find code used at catalog/controller/affiliate/edit.php validate()
method.
• Affiliate getEmail script at system/library/cart/affiliate.php is used to return
active affiliate email.
• $this->affiliate->getTelephone()
• Not used in OpenCart but you can use it .
• Affiliate getTelephone script at system/library/cart/affiliate.php is used to
return active affiliate Telephone number.
Affiliate contd.
• $this->affiliate->getCode()
• You can find code used at catalog/controller/affiliate/tracking.php index()
method.
• Affiliate getCode script at system/library/cart/affiliate.php is used to return
active affiliate tracking code which is used to track referrals.
• $this->affiliate->getFax()
• Not used in OpenCart but you can use it .
• Affiliate getFax script at system/library/cart/affiliate.php is used to return
active affiliate Fax number.
Other Global Methods
• Cart
• Currency
• Customer
• Length
• Tax
• User
• Weight
• Config
• DB
• Document
• Encryption
• Image
• Language
• Log
• Mail
• Openbay
• Pagination
• Request
• Response
• Session
• Template
• URL
https://www.packtpub.com/web-development/opencart-theming
For Detail description read
“OpenCart Theme and
Module Development” book
webocreation.com@gmail.com
:@rupaknpl : onlinegyannepal
https://webocreation.com
Thanking you

More Related Content

What's hot

Cakefest 2010: API Development
Cakefest 2010: API DevelopmentCakefest 2010: API Development
Cakefest 2010: API Development
Andrew Curioso
 
Bullet: The Functional PHP Micro-Framework
Bullet: The Functional PHP Micro-FrameworkBullet: The Functional PHP Micro-Framework
Bullet: The Functional PHP Micro-Framework
Vance Lucas
 
PHP Server side restful API - linkedin
PHP Server side restful API - linkedinPHP Server side restful API - linkedin
PHP Server side restful API - linkedin
Vũ Quang Sơn
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAML
Jon Dean
 

What's hot (20)

jQuery Intro
jQuery IntrojQuery Intro
jQuery Intro
 
Choosing a Templating System
Choosing a Templating SystemChoosing a Templating System
Choosing a Templating System
 
Cakefest 2010: API Development
Cakefest 2010: API DevelopmentCakefest 2010: API Development
Cakefest 2010: API Development
 
Ph pbasics
Ph pbasicsPh pbasics
Ph pbasics
 
Intro to Rails Give Camp Atlanta
Intro to Rails Give Camp AtlantaIntro to Rails Give Camp Atlanta
Intro to Rails Give Camp Atlanta
 
Plugins unplugged
Plugins unpluggedPlugins unplugged
Plugins unplugged
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
Advanced SEO Tactics to Fix Duplicate Content in eCommerce [ 2X eCommerce Web...
Advanced SEO Tactics to Fix Duplicate Content in eCommerce [ 2X eCommerce Web...Advanced SEO Tactics to Fix Duplicate Content in eCommerce [ 2X eCommerce Web...
Advanced SEO Tactics to Fix Duplicate Content in eCommerce [ 2X eCommerce Web...
 
Debugging PHP Code
Debugging PHP CodeDebugging PHP Code
Debugging PHP Code
 
Zen and the Art of Claroline Module Development
Zen and the Art of Claroline Module DevelopmentZen and the Art of Claroline Module Development
Zen and the Art of Claroline Module Development
 
"Managing API Complexity". Matthew Flaming, Temboo
"Managing API Complexity". Matthew Flaming, Temboo"Managing API Complexity". Matthew Flaming, Temboo
"Managing API Complexity". Matthew Flaming, Temboo
 
Bullet: The Functional PHP Micro-Framework
Bullet: The Functional PHP Micro-FrameworkBullet: The Functional PHP Micro-Framework
Bullet: The Functional PHP Micro-Framework
 
Artisan Perfumery or Being Led by the Nose [P.D.F_book]@@
 Artisan Perfumery or Being Led by the Nose [P.D.F_book]@@ Artisan Perfumery or Being Led by the Nose [P.D.F_book]@@
Artisan Perfumery or Being Led by the Nose [P.D.F_book]@@
 
Dash of ajax
Dash of ajaxDash of ajax
Dash of ajax
 
ApacheCon 2005
ApacheCon 2005ApacheCon 2005
ApacheCon 2005
 
PHP Server side restful API - linkedin
PHP Server side restful API - linkedinPHP Server side restful API - linkedin
PHP Server side restful API - linkedin
 
HTML 5 Basics Part One
HTML 5 Basics Part OneHTML 5 Basics Part One
HTML 5 Basics Part One
 
Android - Values folder
Android - Values folderAndroid - Values folder
Android - Values folder
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAML
 

Similar to 6 global library function provided by open cart

Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Nguyen Duc Phu
 

Similar to 6 global library function provided by open cart (20)

Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Code Generation in Magento 2
Code Generation in Magento 2Code Generation in Magento 2
Code Generation in Magento 2
 
MVCL pattern, web flow, code flow, request and response in OpenCart
MVCL pattern, web flow, code flow, request and response in OpenCartMVCL pattern, web flow, code flow, request and response in OpenCart
MVCL pattern, web flow, code flow, request and response in OpenCart
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-public
 
Php Best Practices
Php Best PracticesPhp Best Practices
Php Best Practices
 
Php Best Practices
Php Best PracticesPhp Best Practices
Php Best Practices
 
Rapid Application Development with CakePHP 1.3
Rapid Application Development with CakePHP 1.3Rapid Application Development with CakePHP 1.3
Rapid Application Development with CakePHP 1.3
 
How to learn to build your own PHP framework
How to learn to build your own PHP frameworkHow to learn to build your own PHP framework
How to learn to build your own PHP framework
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
 
Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sins
 
Kohana 3.2 documentation
Kohana 3.2 documentationKohana 3.2 documentation
Kohana 3.2 documentation
 
PHP Basic
PHP BasicPHP Basic
PHP Basic
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
presentation
presentationpresentation
presentation
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3
 
Ei cakephp
Ei cakephpEi cakephp
Ei cakephp
 
Cakeph pppt
Cakeph ppptCakeph pppt
Cakeph pppt
 
LAB PHP Consolidated.ppt
LAB PHP Consolidated.pptLAB PHP Consolidated.ppt
LAB PHP Consolidated.ppt
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
+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
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

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 🔝✔️✔️
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
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 title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
+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...
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 

6 global library function provided by open cart

  • 2. What this video series covers Making hello world module Workflow or markup to make hello world module -- Installing a module -- Configuration of module -- Managing layout and position -- Uninstalling the module Admin files created to make hello world module -- Controller creation -- Language file creation -- Template file creation Front end files created to make hello world -- Controller creation -- Language file creation -- Template file creation OpenCart Flow • Introduction • Why OpenCart? • Features of OpenCart • Prerequisites • Downloading example code • Installing OpenCart -Steps to create custom URL to work locally • Describing folders and files of OpenCart • OpenCart Framework: -Registry, loader, request, response, database, session , cache, unlimited colors theme, language, event, Event Register, Config Autoload, Language Autoload, Library Autoload, Model Autoload, Front Controller, Pre Actions, Dispatch and Output. • OpenCart Code flow • Request and Response in OpenCart • Database table schema • OpenCart Library Global Methods
  • 3. Namespace in OpenCart • A namespace is like a directory and by adding ‘namespace’, Affiliate is now under ‘Cart’. • To use ‘Affiliate’, we call or instantiate as new CartAffiliate() • Adding a ‘namespace’ to a class is like organizing files from one directory into a bunch of sub-directories. • The use statement lets us call class by a nickname.
  • 4. OpenCart Library Global Methods • Code only what you need, if you missed these global methods then you may repeat codes • You can find global methods at system/library • Opencart has many predefined methods that can be called in Controller and Model
  • 5. system/library/cart/affiliate.php • $this->affiliate->login($email, $password); • You can find code used at catalog/controller/affiliate/login.php validate() method. • Affiliate login script at system/library/cart/affiliate.php is used to provide the authentication for Affiliate section of OpenCart. Affiliate session is activated for affiliate_id, firstname, lastname, email, telephone, fax and code. • $this->affiliate->logout() • You can find code used at catalog/controller/affiliate/logout.php index() method. • Affiliate logout script at system/library/cart/affiliate.php is used to unset the affiliate session and assign empty value to affiliate_id, firstname, lastname, email, telephone and fax of Affiliate. By this Affiliate is logged out. Affiliate
  • 6. Affiliate contd. • $this->affiliate->isLogged() • You can find code used at catalog/controller/affiliate/account.php index() method. • Affiliate isLogged script at system/library/cart/affiliate.php is used to check whether affiliate_id is active or not. • $this->affiliate->getId() • You can find code used at catalog/model/affiliate/affiliate.php editAffiliate($data) method. • Affiliate getId script at system/library/cart/affiliate.php is used to return active affiliate_id.
  • 7. Affiliate contd. • $this->affiliate->getFirstName() • You can find code used at catalog/controller/affiliate/login.php index() method. • Affiliate getFirstName script at system/library/cart/affiliate.php is used to return active affiliate first name. • $this->affiliate->getLastName() • You can find code used at catalog/controller/affiliate/login.php index() method. • Affiliate getLastName script at system/library/cart/affiliate.php is used to return active affiliate last name.
  • 8. Affiliate contd. • $this->affiliate->getEmail() • You can find code used at catalog/controller/affiliate/edit.php validate() method. • Affiliate getEmail script at system/library/cart/affiliate.php is used to return active affiliate email. • $this->affiliate->getTelephone() • Not used in OpenCart but you can use it . • Affiliate getTelephone script at system/library/cart/affiliate.php is used to return active affiliate Telephone number.
  • 9. Affiliate contd. • $this->affiliate->getCode() • You can find code used at catalog/controller/affiliate/tracking.php index() method. • Affiliate getCode script at system/library/cart/affiliate.php is used to return active affiliate tracking code which is used to track referrals. • $this->affiliate->getFax() • Not used in OpenCart but you can use it . • Affiliate getFax script at system/library/cart/affiliate.php is used to return active affiliate Fax number.
  • 10. Other Global Methods • Cart • Currency • Customer • Length • Tax • User • Weight • Config • DB • Document • Encryption • Image • Language • Log • Mail • Openbay • Pagination • Request • Response • Session • Template • URL
  • 11. https://www.packtpub.com/web-development/opencart-theming For Detail description read “OpenCart Theme and Module Development” book