tk77axa Posted June 2, 2014 Share Posted June 2, 2014 (edited) I whant to add a pop-up link in a product page ... but visible only if that product is in one specific category i tried to add this in product.tpl : {if $category->id != 50} <p><a href="../popup/marimi_incaltaminte.html" onclick="window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800px,height=600px');" class="btn_size" data-toggle="modal" data-target="#sizeModal"> GHID MARIMI </a> </p> {/if} not working image atached Edited June 2, 2014 by vekia (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 2, 2014 Share Posted June 2, 2014 not working not working because? some error code etc? Link to comment Share on other sites More sharing options...
tk77axa Posted June 2, 2014 Author Share Posted June 2, 2014 (edited) the link apears in all categories .... not just in category id 50 Edited June 2, 2014 by tk77axa (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 2, 2014 Share Posted June 2, 2014 well, your code uses this variable: {if $category->id != 50} you defined it in controller? by default product page hasn't got this variable Link to comment Share on other sites More sharing options...
csschopper.com Posted June 2, 2014 Share Posted June 2, 2014 Hi, check {$category->id} is this 50? As your condition is {if $category->id != 50}, so it will display at all places other than category having id = 50. Thanks Link to comment Share on other sites More sharing options...
tk77axa Posted June 2, 2014 Author Share Posted June 2, 2014 well, your code uses this variable: {if $category->id != 50} you defined it in controller? by default product page hasn't got this variable no. how i do that? Link to comment Share on other sites More sharing options...
tk77axa Posted June 2, 2014 Author Share Posted June 2, 2014 (edited) well, your code uses this variable: {if $category->id != 50} you defined it in controller? by default product page hasn't got this variable how i define that in controler? please move this topic in english forum .... Edited June 2, 2014 by tk77axa (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 2, 2014 Share Posted June 2, 2014 ini productController.php file located in controllers/front/ directory there is an init content function, you can define it there :-) topic moved to english section Link to comment Share on other sites More sharing options...
tk77axa Posted June 2, 2014 Author Share Posted June 2, 2014 vekia As my status says, I'm a PrestaShop Newbie ..... please tell me if you whant, how exactly I do this? What i need to add or change in productcontroller.php? Link to comment Share on other sites More sharing options...
eduard02 Posted March 20, 2015 Share Posted March 20, 2015 (edited) As my status says, I'm a PrestaShop Newbie ..... please tell me if you whant, how exactly I do this? What i need to add or change in productcontroller.php? Solved with this: {if $category->id_category == 45} text just for products from category 45 {/if} {if $category->id_category == 65 OR $category->id_category == 70 OR $category->id_category == 71 OR $category->id_category == 72 OR $category->id_category == 73 OR $category->id_category == 74 OR $category->id_category == 75 OR $category->id_category == 76 OR $category->id_category == 77 OR $category->id_category == 78 OR $category->id_category == 79 OR $category->id_category == 80 OR $category->id_category == 81 OR $category->id_category == 82 OR $category->id_category == 83 OR $category->id_category == 84 OR $category->id_category == 85 OR $category->id_category == 86 OR $category->id_category == 87 OR $category->id_category == 88} text for multiple categories {/if} Edited March 24, 2015 by eduard02 (see edit history) 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