webalive Posted March 26, 2016 Share Posted March 26, 2016 Hi all, I'm trying to display the default category name on product page in 1.6 version.But it seems I can only retrieve the current category name <a href="{$link->getCategoryLink($product->id_category_default,-$category->name)}">{$category->name}</a> category_default-> name doesn't work.. if someone can help... My week-end would be better.. thanks Link to comment Share on other sites More sharing options...
ventura Posted March 26, 2016 Share Posted March 26, 2016 Try this <a href="{$link->getCategoryLink($product->id_category_default)}">{$product->category}</a> 1 Link to comment Share on other sites More sharing options...
webalive Posted March 26, 2016 Author Share Posted March 26, 2016 thanks that's nice... Link to comment Share on other sites More sharing options...
dasteralo Posted May 31, 2016 Share Posted May 31, 2016 Hello, I've just read your post for the same problem and that works perfectly. great!! But how can i disable the hyphen in category name? Thank you very much for your help Link to comment Share on other sites More sharing options...
vekia Posted May 31, 2016 Share Posted May 31, 2016 what you exactly meam by hyphen? maybe some example what you want to disable? Link to comment Share on other sites More sharing options...
dasteralo Posted June 1, 2016 Share Posted June 1, 2016 (edited) Thank you for your answer! I need the default category to be displayed (This is what i've got) so I've put this code: <a href="{$link->getCategoryLink($product->id_category_default)}">{$product->category}</a> And here is the result (BROOKE-GREGSON) i do not want the - to be displayed http://www.hod-boutique.com/brooke-gregson/1044-bracelet-cuff-4-tanzanites.html Please help.Thank you very much Edited June 2, 2016 by dasteralo (see edit history) Link to comment Share on other sites More sharing options...
dasteralo Posted June 2, 2016 Share Posted June 2, 2016 (edited) Do i have something else than $product->category to put in the code in order to have the default category name with spaces instead of "-" I've tried with $category->name but that display the actual category and not the default category Edited June 2, 2016 by dasteralo (see edit history) Link to comment Share on other sites More sharing options...
dasteralo Posted June 2, 2016 Share Posted June 2, 2016 I think i've found the solution here https://www.prestashop.com/forums/topic/167600-how-to-show-the-name-of-the-default-category-in-the-producttpl/?p=817345 That would have been better if i did not have to modify core file but that's the only solution i found. 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