antoniobaby78 Posted May 11, 2017 Share Posted May 11, 2017 Goodmorning everyone,I ask for help at the forum.I have a custom field and I would like to show it in the product list.In the product page the field is shown without problems but in the product list I can not show it. Please help me?My prestashop version 1.6.1.13 Link to comment Share on other sites More sharing options...
BalzoT Posted May 11, 2017 Share Posted May 11, 2017 Hi there what field would you like to show in the product list? Link to comment Share on other sites More sharing options...
antoniobaby78 Posted May 11, 2017 Author Share Posted May 11, 2017 Hello, The field I would like to show is this: <h3 class="book-subtitle">{$belvg_textarea|escape:'html':'UTF-8'}</h3> This field in product.tpl is displayed without any problems Link to comment Share on other sites More sharing options...
BalzoT Posted May 11, 2017 Share Posted May 11, 2017 I suppose that you use a purchased theme on your Prestashop. In order to show the same field on product list you should add the necessary information on smarty through the controller of any page that uses a product list. For example in the categoryController you should to public function initContent() and on the smarty assignments add the data needed. There is a case though that if your theme is purchased it may have overridden some controllers of your installation so you may have to do some extra search in order to find the place to add your extra code. Link to comment Share on other sites More sharing options...
antoniobaby78 Posted May 11, 2017 Author Share Posted May 11, 2017 Hello, Thank you very much for your help. Unfortunately I do not really know where to put your hands to make this kind of modification. I would like to be able to show the field also on the product-list page but not so much like doing! I'm using this free form for the custom field. https://belvg.com/blog/how-to-create-a-custom-product-tab-in-prestashop.html Link to comment Share on other sites More sharing options...
BalzoT Posted May 11, 2017 Share Posted May 11, 2017 Unfortunately although you used a module to show an extra tab in the product page, you can't avoid the modification of a Prestashop core file. You will have to override the Category controller file, which is in this path ROOT_DIRECTORY/controllers/front/CategoryController.php you can find more information here. In the controller you will have to retrieve the info from the database for each product and then show it in the category.tpl file. I'm sorry that I can't help you more but I can walk you through this type of customisation only if I see your files. Link to comment Share on other sites More sharing options...
antoniobaby78 Posted May 11, 2017 Author Share Posted May 11, 2017 What kind of files do you need to see? Can I attach here? Link to comment Share on other sites More sharing options...
antoniobaby78 Posted May 11, 2017 Author Share Posted May 11, 2017 Hello, Thanks a lot for the answer. When I insert the new hook in the file: belvg_samplemodule The backend does not open, I get an error Link to comment Share on other sites More sharing options...
antoniobaby78 Posted May 11, 2017 Author Share Posted May 11, 2017 (edited) Hello, Unfortunately continues to receive error. See attached file I think I've put the code well belvg_samplemodule.php Edited May 11, 2017 by antoniobaby78 (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