简体   繁体   中英

VirtueMart Browse page shows subcategories and parent products - how to change order?

I currently have a Joomla 1.5 site with VirtueMart installed. The hierarchy of product categories is something like:

category a, with subcategory a1 and products 1,2,3 (the products belong to the category a, not subcategory a1)

On the 'category a' browse page I see a tile / box for subcategory a1, then products 1, 2 and 3.

I'd like to switch these round, so that the products directly associated with 'category a' are shown first, and the tile for 'subcategory a1' is shown afterwards.

I'm sure this is just a case of switching round 2 blocks of PHP somewhere, but I can't suss where!

Anyone able to help...?

The easiest method is to edit one of the following files (depending on your configuration) in directory /components/com_virtuemart/themes/default/templates/browse/includes/ :

browse_notables.php     (div layout) and/or
browse_layouttable.php  (table layout) and/or
browse_listtable.php    (table for product list)

Find the line:

<?php echo $browsepage_header; ?>

and move it to the end of the file (or before recent products if you prefer).

Please note that $browsepage_header contains various different content depending on how the virtuemart browse page is called, so you could have some collateral effects (the first i can think of is manufacturer description after product list).

A better method would be to add a $browsepage_footer variable, echoed in the bottom part of each of the above files, containing the child categories list when needed.

The category children list is created in the template file:

/components/com_virtuemart/themes/default/templates/common/categoryChildlist.tpl.php

and that result can be obtained editing the model file:

/administrator/components/com_virtuemart/html/shop.browse.php

Similar to as it is done in this snippet:

$browsepage_footer = $tpl->fetch( 'browse/includes/browse_orderbyformbottom.tpl.php' );
$tpl->set( 'browsepage_footer', $browsepage_footer ); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM