Jump to content

New field in a Product. Done but something is missing.


Recommended Posts

Hi, i'm creating a new field in my products.

Theory is simple:

1. Create a field 'measure' in ps_product table

2. We need to let it now to "product class" classes/product.php
2.1 - Line 150 aprox. /*** @var string Measurement Unit (optional)*/ public $measure;
2.2 - Line 163 aprox. added this to fielsize" , 'measure' => 32 "
2.3 - Line 190 aprox. ", 'measure' => 'IsGenericName' "
2.4 - Line 261 aprox. added to getters "$fields['measure'] = pSQL($this->measure);"

3. In admin/tabs/AdminProducts.php around line 1565, I insert just an imput like this:
'.$this->l('Selling unit:').'
<input type="text" size="33" name="measure" value="'.htmlentities($this->getFieldValue($obj, 'measure'), ENT_COMPAT, 'UTF-8').'" /> * ('.$this->l('Whenever differs, like m2 or whatever').')

And all is working (database is getting updated in it´s correct field) except for I get an error message when updating a product wich says:

1 error
1. an error occurred while updating object product (Unknown column 'measure' in 'field list')

Sorry??? What am I missing? Where is that error?

Thanks in advance.

Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More