| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Parent Category ID on Search Page (products_t.tpl) | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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
__________________
Version 4.3.2 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() 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:
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful ![]() Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|