I am setting up a new 4.4.3 Gold store. I want to add tabs to my home and subcategory pages (like the tabs for the product pages). I want Featured products and Bestsellers to appear in tabs rather than in the traditional dialog menus. I have figured out the appearance part and it works, but I'm having trouble with the correct conditional to test for whether there are any Featured products.
I have made a new file in the include folder called welcome_tabs.php. It's modeled after the product_tabs.php. For the featured products tab, I have the following code:
Code:
if (!empty($f_products)) {
$welcome_tabs[] = array(
'title' => func_get_langvar_by_name('lbl_featured_products'),
'tpl' => 'customer/main/featured.tpl',
'anchor' => 'featured'
);
}
However, it does not allow Featured products to display even when I definitely have Featured products selected. If I get rid of the conditional part, I get the desired effect: 2 tabs - one for Featured products and one for Bestsellers. However, if I have no Featured products selected, a tab still appears for Featured products, but has no content. I don't want to be forced to select Featured products for the home page and every single subcategory, and I want my code to cover all possibilities. It seems as if $f_products is not the correct variable to test, but I can't figure out what might be the correct one. I have looked at featured_products.php and $f_products is all I can come up with. I have a feeling, though, that $f_products is only for template use so it is not recognized as a legitimate variable in a PHP file.
Does anyone have any ideas as to how I can get this to work properly? I did clear my X-Cart cache and temp files in case the problem was related to cached data, but it didn't solve the problem.
Thanks,
Jill