Jump to content

Add extra attribute to the product instance using module 1.7


giwrgos88

Recommended Posts

Hello, I'm working on a module and I want to extend the product class in order to add an extra attribute to the class. I want this attribute to be available on product list page, category page, product page etc.

Basically I want to add a boolean attribute if the product is preorder or not

Does anyone knows how i can do it? 

 

PRestashop 1.7 and 1.6

Edited by giwrgos88 (see edit history)
Link to comment
Share on other sites

On 4/20/2018 at 7:12 AM, jgamio said:

Depend on your Prestashop version on 1.6 you can use something like these

http://nemops.com/new-customer-address-fields-prestashop/

 

On 1,7 you need use the hooks to be able to got information on your module to after show on the tpls

 

 

 

 

 

 

I don't want to add extra fields, I just want to extend the existing Product class with my module and add an extra attribute called preorder(boolean)

Link to comment
Share on other sites

  • 2 weeks later...

I found out how to override the product class but the issue is that the attribute always has the value 1 even if i add false or a date as a value. any ides? 

 

here is my code 

https://pastebin.com/nesKN8iW

 

does anyone know what i'm doing wrong? basically I want to make a module where the admin can set a date to a product if it is preorder and I want each product to have this extra attribute, in the checkout process for example, on single page or on the home page where you display the products. 

 

Note: I don't want to store this attribute inside the product table

Edited by giwrgos88 (see edit history)
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...