Tepster Posted September 26, 2013 Share Posted September 26, 2013 Hello, how I can get the root category of currently opened product in product.tpl? Please, help me. Thank you Link to comment Share on other sites More sharing options...
yaniv14 Posted September 26, 2013 Share Posted September 26, 2013 Hi, I am not sure its possible with Smarty. You can probably get 'category_default'. I would probably suggest getting it with javascript from the Breadcrumb. I might be wrong on my first point..... Link to comment Share on other sites More sharing options...
vekia Posted September 26, 2013 Share Posted September 26, 2013 by root category you mean main product category ? Link to comment Share on other sites More sharing options...
Tepster Posted September 27, 2013 Author Share Posted September 27, 2013 (edited) I don't know what do you mean with "main product category"... For example: I have this categories: Computers - Disks - HDD - SSD - Mouse - Keyboard - wireless ... And I everytime need get the current category - Computers. (Sorry for my bad English) Edited September 27, 2013 by Tepster (see edit history) Link to comment Share on other sites More sharing options...
Mr.Bean_S Posted September 27, 2013 Share Posted September 27, 2013 First of all, are you talking about Front Office (that customers see) or when editing your product.tpl ? My guess is that you mean that customer is viewing a wireless keybord and you want them to go to the root of all computer stuff and directly to "Computers" instead of to Keyboard? I had the opposite problem when I didn't have a path above to choose from. In my case the product was both in sub category and main (home) category and Home was default. That was easy to fix however. No tpl-files involved thou. Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 27, 2013 Share Posted September 27, 2013 First of all, are you talking about Front Office (that customers see) or when editing your product.tpl ? My guess is that you mean that customer is viewing a wireless keybord and you want them to go to the root of all computer stuff and directly to "Computers" instead of to Keyboard? I had the opposite problem when I didn't have a path above to choose from. In my case the product was both in sub category and main (home) category and Home was default. That was easy to fix however. No tpl-files involved thou. Hi, you can select the parent categories when you add a product. It can be a subcategory or a home category or both! Link to comment Share on other sites More sharing options...
yaniv14 Posted September 27, 2013 Share Posted September 27, 2013 If you have Computers as the product Default category, you can use '{$product.category_default}' Link to comment Share on other sites More sharing options...
Mr.Bean_S Posted September 27, 2013 Share Posted September 27, 2013 (edited) Hi, you can select the parent categories when you add a product. It can be a subcategory or a home category or both! Yes, but if for the wireless product have "Home" as default category he can't go back to keybords since the path above disapere and he has to go to start page, then select computers, then select Keyboard, then select wireless and THEN finally be able to pick next keyboard model. If he has Keyboard as default category however he can see the whole path above the picture and can select to go to any category he wishes by one click. Edited September 27, 2013 by Mr.Bean_S (see edit history) Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 27, 2013 Share Posted September 27, 2013 Yes, but if for the wireless product have "Home" as default category he can't go back to keybords since the path above disapere and he has to go to start page, then select computers, then select Keyboard, then select wireless and THEN finally be able to pick next keyboard model. If he has Keyboard as default category however he can see the whole path above the picture and can select to go to any category he wishes by one click. That is true, the by Selecting the home as the default parent, it will not have other paths attached to it unless you added them after. Link to comment Share on other sites More sharing options...
Recommended Posts