Another little hard-earned nugget here that will help you out if you’re developing a site with Cubecart…

So you have a product category and the only thing in it is sub-categories. So the landing page just shows an image of the subcategory, the title of the subcategory and the number of products in it. We want to add the description of that category. Here’s how to do it…

Open includes/content/viewCat.inc.php

Around line 73/74 you’ll see this block of code:

[cc lang=”php”]
$view_cat->assign(‘TXT_LINK_CATID’, $subCategories[$i][‘cat_id’]);
$view_cat->assign(‘TXT_CATEGORY’, validHTML($subCategories[$i][‘cat_name’]));
$view_cat->assign(‘NO_PRODUCTS’, $subCategories[$i][‘noProducts’]);
$view_cat->parse(‘view_cat.sub_cats.sub_cats_loop’);

Add the following line directly above that block:

[cc lang=”php”]
$view_cat->assign(‘TXT_BF_DESC’, $subCategories[$i][‘cat_desc’]);

Save and upload the file.

Open skins/{your skin}/styleTemplates/content/viewCat.tpl

Look for the section that begins:


In that area, add {TXT_BF_DESC} just before ({NO_PRODUCTS}).

Save and upload. That’s it. You can now style the text however you’d like.

My latest book, 'Enduring CSS' is out now

Get $5 off HERE ↠

Write and maintain large scale modular CSS and embrace modern tooling including PostCSS, Stylelint and Gulp