Nasa's Space Shuttle Atlantis Transiting the SunGarmin Edge 205 GPS Cycle Training ToolTank Wars in G3DA Simple 2D Terrain ModelReading Email with PHP and IMAP/POP3Spooky Case of the Wem Ghost
compton11:58 am, Monday, 4 December 06 |
|
the page=product.product_form parameter is exploded on '.'. This gives two values (ie there can only ever be one fullstop in this parameter value), the first indicates the name of the module, the second the page name. The appropriate content for the page is thus included with PAGEPATH.$modulename.".".$pagename.".php" (the exploding on '.' is completely redundant so far - perhaps it's used within the included page?).
A search for this product.product_form.php page locates it within \administrator\components\com_virtuemart\html. The form is created in PHP, using a formFactory class. The labels for the form elements are taken from the language file, as you'd expect. The tabs are handled by the mShopTabs PHP class. To start it off, we call startPane(), and each tab is enclosed by calls to startTab() and endTab(). So, to change the featured item text, which is currently 'On special', we have to change the _PHPSHOP_PRODUCT_FORM_SPECIAL language constant. |
|
compton12:08 pm, Monday, 4 December 06 |
|
Rather than creating a new Specials module, it would maybe be best to create a custom Featured module instead. After all, the existing module which is currently being used for the featured item has all the functionality required for a special offers module. | |
compton11:02 am, Tuesday, 5 December 06 |
|
The Featured Product module PHP is found at /modules/mod_virtuemart_featureprod.php. So far the "Special Offers" image and "See all offers" link have been added, as a table above the existing content.
Next I would like to format the items on display in this module to match Kashif's design. Currently the ps_product::show_snapshot() method is used to do this. What I need to do is display the image alone, within a table formatted to match the design. I have already added the boolean $display_vertical parameter to the ps_product::show_snapshot() function, and this parameter determines whether to show the product info to the right of the image (true) or below it (false). If this parameter is changed to string, and renamed to say $display_type, the ps_product::show_snapshot() function can be adapted to generate the correct format for snapshots shown in Featured Items, Special Offers, and Top 10. It would also be straightforward to add new display types for other modules as required. |
|
compton10:20 am, Thursday, 7 December 06 |
|
I managed to get a module to appear on the static 'Special Offers' page I created. To do so, I had to change the database manually, so that there was a record in the modules_menu table with a moduleid of 38 and a menuid of 27. I got these values by examining the query which is executed by initModules() in the /includes/frontend.php file.
Now I can do this, I can create a new Special Offers module, and have it display only on the static Special Offers page. This new module can be based on the existing one, but showing all special offers. Kashif's design for this page groups all special offers into their categories. Each product on special appears as a single link within a category box. This has the drawback that when there are different numbers of products on special in different categories, these lists will be a bit messy looking. An alternative is to 'showcase' 6 special offers, chosen at random, at the top of the page. Below that, special offers are then listed as simpler links, possibly ordered by category. Perhaps showcase items should also appear in the lower list? |
|
compton11:12 am, Saturday, 24 March 07 |
|
This particular site was completed some time ago. The customer was extremely pleased, which is always a good result!
The special offers module is available here. You can also see how it appears on the front page here. |
|
Leave a comment |