Tuesday, September 22, 2009

Under 18 Clubs Southern Nj

Virtuemart: a hack to hide empty categories

  • For users of Virtuemart. In
  • This hack shows how we have overcome a typical limitation of most popular E-commerce for the CMS Joomla.
  • You can see the results on the site
  • www.autovenneri.com
  • created by us. Issue: The category pages contain a list of all their sub-categories each showing the number of products, even if it is zero. / / components / virtuemart / themes / [theme used] / common / categoryChildlist.php
    and look for the line containing the code: foreach ($ categories as $ category) {
    if ($ icle == 1) {/ / this is an indicator wether a row needs to be Opened or not
    echo "\\ n";}

    ?>
    grafting the code below in red

    foreach ($ categories as $ category) {
    if (($ category ['number_of_products']) == "(0)") continuous, / / \u200b\u200bhack
    if ($ icle == 1) {/ / this is an indicator wether a row needs to be Opened or not
    echo "\\ n";}

    ?>

    This simple condition that prevents content from being displayed without the categories, using the command "continue" inside the foreach loop that generates the Table of category names.


    0 comments:

    Post a Comment