Jump to content

The Right Way to Add Custom Product Variables/Fields?


Aaron Karp

Recommended Posts

I need to add a field to the Add/Edit Product pages. I know how to do this in terms of the PHP and MySQL code, but I'm not sure how to execute it in a way that won't get overwritten when I upgrade to newer versions of PrestaShop. From what I've gathered, I need to create an override that will extend Product.php to include the field, but I don't know how I can add the field to the Add/Edit page in a way that won't get wiped out when I upgrade. Can anyone point me in the right direction?

Thanks!

Link to comment
Share on other sites

  • 2 months later...

I ended up setting up Features and using them as custom fields. They can be used as booleans (for instance, one of my customers needed certain products to be flagged as eligible for fundraising programs, so I set up a "Fundraising" feature. If it was checked on a specific product, the product page showed a little flag to indicate that it was eligible. You can also set them up to contain other data, more in line with what they're intended to do, like Height and Width and stuff like that.

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