
Shop Part
6
2.2.2. Shop Part
When the Shop is loaded, one of the first things is to load the file virtuemart_parser.php using
the require_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
Core modules are listed in the table mos_vm_modules.
Calling index.php?com_virtuemart&page=shop.browse in your Joomla site would let
VM include the file
/administrator/components/com_virtuemart/html/shop.browse.php.
2.3. Core Modules & their Functions,
Environment Variables
2.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 administrator to define the information for each module, e.g. the module name, the perms of this
module and its description.
You can reach the module list in the administrative interface using "Admin" # "List Modules".
Example: The core module "product" is one entry in the table mos_vm_module. Its pages must be
called using "..&page=product. ....". If the user has appropriate permissions, the page is loaded - if
not, an error message is generated.
2.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 productAdd exists in the table jos_vm_function.
When you add a product, you pass the hidden variable func with a value of productAdd to the system
(besides all the other form fields).
If the current user has the permissions to execute the function (permissions can be set for each function
separately), 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:
Comentários a estes Manuais