Wednesday 28 January 2009

how Virtuemart present the shop page

1) virtuemart.php:
if( file_exists( PAGEPATH.$modulename.".".$pagename.".php" )) {
...
include( PAGEPATH.$modulename.".".$pagename.".php" );
// this file is: administrator/components/com_virtuemart/html/shop.index.php

2) shop.index.php:
$tpl = new $GLOBALS['VM_THEMECLASS']();
...
$tpl->set( 'categories', $category_childs );
...
$tpl->set('ps_product',$ps_product);
...
echo $tpl->fetch( 'common/shopIndex.tpl.php');
// to theme the output, the template file, components/com_virtuemart/themes/default/templates/common/shopIndex.tpl.php, is needed.

3) shopIndex.tpl.php:

you can remove the shop description/the word of 'categories',
or remove the featured prodcuts in codes, but this also can be done in admin-components-virtuemart-admin-configuration-site-layout-Select the theme for your Shop-default-configuration)

if( $this->get_cfg( 'showFeatured', 1 )) {
/* featuredproducts(random, no_of_products,category_based) no_of_products 0 = all else numeric amount
edit featuredproduct.tpl.php to edit layout */
echo $ps_product->featuredProducts(true,10,false);
}
// ./featuredproduct.tpl.php will determine the layout for featured products.

No comments:

My photo
London, United Kingdom
twitter.com/zhengxin

Facebook & Twitter