Over Extended Virtuemart Extensions
By Bob Bloom | April 26, 2008
The new Virtuemart came with a brand new website: http://extensions.virtuemart.net/.
The purpose:
The “VirtueMart Extensions Directory” is a Collection of Links for Modules, Modifications and other Scripts that extend, improve or modify VirtueMart.
What is the difference between this and the VM Forum’s “Development Projects, Modifications, Hacks & Tweaks (For VM 1.1)“?
These new extensions mimic Joomla extensions. They use the Joomla installer. This new site mimics Joomla’s extension site.
Most notably, under the “Listing Rules“:
Hacks which alter VirtueMart source code must do so through the standard Joomla! install and uninstall process. Uninstalling should revert any changes made to VirtueMart source code.
Joomla extension developers are not supposed to touch the Joomla source code. Joomla is the development platform and developers build from there.
Well, let me tell you: Virtuemart is not a development platform in the same way that Joomla is a development platform. Joomla extensions do not modify the Joomla source code. Well, I’m constantly modifying the VM source code.
My add-ons & client work have me elbow deep in the guts of VM’s source code constantly.
I may call them “add-ons”; yet, a more accurate term would be “rebuild-ons”, because I’m rebuilding Virtuemart. I am doing something to VM’s core fiiles.
We’re all doing something to VM’s core files.
Since my “rebuild-ons” modify VM’s core files, I emphasize in my readme files that their installation is a surgical procedure.
If someone has already modified a VM file that I’ve modified for my add-on, then you have to carefully copy-paste my changes to your modified file.
You can’t just copy my entire file over your modified file because you will lose your existing modifications.
I am paranoid about people blithely destroying their existing mods because they uploading my files when they should be copy-pasting php snippets instead. This is why I emphasize this risk in my Gift Wrap readme:
The surgical procedure to add my Gift Wrap feature to your VM 1.0.13a installation will go ok for those who are comfortable with php source files *and* with phpMyAdmin (or other MySQL utility).
If you are not comfortable, spare yourself frustration and have me perform your surgery. Contact me at info@southlasalle.com. I charge one hour of my time (assuming no complications!).
If you are performing your surgery yourself, I urge you to take your time. One wrong semi-colon and your site will experience the “White-Screen-of-Death”.
If you have other modifications to VM, then you absolutely MUST NOT blithely overwrite your files. Oh no, disaster!
You must know which of your VM files are modified. If one of those files happen to be a file I’ve changed for my Gift Wrap feature, then you have to copy-paste my code to the proper place within that file!
If you have an untouched, clean VM 1.0.13a installation, then you can overwrite your files.
My experience bears this out over and over again: rename (backup) your files first! Then, upload my files.
Rename your files first! That’s my talisman for your happiness! If you don’t, you’ll FUBAR your site.
No one has clobbered their existing mods (yet) with their DIY installations. Or, maybe no one has confessed! Most likely, people have “scrubbed up” and taken care with the surgical procedure of overlaying my hack on top of other hacks.
So, I’d like to know how these VM extensions are really supposed to work.
How is my automated installation supposed to sense that ps_product.php already has a hack, so that my installation routine preserves that hack? Then, how is my automated installation supposed to overlay my hack on top of the existing hack(s)? Hey, ps_product.php is a popular source file. There might be several hacks in there already!
How is my automated un-installation routine supposed to excise my hack while preserving other hacks? What if someone installs another hack after installing mine? Will my automated un-installation know that there’s more hacks than before to preserve?
My add-ons are all “rebuild-ons”. Nearly every file you download from me is a core VM source file. So I will continue to list my work on VM’s forum, instead of the new extension website.
I see that there the first two VM extensions are now listed on the VM extensions site. This is exciting! You mean I can see the full universe of hacks/add-ons/rebuild-ons in a professional looking listing? Yeah Baby, bring it on! Yowza!!
But whoa! Hold on there, fella! DO THESE FIRST TWO EXTENSIONS MODIFY A VM SOURCE FILE? We must always ask ourselves this question.
Well, let’s take a look.
Sigsiu’s extension is the com_vmsyndicate.zip file, which is a Joomla extension and installs via the Joomla installer. This Joomla extension affects Virtuemart; however, it is still a Joomla extension. None of its files are Virtuemart source files. SIGSIU: THANK YOU FOR LISTING YOUR EXTENSION!
Surpass.nl’s VM 1.1 Theme is a — well — VM 1.1 Theme. This will be a popular download! Absolutely no source files are touched. VM 1.1 themes remind me of WordPress themes. There’s a folder called “themes” and you upload the files to this folder. SURPASS.NL: THANK YOU FOR LISTING YOUR NEW THEME!
So, no, these extensions do not modify VM source files. Whew!
I cannot list my “rebuild-ons” here — I’d love to! — but there’s this profound installation issue to figure out first. Heck, my Gift Wrap “rebuild-on” modifies an existing database table too!
This is what I see happening:
The automated installation requirement is completely unrealistic for “rebuild-ons” that modify VM source files. You can be sure that I’ll be alerting my clients to stay away from the siren song of the automated installs, because the risk posed by the automated installation is existential!
When these automated installations destroy VM sites, the hue-and-cry will be, shall we say, visceral.
I see: the automated installation requirement will be dropped.
I see: a new graphic labelled “modifies source code” displayed for those “rebuild-ons” that modify core VM source files.
I see: a new menu item under “User Menu” called “Installing Extensions That Modify Core VM Source Files”, detailing the general surgical procedure.
What do you think about this?
-Bob
Topics: VM 11, Virtuemart |

April 27th, 2008 at 10:53 am
what happens if you install an extension which modifies joomla source code, then install another extension which further modifies the same joomla source modified by the first extension. Wouldn’t the first extension stop working?
then what happens when you uninstall the second extension. Do you go back to the original joomla source code, or do you go back to the joomla source code after installing the first extension.
Don’t you think that this quickly becomes unworkable when you install more than one extension?
April 28th, 2008 at 8:11 am
Brian, thanks for your comment.
Overlaying hacks, modifying hacks, hacks by different people — all in the same file!
This is why I call it “surgery”!
And it really needs each hack to be clearly identified and explained with comments. Which is why I liberally comment my hacks.
-Bob
May 9th, 2008 at 3:56 am
I agree wholeheartedly with your comments. It would be infinitely more beneficial to separate the mods/hacks from the forum. Listing them in one central, organized location would make them easier to find a single set of instructions and warnings could be provided for each. It would have been nice if the change could have occurred before the new 1.1 forums were created. I’ve always been frustrated when I find a hack I am interested in but have to read 25 pages just to get the low-down on what needs to be done to get it working.
I don’t think the extensions area and requirements were well thought out at all.
June 24th, 2008 at 9:05 pm
That is the unfortunate nature of making tweaks and hacks - you can’t expect updates to keep up with your own modifications. One thing I think will keep you afloat is to understand the inner workings of virtuemart and devise your own system of overwriting and updating files on a constant basis.
Good luck!
June 24th, 2008 at 9:25 pm
The lexicon itself lends a particular lack of credibility to the efforts of those that extend VM’s features. The words “tweaks” and “hacks” almost connote an unsavoury use of base software.
However, there is nothing “tweaky” or “hacky” about the add-on that I am releasing tonight that give the checkout process the features it needs to support VM’s downloadable products; features that VM 1.1.0 sorely lack.
As well, Virtuemart is open source and obviously its popularity, besides it being free, is the ability to modify it. It is no coincidence that the VM forums have a hacks/tweaks thread because the more add-ons available, the more attractive VM becomes. Isn’t this the case for Joomla.
Ah, Joomla. It is built so that third party developers write extensions. Joomla itself, especially version 1.5.x, is a platform for developers to write extensions.
Ah, VM. It is not in the slightest a platform for developers to write extensions. It is a software application, pure and simple. If it turns out that what you are doing does not touch core files, terrific. More likely, ps_checkout.php, ps_order.php, and ps_product.php need to be modified.
It is not a case of incompetent people tearing apart VM because they do not know better, or that they lack professional pride or training. Rather, the nature of VM itself demands that the core files be modified whenever a new feature is required. The only way to modify the checkout process is to get into the checkout files. There is no API, there are no business rule tables, there is nothing that allows me to truly “extend” VM a la Joomla.
Go ask all the developers who contribute their “hacks” and “tweaks” via the VM forum if they “understand the inner workings of virtuemart”.
-Bob