Jump to content

Insert custom field in product-list.tpl


antoniobaby78

Recommended Posts

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

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

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.


Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...