phpdeveloper Posted February 1, 2014 Share Posted February 1, 2014 Hi, I need the details to add the product field details, i already tried but i am getting error... and also not storing the in db.... showing error messege : Property Product->gender has bad value (allowed values are: male, female). Thanks in advance.. Link to comment Share on other sites More sharing options...
vekia Posted February 2, 2014 Share Posted February 2, 2014 i already tried but i am getting error... and also not storing the in db.... how you added it and what error you've got? in addition, can you said something more what you changed (a little piece of code will be OK) Link to comment Share on other sites More sharing options...
phpdeveloper Posted February 3, 2014 Author Share Posted February 3, 2014 1. Added in themes/controller/product/information.tpl file <tr> <td class="col-left"> {include file="controllers/products/multishop/checkbox.tpl" field="gender" type="default"} <label>{l s='Gender:'}</label> </td> <td style="padding-bottom:5px;"> <select name="gender" id="gender" style="width: 140px; margin-right: 44px;"> <option value="both" {if $product->gender == 'both'}selected="selected"{/if} >{l s='Both'}</option> <option value="male" {if $product->gender == 'male'}selected="selected"{/if} >{l s='Male'}</option> <option value="female" {if $product->gender == 'female'}selected="selected"{/if} >{l s='Female'}</option> </select> </td> </tr> 2. Added in classes/product.php public $gender; 'gender' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGender', 'values' => array('both','male', 'female' ), 'default' => 'both'), in validate.php 'gender' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGender', 'values' => array('both','male', 'female' ), 'default' => 'both') for validate its working now but i am getting new error now An error occurred while updating an object. product () Plz help to solve this Link to comment Share on other sites More sharing options...
NemoPS Posted February 3, 2014 Share Posted February 3, 2014 Try turning on error reporting, so we know more about the issue Also, did you add 'gender' as database column for the product table? Link to comment Share on other sites More sharing options...
phpdeveloper Posted February 3, 2014 Author Share Posted February 3, 2014 ya i added db table.... Link to comment Share on other sites More sharing options...
NemoPS Posted February 3, 2014 Share Posted February 3, 2014 And what happens with error reporting enabled? Link to comment Share on other sites More sharing options...
vekia Posted February 3, 2014 Share Posted February 3, 2014 duplicated and solved http://www.prestashop.com/forums/topic/305620-add-new-product-field/?do=findComment&comment=1546704 Link to comment Share on other sites More sharing options...
phpdeveloper Posted February 5, 2014 Author Share Posted February 5, 2014 (edited) everything i have done, final error i got is show below An error occurred while updating an object. product () Error - i can update the existing product but i can't add a new product.... Edited February 5, 2014 by phpdeveloper (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted February 5, 2014 Share Posted February 5, 2014 Nothing if you enable error reporting? Link to comment Share on other sites More sharing options...
Recommended Posts