6 global library function provided by open cart

12
[email protected] :@rupaknpl : onlinegyannepal https://webocreation.com OpenCart Module Development OpenCart Library Global Methods

Upload: self

Post on 21-Feb-2017

215 views

Category:

Software


3 download

TRANSCRIPT

Page 1: 6 global library function provided by open cart

[email protected] :@rupaknpl : onlinegyannepal

https://webocreation.com

OpenCart Module DevelopmentOpenCart Library Global

Methods

Page 2: 6 global library function provided by open cart

What this video series coversMaking hello world module

Workflow or markup to make hello world module -- Installing a module -- Configuration of module -- Managing layout and position -- Uninstalling the moduleAdmin 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

Page 3: 6 global library function provided by open cart

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 Cart\Affiliate()• 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.

Page 4: 6 global library function provided by open cart

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

Page 5: 6 global library function provided by open cart

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

Page 6: 6 global library function provided by open cart

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.

Page 7: 6 global library function provided by open cart

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.

Page 8: 6 global library function provided by open cart

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.

Page 9: 6 global library function provided by open cart

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.

Page 10: 6 global library function provided by open cart

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

Page 11: 6 global library function provided by open cart

https://www.packtpub.com/web-development/opencart-theming

For Detail description read “OpenCart Theme

and Module Development” book

Page 12: 6 global library function provided by open cart

[email protected] :@rupaknpl : onlinegyannepal

https://webocreation.com

Thanking you