Pragati P Posted December 22, 2022 Share Posted December 22, 2022 Hello I had tried to display the category description on product detail page but it is not displaying and mess up all page below syntax i have use to display description {if $category.description} <div id="category-description" class="text-muted">{$category.description nofilter}</div> {/if} I have to display on product detail page can you help me how can I show it and in which file need to do modification Link to comment Share on other sites More sharing options...
Piotr3qx Posted December 22, 2022 Share Posted December 22, 2022 Hi, unfortunately this is not possible to code within a .tpl file. You need to write a module to display the category description on the product page. Are you familiar with writing custom modules? Link to comment Share on other sites More sharing options...
Pragati P Posted December 22, 2022 Author Share Posted December 22, 2022 No I am not familiar that much but I can do it if got some guidance Link to comment Share on other sites More sharing options...
Piotr3qx Posted December 22, 2022 Share Posted December 22, 2022 https://github.com/Piotr3qx/categorydesconproductpage - I wrote a quick minimal version of the module. It's not ideal, you would need to implement a cache for this module 1 Link to comment Share on other sites More sharing options...
Pragati P Posted December 22, 2022 Author Share Posted December 22, 2022 Thanks for your instant reply And thanks for you solutions I will go through it and try to implement it Link to comment Share on other sites More sharing options...
Pragati P Posted December 22, 2022 Author Share Posted December 22, 2022 Can you please send the structure where need to put this code because I tried but doesn't work for me. Link to comment Share on other sites More sharing options...
ps8modules Posted December 22, 2022 Share Posted December 22, 2022 Man, he gave you a link to the whole module. download it from github as a zip and install it. Link to comment Share on other sites More sharing options...
ps8modules Posted December 22, 2022 Share Posted December 22, 2022 52 minutes ago, Piotr3qx said: https://github.com/Piotr3qx/categorydesconproductpage - I wrote a quick minimal version of the module. It's not ideal, you would need to implement a cache for this module Hi. Please can you put it on github as a zip module? Link to comment Share on other sites More sharing options...
Pragati P Posted December 22, 2022 Author Share Posted December 22, 2022 42 minutes ago, prestashopfree.com said: Man, he gave you a link to the whole module. download it from github as a zip and install it. Their are only 2 files in github code one is controller and another is .tpl it wouldn't be upload thats why I said for whole structure Link to comment Share on other sites More sharing options...
ps8modules Posted December 22, 2022 Share Posted December 22, 2022 (edited) The name of the module dir must be the same as the name of the php file. Then you need to add the index.php file. https://devdocs.prestashop-project.org/1.7/modules/creation/tutorial/ Edited December 22, 2022 by prestashopfree.com (see edit history) 1 Link to comment Share on other sites More sharing options...
Pragati P Posted December 22, 2022 Author Share Posted December 22, 2022 No its not working the description is not showing their. can any of you send exact where need to place this file Link to comment Share on other sites More sharing options...
Piotr3qx Posted December 22, 2022 Share Posted December 22, 2022 Download the attached file, go to Module managment and install it. You install just like any other module categorydesconproductpage.zip 3 Link to comment Share on other sites More sharing options...
Pragati P Posted December 22, 2022 Author Share Posted December 22, 2022 Thanks @Piotr3qx Thank its working fine and displaying the text. Thank you so much. Link to comment Share on other sites More sharing options...
Pragati P Posted December 23, 2022 Author Share Posted December 23, 2022 Hello @Piotr3qx I need little more help from you. The module you have send its working fine but I need to show that details on popup on same page it could be possible? Link to comment Share on other sites More sharing options...
Piotr3qx Posted December 23, 2022 Share Posted December 23, 2022 Which version of bootstrap are you using? And I'm not quite understand where you wanna have this button with popup? Instead of displaying category description? Or in differente place? Link to comment Share on other sites More sharing options...
Pragati P Posted December 23, 2022 Author Share Posted December 23, 2022 Version is not specified I will share you the link of bootstrap https://ebinger-test.lcmx.at/modules/tvcmsthemeoptions/views/css/bootstrap-toggle.min.css Below are some screenshot where i need to show that popup in which the category discription will display Link to comment Share on other sites More sharing options...
Pragati P Posted December 23, 2022 Author Share Posted December 23, 2022 Image having red square box need to show chat icon there Link to comment Share on other sites More sharing options...
Piotr3qx Posted December 23, 2022 Share Posted December 23, 2022 In categorydesconproductpage.php change public function install() { return (parent::install() && $this->registerHook('displayProductAdditionalInfo') ); } to public function install() { return (parent::install() && $this->registerHook('displayProductActions') ); } and replace categorydesconproductpage.tpl with <button type="button" class="btn btn-primary ml-2" data-bs-toggle="modal" data-bs-target="#categorydesconproductpage-modal">ICON</button> <div id="categorydesconproductpage-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="{l s='Close' d='Shop.Theme.Global'}"> <span aria-hidden="true"><i class="material-icons">close</i></span> </button> <p class="modal-title h6">Category description</p> </div> <div class="modal-body"> {$description nofilter} </div> </div> </div> </div> or if it is not working with <button type="button" class="btn btn-primary ml-2" data-toggle="modal" data-target="#categorydesconproductpage-modal">ICON</button> <div id="categorydesconproductpage-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="{l s='Close' d='Shop.Theme.Global'}"> <span aria-hidden="true"><i class="material-icons">close</i></span> </button> <p class="modal-title h6">Category description</p> </div> <div class="modal-body"> {$description nofilter} </div> </div> </div> </div> Then reset the module. You will need to correct the HTML code to display the icon you want 1 Link to comment Share on other sites More sharing options...
Pragati P Posted December 23, 2022 Author Share Posted December 23, 2022 Thank you Its working fine you are having great knowledge of prestashop thanks Link to comment Share on other sites More sharing options...
Pragati P Posted December 23, 2022 Author Share Posted December 23, 2022 59 minutes ago, Piotr3qx said: In categorydesconproductpage.php change public function install() { return (parent::install() && $this->registerHook('displayProductAdditionalInfo') ); } to public function install() { return (parent::install() && $this->registerHook('displayProductActions') ); } and replace categorydesconproductpage.tpl with <button type="button" class="btn btn-primary ml-2" data-bs-toggle="modal" data-bs-target="#categorydesconproductpage-modal">ICON</button> <div id="categorydesconproductpage-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="{l s='Close' d='Shop.Theme.Global'}"> <span aria-hidden="true"><i class="material-icons">close</i></span> </button> <p class="modal-title h6">Category description</p> </div> <div class="modal-body"> {$description nofilter} </div> </div> </div> </div> or if it is not working with <button type="button" class="btn btn-primary ml-2" data-toggle="modal" data-target="#categorydesconproductpage-modal">ICON</button> <div id="categorydesconproductpage-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="{l s='Close' d='Shop.Theme.Global'}"> <span aria-hidden="true"><i class="material-icons">close</i></span> </button> <p class="modal-title h6">Category description</p> </div> <div class="modal-body"> {$description nofilter} </div> </div> </div> </div> Then reset the module. You will need to correct the HTML code to display the icon you want I have added description to the category it working fine on localhost but in live it doesnt show any thing https://ebinger-test.lcmx.at/home/167-testing-product.html you can check the above link Link to comment Share on other sites More sharing options...
Pragati P Posted December 23, 2022 Author Share Posted December 23, 2022 https://prnt.sc/f5YOw-OzScAD also modify the code and cleared the cache Link to comment Share on other sites More sharing options...
Pragati P Posted December 30, 2022 Author Share Posted December 30, 2022 Hi @prestashopfree.com Can we make our product name dynamic on changing of attributes or we can append the attributes value to product title? I have search the file like displayAjaxRefresh() function in ProductController but didn't work. Can you have any idea related to this? 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