Jump to content

Add custom field from Nemo's newfieldstut module to product-list.tpl and homefeatured.tpl


Recommended Posts

Hi friends,


Using this tutorial on this page Adding new tabs and fields to Prestashop products’ back office, I was able to add a new field for author for products in my Prestashop. I was also able to display it on product page by adding Product.php to override/classes/ and inserting this code below:



class Product extends ProductCore
{
/** @var string Custom Product Field */
public $custom_field;
}

I then added {$product->custom_field} to product.tpl to display the new field.


My problem now is that the same code does not work when added to product-list.tpl and the homefeatured.tpl module files. Can any one explain how to achieve this? 


 


Thank you.


Link to comment
Share on other sites

homefeatured

you will have to modify sql query to get this new field in Category class getProducts() function

 

product lists

the same as above

 

what is your field name?

 

Thank you for your help.

I don't get what you meant by the field name, but the modules helps me add additional information for each product which can be displayed on the product page. In my case, I used it to display the name of artists for different music under the product title on the product page and I want it to show in product-list.tpl and homefeatured.tpl too.

I don't know if I make sense, I am only good at following tutorials.

:(

Link to comment
Share on other sites

  • 1 year later...

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...