Home
        VirtueMart - 1.0 Developer's Guide
         Contents
1.      j  vmLogger   alert   My alarm message to the user          vmLogger  gt crit   My critical message to the user        SvmLogger  gt err   My error message to the user        Mainly used to log errors in a f    SvmLogger  gt warning   My warning message to the user        Mainly used to trigger war     vmLogger   notice   My Notice to the user         vmLogger  gt info   My informational message to the user        Used to give success me       SvmLogger  gt debug   My debug message to the user        Only displayed when DEBUG is e       VirtueMart Developer Manual       SvmLogger  gt tip   My advice to the user        Used to display Advice messages to the    3 4  Database Structure    As said before  all Tables used for VM begin with the prefix _vm_  VM doesn t use Joomla core tables for stor   ing data        VirtueMart Developer Manual                                                                                                                                                                                                          11 1  2 1   mos pshop waiting list  mos pshop zone shipping waiting list id  PK   mos pshop  vendor category zone id  PI  product id  vendor category id  PI  zone name user id  vendor category name zone  cost notify email  mos pshop  visit wendor category desc zone  limit notified  visit id  PK  zone description notify date  affiliate id zone tax rate  pages  entry page  exit page mos pshop vendor  sdate vendor id  PK  mos  pshop  user inf
2.    VirtueMart Developer Manual    Soeren Eberhardt www virtuemart net  http   www virtuemart net    Copyright    2005 Soeren Eberhardt    This document is published under the Open Content License available from  http   www opencontent org opl shtml  http   www opencontent org opl shtml     Revision History    Revision 1 1 November 21  2005 soeren nb  Update for VirtueMart  Revision 1 0 June 29  2005 soeren nb    Initial Release  mambo phpShop v1 2 stable pl3     Table of Contents    TU ucc                                               seas EEEE EES 1  DVO MUCHON HX                                         H    1  SUB ASICS D                                          3  4  Modifying the Layout  rere eterne tnt abet E E R e eee oe Elaine ce nsu o e Mesue PU eR eU MER e ERE ER 12  5  Creating ormodifying Extensions cs iscscccivisdscsviaseersstiaeccu states senate se dsobsveasnbiiee ee s EEEE EREEREER EEOSE 13  MPs HE 18    1  Preambel    The content of this document is related to VirtueMart        VirtueMart is free Software  licensed under GNU GPL  VirtueMart   http   www virtuemart net    Conversion to Joomla and much more     2005 S  ren Eberhardt    The Software  VirtueMart  is intended for use in Joomla and Mambo  version 4 5 1 and 4 5 2 x   Joomla or  Mambo are required for running VirtueMart      Joomla   Mambo is free Software  licensed under GNU GPL     The abbrevation VM  which stands for VirtueMart is used in this document     2  Introduction    2 1  History    VM has i
3.  availability Contains images for displaying the availability of a  product     All images in this folder are automatically parsed and displayed in the product form for selection as the  availability image for a product   so just copy them here      category Contains images for categories    product Contains Product Images   resized product images   ps image Images for the administrative interface    vendor Vendor Logos    3 2  Main Flow Chart    3 2 1  Joomla Part    Joomla uses the variable option to load a specific component  This variable must have the value   com virtuemart  to load VM  Called on the Frontend  Joomla searches the directory   components for a di   rectory called com  virtuemart and a file called virtuemart php in it     When called in the backend  Joomla searches the directory  administrator components for a directory  called com  virtuemart and a file called admin phpshop php in it     If found  the file is included     3 2 2  Shop Part    When the Shop is loaded  one of the first things is to load the file virtuemart parser php using the re   quire once command  It makes core interactions like the Joomla php file  mainframe class and after that looks  for a variable called page  can be passed by GET or POST      The page variable consists of the pagename and the core module name     shop browse       shop is the name of the shop core module and browse is the name of the page     Tip       VirtueMart Developer Manual       Core modules are listed in the 
4.  pshop orders    userid coupon  id  PK     manufacturer ia Pio  order id user_id order id  PID  vendor_id coupon_code NO _  mtname dud  user info id active user_id percent_or_total mf email TI  vendor id rate vendor id coupon type mf desc roduct  parent id  product id order number coupon value mf category id PEET H  order item sku user  info  id order id  P  mf url pe ducts dare  order_item_name          order  total visit id Pedut dass  product_quantity category parent id  FIO     B order subtotal affiliate  id NS P      product item price category child id  FK  eudar tax dd  N product thumb  image  product  final price category  list order shipping mos  pshop  module product full  image  order item  currency order  shipping  tax   module  id  PK  mos pshop eder user ifo     Product_ publish  order status coupon  discount module name order info id  PK  rods eight uom  cdate order  discount i module description product length  mane order_currency AIAN module_perms user  id pode nn  product attribute order status sil T module_header address_type qus  gon id  PI  product  height  cdate f module_footer address type name  n   vendor_id product_lwh_uom  mdate ite guy name module  publish company product ui  ship  method  id category description Maries ded e product  in  stodc  sustomer note category thumb  image anguage code  af name product available date  ip  address tate on fili language  code 2 fit name Mable   gory full image   product  availability  H category publish langua
5.  the Joomla template  Joomlahut com   http   mambohut com   is a good start      4 1  Finding the right File    When you want to modify a part of your Shop  that can t be changed in its layout using the Joomla template s  CSS   you must of course know  which file you have to modify  to create the layout you want     To quickly find the file  which produces the HTML output you re seeing  you can enable the DEBUG mode    Admin    gt   Configuration    gt   Path  amp  URL    gt  check  DEBUG   and save     After having done that  you will see blue info icons all over the Shop  which show the file name of the included  file on mouseover     The most changed files are       e     html shop browse  the product listing   category overview   e     html shop product  details php  the product detail page   view   e     html shop index php  the default Shop Homepage  when the parameter page is omitted      4 2  Modifying Templates    VM doesn t use a template engine  like patTemplate or Smarty  to parse its templates     4 2 1  Flypage Templates    Flypage  or product details  templates can be found in  htm1 templates product details    They are loaded and filled with content in the file  htm1 shop product details php     The concept is to define placeholders in the template and replaced them by the real contents on load  This is  done using the PHP function str_replace     The following placeholders are used     d     4 2 2  Browse Templates    Browse templates define the display of a 
6. 5 1 2  Digging deeper  The Basics    All payment modules are located in the directory   administrator components com virtuemart classes payment   and provide two files  the class file and the configuration file    Example  Module  mynewpayment     You must have two files called      ps mynewpayment php  including the class ps mynewpayment     ps mynewpayment cfg php  containing all necessary configuration constant definitions   If the user has chosen to pay using a payment method  which has this class as its processor  entry under Class    Name   the file ps  mynewpayment   php will be included on checkout and its functions will be used to pro   cess the payment details  regardless of the implementation     5 1 3  The API specification    The following is a list of all methods that must be implemented in a payment module s class file     string show configuration  void    Shows the configuration form for this payment module in the payment method form     boolean has  configuration  void    returns true if the payment module can be configured        15    VirtueMart Developer Manual       false if not    boolean configfile_writeable  void    returns true if the configuration file for that payment module is writeable     false if not    boolean configfile_readable  void    returns true if the configuration file for that payment module is readable     false if not    void write_configuration  Array    Stores all configuration values for this payment module in the configuration f
7. D for the ship   ping address the user has selected   d  ship to info id     The ship to info id refers to the  field user info id in the tables mos users OR mos vm user info  Check both for a matching entry     float get rate  Array  d    Returns the amount for the selected shipping rate by analyzing the parameter shipping  rate id     float get tax rate  Array  d    Returns the tax rate for this shipping module  e g  0 16      boolean validate  Array  d    Validates the value for the parameter shipping rate id usually using  isset     SESSION  shipping rate id           Assumes you have set the value in the function list  rates for each returned shipping rate     void write configuration  Array    Stores all configuration values for this shipping module in the configuration file     string show configuration  void    Shows the configuration form for this shipping module in the shipping module form     boolean configfile writeable  void    returns true if the configuration file for that module is writeable  false if not    Note       VirtueMart Developer Manual       Please always change configuration variables in both functions  show_configuration and  write_configuration     5 2 3  Installing a Shipping Module    Shipping modules also can t be automatically installed  but you must copy the three files mentioned above into  the directory     administrator components com_virtuemart classes shipping    After having done that  you must go to the Shop Configuration  where your 
8. anager  The Main application  VirtueMart  is run in the component part   The Component contains all core files  The module  mod virtuemart  was written to provide all important  links so the component can be controlled  Category links  Mini Cart  Product Search Form  Account Main   tenance  Admin     2 3  Joomla Integration    The Joomla Integration of VM is very special  because of its origin  It doesn t completely comply to Joomla s  Component Coding Standards  VM uses some own functions for database access  page navigation  search and  listings  By using old code from phpShop  this little bit of compatiblity can be maintained  so one can integrate  extensions written for phpShop      3  Basics    3 1  Directory and File Structure    VM holds most of its files in the  administrator part of Joomla  The only files stored in the    components part of a Joomla site are those  which must be accessible from the Frontend of a Joomla site   even when the Administrator part is secured by htaccess files      administrator components com  virtuemart   Contains file for the administration interface of VM  Because the admin   istrative interface is also accessible from the frontend  those files are not  restricted to the Joomla Coding Standards  Important files     header php  Code for the Drop Down Menu of the administration       virtuemart cfg php  central Configuration File       toolbar phpshop html php  controls the administrative Tool   bar      administrator components com  virt
9. base     The database structure of phpShop had to be changed  because Joomla provides an excellent framework  with session handling and user management  The following tables have been removed     e auth user md5  jos users stores passwords      intershipper     language     Sessions   There have been added several tables  jos pshop affiliate  jos vm  affiliate sale  jos vm  creditcard   jos  vm  manufacturer  jos  vm manufacturer category  jos  vm  product  download     jos vm product mf xref  jos vm product reviews  jos vm product votes  jos vm shipping carrier   jos vm shipping rate  jos vm visit jos vm waiting list  jos vm zone shipping           4  Session handling       VirtueMart Developer Manual       Joomla provides a framework with session handling   no need to have an own session class  No hid   den_session   calls are needed anymore  The existing session class has become the global link formatter   The functions url and purl are needed to format links SEF or append the Itemid parameter     5  Separation into component and modules    A Joomla site consists of various elements like components  modules  templates and Mambots   most likely  you will know components  modules and templates  A Component is the Main Part of the Page in the   Main Body   Can be installed uninstalled trough the Component Manager and have their own configura   tion interface  Modules are sideblocks surrounding the Main body  They can be installed uninstalled and  configured using the Module M
10. d  PK  download  max   order id   mos  pshop  order statu    diea Mq  mos pshop  payment  method      chop function order status code order status  id  PK  file  name  payment method id  PK  function  id  PK  date added order status code  vendor id module d customer notified Saraan ama   TY  payment method name function  name comments ender ia mos_pshop_product_files  payment  class Mf  nclion lage  ci fle PH  shopper group  id d  ncilon mated b file product id  payment method discount function description m9s Pshop  currency CETTE filename  list order function perms currency  id  PK  field  id  PI mos pshop manufacturer category bie le i  payment_method_code currency name ald name mf  category id  PK  Wlecadandon  ics nee currency code field default  value mf category name file mimetype  Savant enabled mos_pshop_country field ordering mf category  desc file un  accepted  creditcards country id  PK    field_required file_published  payment_extrainfo zone_id file_is_image  payment_passkey countn  name   mos pshop creditcard file mage  height   creditcard  id  P  file image width  N Wander fd file_image_thumb_height  aaia file image  thumb width          is category in creditcard_code       n2  X 5 S 22                                                                                                                                        mos_pshop_order_item   mos_pshop_affiliate mos pshop auth user vendor mos pshop coupons  SS mos psho   order jtem  id  PK  affiliate id  PI  mos
11. e replacement for offset and can be used just like this   Itemid This parameter is new and not VM specific  It s a mandatory parameter that tells Joomla     which Menu Item is selected and active  so the pathway can be written correctly  Home       Online Shop  and modules which shall only be shown on specific pages are hidden   shown     2  Database Interface    phpShop has its own database class  ps DB  in a file called db_mysql inc  This database class has been  completely modified to be a wrapper class for the Joomla Standard Database Class  database   The new file   name is ps  database php  The class name is still ps DB  but its a Child Class of the Joomla database  class  class ps  DB extends database  and inherits all methods and properties  This has a lot of advantages   the class is safe against Joomla database class changes and it provides backward compatibility for the  masses of database calls and queries in the scripts  which don t use the Joomla functions  but the phpShop  functions    VM doesn t connect to the database  but it uses the connection Joomla has built up  This is for  optimal performance since VM doesn t connect to the database each time a query is to be run     3  Database Structure                Table names have changed and got a prefix   Use  __ vm _tablename instead of tablename  The 4    stands for the dynamic Joomla table name prefix  The  vm  stands for the dynamic table name prefix of  VM which allows to have more than one shop in one data
12. e with the  Shop and give their services        VirtueMart Developer Manual       5 1  Payment Modules    There are two general types of payment modules in VM     automatic credit card processors which do server to server communication before the order is placed  e g   authorize net AIM       all other payment methods that do not communicate to a server before the order is placed  PayPal  World   pay  all other form based payment methods  all formless payment methods     5 1 1  Quick Create a new payment method    If you have form code for a form based payment method  most payment providers use this way   you just need  to select  Store    gt   Add Payment Method  from the VirtueMart admin drop down menu     An empty payment method form opens  Now fill in the details of your payment method like this        virt  eMart     Payment Method Forn    General   Configuration       Active   M  Payment Method Name   My New Payment  Code     Payment class name  e g  ps_netbanx        NP  default  ps_payment      Leave blank if you re not sure what to fill in     Payment method type  Credit Card    Use Payment Processor  Bank debit  Address only   Cash on Delivery    Cie  www    PayPal  or related     Shopper Group   default   Washupito s Tiendita  Vendor ID  1  nd    Discount     0 00  List Order   2l    Note    Be sure that you have NOTselected  credit cart payment  or  automatic processor      On the second tab you must fill your form code  you can use HTML and PHP   into the text ar
13. ea called  Pay   ment Extra Info         VirtueMart Developer Manual       Payment Method Form       General   Configuration    Payment Extra Info  Qo          php    your iTransact account details   vendorID    X  3       global  vendor_name    mername    vendor_name       order details            total   b  gt f   ordef_ total     first_name    user  gt first_name  last_name    user  gt last_  Suser  gt address 1  city    user  gt city  state   Suse   gt state  zip    user   zip  country    u  Suser  gt email  phone    user  gt phone_1  home_page    mosConfig live site   index php   ret a     mosConfig live site   index php   cc payment image     mosConfig live site   components com virtuemart shop image ps image cc payment jpg             lt form action  https   secure paymentclearing com cgi bin mas split cgi  method  POST  gt    lt input type  hidden  name  vendor id  value   lt  php echo  vendorID    gt     lt input type  hidden  home page  value   lt  php echo  home_page    gt     lt input type  hidden  ret addr  value   lt  php echo  ret_addr    gt     lt input type  hidden  name  mername  value   lt  php echo  mername    gt       lt    Enter text in the next value that should appear on the bottom of the o   lt INPUT type  hidden  name  mertext  value      lt    If you are accepting checks  enter the number 1 in the next value  En    Caution    The code inside this form MUST BE VALID  If you use PHP code  check if you have written correct  code that can be parsed     
14. esides  all the other form fields      If the current user has the permissions to execute the function  permissions can be set for each function sepa   rately   the file virtuemart parser php looks for the class file name and the function name mapped in  the table mos  vm  function for that specific function name  productAdd   In this case we get ps product  as the class name and add as the function name     After having fetched this information  we can start to execute the real function  which is done in this part of  virtuemart parser php        Load class definition file  require once  CLASSPATH  db   f  function class     php           create an object   string    XS    Sfunc class       new      func class         eval   string          RUN THE FUNCTION  Scmd     Sok         func class           S func method       vars      eval   cmd          First  the file ps  product  php is loaded  then an object of the class ps  product is created and the func   tion add is called on that object  The function returns t rue on success and false on failure  The variable  ok  stores the function result  All this code is exectuted using the PHP eval command for creating and executing  PHP code on the fly        VirtueMart Developer Manual       If you wonder what the variable  vars is  it s just a working copy of the superglobal   REQUEST Array and  used as the array  d inside of the functions        3 3 3  Other important Environment variables    Array  cart    Array  auth    ps  ses
15. ge code 3 middle name P d  et spatial  cdate MAE e dE  HE product  discount jd  ese EE language file 1 m ce  products per row language  file 2 address 1 mdate  category  flypage language file 3 address 2 product  name   maie language file 4 city pedia sales    language  file 5 state attribute   module  label  1 country custom  attribute  module label 2 zip cer nd  module label 3 user email P taxi                   module label 4  module label  5             Figure 1  Entitiy Relationship Diagram       10    VirtueMart Developer Manual       3 5  Database Access    VM uses its own database access class for dealing with the database    The database class file is   administrator components com_virtuemart classes ps_database php    This database class extends Joomla s database class  class ps DB extends database  and provides additional    functions  to be able to use older phpShop code  So this class is just a wrapper class for Joomla s database object  and doesn t open new connections to the database     e Start a query  call the method query   string  query                               db   query   SELECT email FROM      users     e Get the resulting record set  call method next  record  void        db   next record      returns false when no result can be returned or the end of the record set has been reached     e Fetch the value of an attribute of the record set  method f   string  nameOfTheAttribute    Sdb  gt f     email        Alternative  method sf   string  nameOfTheA
16. ile     boolean process_payment String  order_number  Float  order_total  Array  amp  d   This is the main function for all payment modules that use direct connections to a payment gateway   like authorize net or eWay XML   This is the place  where the payment details are validated and  captured on success   Returns true on sucess  false on failure    float get_payment_rate Float  subtotal     This is the function to calculate the fee   discount for this special payment module  so you can cal   culate a fee  depending on the order total amount      Note    IF you are about to change configuration variables  do this in both functions  show_configuration and  write_configuration     5 1 4  Installing a Payment Module    Since there s no real installer for payment modules  you must copy the two files ps mynewpayment   php  and ps mynewpayment cfg php into the directory     administrator components com virtuemart classes payment    first    After you have done that  you can add a new payment method   Store    gt   Add Payment Method    It s impor   tant to fill in the correct name for Payment Class Name  in this case  ps mynewpayment    here s the reason  why you must give the class file the same name as the class inside the file  the Shop now tries to include a file    called  ps mynewpayment php  on Saving the payment method     When you now re open the newly created payment method  you have access to the configuration form     5 2  Shipping Modules    5 2 1  The Basics    Ship
17. inside of a function        VirtueMart Developer Manual        Logging  means to log a message to display them to the user  While a function is executed  because its execu   tion was triggered by the variable  func  in the file virtuemart_parser php  the events are buffered   When the function call has ended  the contents of the log are flushed and all messages are displayed to the user  in the order they were added to the log  first in  first out     After that implicit flushing is enabled   what means that you can log a message and it is printed into the HTML  code where you call the log function     Currently the Log display class used by VM offers 9 log levels     e System is unusable  PEAR  LOG  EMERG      Immediate action required  PEAR  LOG  ALERT    e Critical conditions  PEAR  LOG CRIT   formatted by CSS style 1og crit     Error conditions  PEAR LOG ERR   formatted by CSS style 1og  error   e Warning conditions  PEAR LOG WARNING   formatted by CSS style 1og  warning  e Normal but significant  PEAR LOG NOTICE      Informational  PEAR  LOG INFO   formatted by CSS style 1og  info     Debug level messages  PEAR  LOG  DEBUG  formatted by CSS style log  debug    e Advice messages  PEAR LOG  TIP  added for VM   formatted by CSS style 1og tip    Please note that Debug log entries are only shown to the user  when DEBUG is enabled by configuration     To log an event  you can use a special function for each log level         vmLogger   emerg   My emergency message to the user 
18. mplates can be found in the directory  htm1 templates basket      The special about the basket is that there are four different templates  Two for displaying the Cart content in   cluding Tax  basket b2c html php and ro basket b2c html php  and two for displaying the Cart  content without tax  adding it afterwards    basket  b2b html php and ro basket b2b html php     b2c   Business to Customer  prices include tax   b2b   Business to Business  prices don t include tax     The basket files are included in  html shop cart php   html basket php  amp     html ro  basket php and in the  htm1 checkout index php except that the ro basket  file is dis   played on the last step of the checkout  when the cart contents can t be modified any more   ro basket   read  only basket      The concept in the basket templates is another one than in the other template files  because loops are used  So  we have a minimum number of PHP statements  which can be easily understood by designers without much  PHP knowledge     The variables which have been prefilled in  htm1 basket php and  html ro basket php are just  printed out in the templates     5  Creating or modifying Extensions    Besides core modules  you can also add shipping and payment modules into VM  The concept of both   shipping  and payment modules is to provide an API with a defined specification  similar to an interface   where the mod   ules can plug themselves in  The modules implement the required functions and thus can communicat
19. new shipping module will be auto   matically recognized  by reading its ini   File  and presented to you as an additional shipping method under the    Tab  Shipping      You can now select it and save the Configuration     6  About the Project    6 1  CVS Access  6 1 1  VirtueMart Source Code    This project has its CVS repository on the sourceforge net CVS Server  You can checkout the module  VirtueMart from cvs sourceforge net  In order to obtain the source anonymously  read only  you need to  know the following     Connection Type  pserver   CVS Server  cvs sourceforge net  CVSROOT   cvsroot virtuemart  Module Name  virtuemart   User  anonymous  no password required     Warning    The CVS server is case sensitive  Fill in the details in your CVS Program  e g  www tortoisecvs org   http   www tortoisecvs org  for Windows  just as they are provided here     6 1 2  Documentation Sources    The VirtueMart Project manages its documentation in the DocBook format  You can checkout the sources in the  DocBook format and transform the DocBook source using an XSL Transformer into PDF  HTML  CHM or  whatever else    All you have to do is checkout the module documentation from cvs sourceforge net     Connection Type  pserver  CVS Server  cvs sourceforge net  CVSROOT   cvsroot virtuemart    Module Name  documentation  User  anonymous  no password required     Warning    The CVS server is case sensitive  Fill in the details in your CVS Program  e g  www tortoisecvs org   http   www tort
20. o vendor id  edate mos  pshop  shopper vendor xref vendor name  uerino id Pig       tax state  contact last name id tax_country  user id t last user id  vendor  id contact  first name address_type  shopper_group_id contact middle name address type name  mos  pshop  state customer number a A company  state  id PO iiao phone 2 je m   mos pshopshipping carier  country  id eg shipping  carrier id  P  Sate Dame mer pop podus pe parameter   Conaettax fuse boc  stale 3 code product  type id  PK  vendor phone phoned shipping carrier  list  order  slate  2  code parameter name  PK  vendor address d P h  ne rZ  parameterlabel     vendor  address 2 ux  parameter description vendor oiby aad  parameter list order vendor state ddas  mos pshop product votes parameter type wander suni d n pesto ein  product  id parameter values vendor zip state shipping rate carrier id  votes parameter_multiselect vendor store name country shipping  rate country  allvotes parameter_default vendor_store_dese zip shipping rate zip start  rating parameter unit vendor category  id iar wind apoie cele sip  end  lastip    vendor thumb  image extra  field 4 shipping rate weight start  mos pshop  product  reviews vendor full  image extra field 2 shipping rate weight end  EPECTUETUTEBETSM product id vendor currenoy extra  field 3 shipping rate value  oe comment odate extra_field_4 shipping  rate  package  fee  AEA Fen mdate   extra  field 5 shipping  rate  currency id    ime vendor image  path cdate shipping  rate va
21. oisecvs org  for Windows  just as they are provided here     6 2  Documentation    This documentation was written using XMLMind XML Editor  http   www xmlmind com xmleditor  using the       18    VirtueMart Developer Manual       DocBook  http   www docbook org  XML Format     DocBook defines a set of markup elements useful for marking up text so that the text can then be transformed  into several different formats  It s possible to create documents in different formats  PDF  HTML  HTML Help    chm Files for Windows Help   XML  RTF  TeX  WordML  Word 2003  and others  The author of this docu   ment uses eDE  http   docbook e novative de   for generating the End User documents  The idea is to write just  once and reach the largest possible number of people with the information  Digital information not stored prop   erly tends to get lost  Due to the fact that not containing uncommon characters  such as binary formats  it s pos   sible to index and search directly on the documents written on SGML and consequently on DocBook  The  SGML systems use markups to make their description  DocBook holds over 300 markup elements each one  with several attributes which can assume several values  these can be fixed or defined by the document   style  that the author has used     6 3  Homepage  Forum    The project homepage is http   virtuemart net     There we also have a forum and you are invited to join our developer board        
22. ols the Cart on the last step of checkout  ro    read only      administrator components com_virtuemart html templates   Contains Templates for some pages     basket Templates for Cart Display        browse Templates for Product Listing Pages  can be  assigned in the Category Form        order_emails Templates for the Order Confirmation Email     product  details Templates for the Product Details Pages    administrator components com virtuemart languages   Contains the Language Files which are included from virtue   mart  parser php    administrator components com  virtuemart sql     Holds SQL Dump Files for building up the structure for the tables used  by VirtueMart      components com  virtuemart   Holds the files wich are used to control the call of the Shop from the  Frontend     Important files       virtuemart php  the file included by Joomla on a call to in   dex php option com virtuemart amp             VirtueMart Developer Manual        components com_virtuemart css      components com_virtuemart js       virtuemart parser php  the central file for VM  prepares  the session  authentication  cart  amp  runs functions       show image in imgtag php  used to display dynamically re   sized images   using the class img2thumb php     Contains the shop s css file  shop  css  and css styles needed for the  frontend administratin  admin css     Contains Javascripts  WebFX   Tabs  JSCookTree and the IE   PNG Transpareny Fix      components com virtuemart shop image     Tip   
23. ping modules are located in the directory   administrator components com virtuemart classes shipping   and have three files  the class file  the information file and the configuration file     Example  Module  myShipping        VirtueMart Developer Manual       You must have three files  called      myShipping php  including the class myShipping     myShipping ini  containing the Name of the Module  amp  the Author and the File Version       myShipping cfg php  containing all necessary configuration constant definitions     When activated in the Shop configuration  this payment module will be loaded on the shipping method selection  screen  beside all other activated shipping modules     The shipping rate  a user has selected during checkout is passed from step to step by the parameter ship   ping rate id     This parameter follows a strcit syntax and must be a string build like this   ShippingClassNamelcarrier namelrate nameltotalshippingcostslrate id  For our example the shipping rate id for one rate could be    myShippinglMy CarrierlMy Rate Namel45 00    The last field  rate id  can be left empty  The shipping rate id parameter is always passed as an urlencoded  string     5 2 2  The Shipping API specification    The following is a list of all methods that must be implemented by a shipping module s class file     string list rates  Array  d    Lists all available shipping rates     Tip    The array  d contains the values for the cart total weight  Sd    weight    and the I
24. single product in the product listing  So you can only modify the con   tents of the boxes  which are filled with product information in the product listing of a category  The number of  those  boxes    which are displayed in a single row of the product listing   can be changed in the Category Form  of that category  see Number of Products per row  or globally in the Shop Configuration  for the case that no  category_id is passed to the Shop         VirtueMart Developer Manual       Browse  or product listing  templates can be found in  html templates browse    They are loaded and filled with content in the file  htm1 shop browse php     The concept is to define placeholders in the template and replaced them by the real contents on load  This is  done using the PHP function str_replace     The following placeholders are used     L    4 2 3  Order Confirmation Email Templates    Order Confirmaton Email Templates define the layout of the confirmation email that is sent out to a user after  having placed an order        These Email templates can be found in  html templates order_emails      They are loaded and filled with content in the file  classes ps_checkout php  function  email_receipt        The concept is to define placeholders in the template and replaced them by the real contents on load  This is  done using the PHP function str_replace     The following placeholders are used      s    4 2 4  Basket Templates    Basket templates control the layout of the basket   The te
25. sion  sess    The current cart contents  The array has the following structure      cart    gt  Array     idx    gt  1   0    gt  Array     quantity    gt  1   product_id    gt  10   description    gt  Size big  Power 100W       In this example  the car contains one product with the quantity of 1  the product ID 10  and a description     The index  idx  is an integer and contains the size of the cart  number of different  products in it  regardless of their quantity   This variable is always available in the  global  _SESSTION array    SESSION  cart             All the user information in one Array  always available in the global  _SESSION ar   ray         auth    gt  Array         show prices    gt  1  user id    gt  0  username      demo  perms    gt   first_name    gt  guest    last_name    gt   shopper_group_id    gt  5       shopper_group_discount    gt  0 00  show price including tax    gt  1  default shopper group    gt  1  is registered customer    gt     These are the example settings for an unregistered  not logged in user     Mainly used to format and print URLs for the Shop     3 3 4  Logging events with the vmLogger object    VirtueMart allows logging events that occur during the execution of the script The global variable   vmLogger  which is used for logging purposes is an object of the class Log display  This class is a child  class of the Log class  which is a PEAR extension     Note    You must declare    global  vmLogger     to be able to use this variable 
26. t id  user rating vendor terms of service mdate Sinning ite it  order  review  ok vendor url perms  mos pshop  product  product  type   ref     review  votes vendor min  pov Tos pshop onder payment   Predera __ vendertieeshipping s ae os_pshep_shepper_atoup ordera  product_type_td  Fi  bt  ounenoy disp layse Jnopper group  id PK  pretfuct  type T4 P1 payment method id  is product typ amp  iff vendor id product type name order payment code       mos  pshop  product  price  product price id  PK   product  id   product  price   product currency    order payment  number  order payment  expire  order payment name  order  payment  log  otder payment trans  id    shopper  group  name   product_type_description  shopper group  desc product type publish  shopper group  discount product type browsepage  show  price  including  tax product type  flypage  default  product type  list order    mos pshop  product discount  discount id  PK  Li  amount manufacturer  id                                                                                                                                  product price wdate pep p  N  product  price edate   product  id  cdate attribute  name Sroda mos_pshop_product_download  mdate mos pshop product category xref     attribute_list attiibute  name product id  shoppet_group_id  saegon id FIQ       attribute value userid  price_quantity_start product id  FK      order_id  price  quantity end Palit mos_pshop_order_history andiaate    order status history i
27. table mos_vm_modules     Calling index php com_virtuemart  amp page shop  browse in your Joomla site would let VM include  the file     administrator components com_virtuemart html shop browse php     3 3  Core Modules  amp  their Functions  Environment  Variables    3 3 1  Core Modules    In order to ease with which new features can be added to mp  the concept of using modules has been introduced   A module defines a feature set of VM by providing class files and html layouts related to that particular module   It is very important to understand how modules work since everything  including the shop  is a module     Each module is defined and set in the VM module register  The module definition form allows the site adminis   trator to define the information for each module  e g  the module name  the perms of this module and its descrip   tion     You can reach the module list in the administrative interface using  Admin    gt   List Modules      Example  The core module  product  is one entry in the table mos vm  module  Its pages must be called using      amp page product         If the user has appropriate permissions  the page is loaded   if not  an error message is  generated     3 3 2  func    Each core module has a list of functions that can be executed  For example  to add a product into the system  a  function called productA dd exists in the tablemos  vm function     When you add a product  you pass the hidden variable func with a value of productAdd to the system  b
28. ts roots in a Shop Script called phpShop  This script was developed by Edikon Corp  and the phpShop  community  see www phpshop org  http   www phpshop org       VM was forked from phpShop version 0 8 0 at the end of the year 2003  It was maintainend and developed un   der the name Joomla phpShop until September 2005  In October 2005it was renamed to VirtueMart        VirtueMart Developer Manual       2 2  Differences to phpShop    VM still contains some code parts from phpShop  but experiences phpShop coders will see similarities     So when you have experience with phpShop or you are to integrate an existing Add On for phpShop into VM   you will have to know what is the difference between both scripts     1  Parameter Renames Changes  VM has introduced several new parameters and parameter name changes     page Syntax Change Most important is the change of the page parameter syntax from a pattern  like  shop index  to  shop index  just to provide support for Search Engine Friendly   SEF  links in your Joomla site  All references to the paramter page that contain a slash  instead of a dot will not be recognized and VM will print out  module not found  error     offset Outdated removed The offset parameter was completely replaced by the parameter  limit   start   which is Joomla standard for page navigation  Although there s a global  workaround to fill  offset with the value of  limitstart it s not recommended to work with    offset   limitstart The limitstart parameter is th
29. ttribute   returns the value of the attribute speci   fied by  nameOfTheAttribute or   when it s not available   the value of   vars  nameOfTheAttribute        Print  echo  the value of an attribute of the record set  method p  string  nameOfTheAttribute     db   p   email        Alternative  method sp  string  nameOfTheAttribute   prints the value of the attribute speci   fied by  nameOfTheAttribute or   when it s not available   the value of   vars  nameOfTheAttribute        Get the number of returned records  method num rows  void       if  Sdb  gt num_rows    gt  0       we have a record set  jJ    3 6  User Integration    VM uses Joomla s user table jos users for the User Management  Users which are no customers  have just  empty values in their additional customer fields in that table     There can be users who are no customers  but there can t be customers who are no registered users on the  Joomla Site     The Shop has an own registration procedure which adds all entries for the additional user fields durch  assigning  the customer to a shopper group  to a vendor           11    VirtueMart Developer Manual         jos  users contains BillTo Address Information      jos vm user info contains ShipTo Address Information  when the customer has added ShipTo Ad   dresses       jos vm order user info contains a copy of the BillTo   amp ShipTo  Address at the moment when an  order is placed       4  Modifying the Layout    The most important part of the Layout of your Shop is
30. uemart classes   Holds all the core classes which are used by VM Important   e ps database php  wrapper for Joomla s database object   database       ps cart php  controls the cart contents       ps main php  nota class  contains central functions  e g  for image  upload       ps session php  basic session management  URL formatting      administrator components com virtueiunt  itussesl  phtly modified version of PEAR s Log class       3    VirtueMart Developer Manual        administrator components com_virtuemart classes shipping   Contains Shipping Modules  amp  their informational Files     administrator components com_virtuemart classes payment   Contains Payment Modules  amp  their informational Files     administrator components com_virtuemart classes pdf    Contains the classes of the HTML2FPDF Package  see source    forge net projects html2fpdf  http   sourceforge net projects html2fpdf     administrator components com virtuerontt aisthes yiyphgpuifHitteclass for VirtueMart   administrator components com virtuemart classes phpmailer    Contains the classes of the phpMailer Package  also used by Joomla and    Mambo    see phpmailer sourceforge net    http   phpmailer sourceforge net        administrator components com_virtuemart html   Holds files which are used for presentation of HTML Code     They are ordered by shop core module name  e g  checkout   php for the  core module checkout     Important files     e basket  php  controls the Cart       ro basket php  contr
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
Samsung NP-R538E User Manual (FreeDos)  Cynus T7 User's Manual  Guide d`utilisation et d`installation Régulateur d`ambiance  電磁ブレーキ付モータ - Panasonic  SCRIBE EC WITH SIGNATURE IV INSTALLATION  Samsung CL-29M2MQ Manual de Usuario  User Guide - Archives - The Apache Software Foundation!    Copyright © All rights reserved. 
   Failed to retrieve file