| 1.2. Differences to phpShop |
| Prev | Chapter 1. Introduction | Next |
|---|
VM still contains some code parts from phpShop, but experienced phpShop coders will find 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.
Parameter Renames/Changes
VM has introduced several new parameters and parameter name changes.
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.
Outdated/removed The offset parameter was completely replaced by the parameter "limitstart", 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.
The limitstart parameter is the replacement for offset and can be used just like this.
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.
Database Interface
VirtueMart has its own database class:
ps_DB. This database class has been
completely modified to be a wrapper class for the Joomla Standard
Database Class 'database'. The new filename is
ps_database.php.
VM doesn't connect to the database, but it uses the connection Joomla! has built up. This is for optimal performance since only one open DB connection is needed at runtime.
Database Structure
Table names have changed and got a prefix!! Use
#__{vm}_tablename instead of tablename. The
#__ 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
database.
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:
auth_user_md5 (jos_users stores passwords)
intershipper
language
sessions
Separation into "Component" and "Modules"
A Joomla! site consists of various elements like components, modules, templates and mambots (called plugins since Joomla! 1.5) - most likely you will know components, modules and templates. A Component is the Main Part of the Page in the "Mainbody". It can have its own configuration/interface.
Modules are "Side Blocks" surrounding the Mainbody. There are Modules for the Frontend and the Backend.
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 Maintenance, Admin.