erginaktasw Posted February 15, 2013 Share Posted February 15, 2013 Dear Friends, I want to add new field like (product name, reference or UPC ...) to add new product page, and save it to database like other product info for using it on front product page. I configured informations.tpl file and add needed field as; <tr> <td class="col-left"><label>{$bullet_common_field} {l s='rURL:'}</label></td> <td style="padding-bottom:5px;"> <input size="55" type="text" name="rURL" value="{$product->rURL|htmlentitiesUTF8}" style="width: 130px; margin-right: 44px;" /> <span class="hint" name="help_box">{l s='Special characters allowed:'}.-_#\<span class="hint-pointer"> </span></span> </td> </tr> I also added new column to database table products, name called "rURL". Now what should I do for field content to be saved related column and to be edited like other product fields? My prestashop is 1.5. Please Help, Ergin, Link to comment Share on other sites More sharing options...
razaro Posted February 15, 2013 Share Posted February 15, 2013 Try to override Product class http://doc.prestashop.com/display/PS15/Overriding+default+behaviors#Overridingdefaultbehaviors-OverridingPrestaShop'sclassesandcontrollers and check this topic, I didn't try it but think it could help you http://www.prestashop.com/forums/topic/159759-override-model-definition/ Link to comment Share on other sites More sharing options...
erginaktasw Posted February 18, 2013 Author Share Posted February 18, 2013 Ok, i also modified classes/product.php adding lines below; public $rURL; and 'rURL' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'), among other fields. Then when i try to add new product it gives error "An error occurred while creating object. product" and create empty product. I feel i am on the right way but what i am missing? Please help guys.. Link to comment Share on other sites More sharing options...
erginaktasw Posted February 21, 2013 Author Share Posted February 21, 2013 Nobody help? Link to comment Share on other sites More sharing options...
marcis Posted March 21, 2013 Share Posted March 21, 2013 First, you should override the Product Class instead of modify it. Second, you need to give more information in order to someone can help you. Regards Link to comment Share on other sites More sharing options...
erginaktasw Posted March 21, 2013 Author Share Posted March 21, 2013 Hi Marcis, thanks for you reply. What kind of override is it? What i am trying to do; I want to enter a website link (my another website's product page link) while adding new product, that is why I need new field. Then I will get that link info from database to product page, together with other product info, and will use it for redirect. However, system gives error and doesn't add any information to database after the modification I made Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now