![]() |
Parent Category ID on Search Page (products_t.tpl)
Hi,
I'm trying to retrieve a parent category id for products on the search results page. There doesn't seem to be any variables that refer to a category name/id/etc. Is there a way for me to create a new variable? I'm using this for the category pages: {if $current_category.parentid eq 249 || $cat eq 249}{else}{/if} and would want to recreate this same structure on the search page. Thanks! Jenny |
Re: Parent Category ID on Search Page (products_t.tpl)
Search results can contain products from different categories...
You can try creating a Smarty modifier for the purpose and further use it like this: {$product.productid|get_parent_category} in the templates. To create a new Smarty modifier plugin create the "include/templater/plugins/modifier.get_product_parent_category.php" script with the following content: PHP Code:
|
All times are GMT -8. The time now is 02:50 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.