开发者

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

开发者 https://www.devze.com 2023-03-13 09:08 出处:网络
I currently have a Joomla 1.5 site with VirtueMart installed. The hierarchy of product categories is something like:

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 some开发者_运维问答where, 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 ); 
0

精彩评论

暂无评论...
验证码 换一张
取 消