blietzkrieg Posted February 26, 2011 Share Posted February 26, 2011 Hi Guys! I need help on how to display the current category name on a certain tpl file. I mean im using another module and i want to display the category on top of its block. On the image i try to put it on top before the CLEAR ALL BUTTON but inside that block. Its not the categories block by the way and its on a different .tpl file thats why i was having problem on what variable i call to display it out.I hope you could help me on this problem guys. Thanks. Link to comment Share on other sites More sharing options...
otzy Posted February 27, 2011 Share Posted February 27, 2011 look at the code from blockcategories hookLeftColumn: $this->currentCategoryId = NULL; if (isset($_GET['id_category'])) { $cookie->last_visited_category = intval($_GET['id_category']); $this->currentCategoryId = intval($_GET['id_category']); } if (isset($_GET['id_product'])) { if (!isset($cookie->last_visited_category) OR !Product::idIsOnCategoryId(intval($_GET['id_product']), array('0' => array('id_category' => $cookie->last_visited_category)))) { $product = new Product(intval($_GET['id_product'])); if (isset($product) AND Validate::isLoadedObject($product)) $cookie->last_visited_category = intval($product->id_category_default); } $this->currentCategoryId = intval($cookie->last_visited_category); } if your module is hooked after blockcategories you may use intval($cookie->last_visited_category) for id_categoryif before (or you want it to be independent) - use above code. Link to comment Share on other sites More sharing options...
blietzkrieg Posted February 28, 2011 Author Share Posted February 28, 2011 Thanks @otzy Your idea was great. This is a big help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now