sscardefield Posted October 10, 2013 Share Posted October 10, 2013 I am trying to figure out how to add the manufacturer's part number to the individual product pages. I have sorted through quite a few threads but have come up empty handed. This seems like pretty basic functionality. Is there something I'm missing? Link to comment Share on other sites More sharing options...
vekia Posted October 10, 2013 Share Posted October 10, 2013 hello, what about "reference" field ? Link to comment Share on other sites More sharing options...
sscardefield Posted October 10, 2013 Author Share Posted October 10, 2013 (edited) I tried that, but I don't think it will do. It just doesn't cut it. "Reference: XXXXXXX". Some people might be able to look at that and figure out it is the part number, but the majority I don't think will. I need it to say "MPN: XXXXXX". I know I could probably just find out which .tpl that "Reference" is in and change it to "MPN, but I feel like it should be it's own field, like there should be a field in the product details page called MPN or something. I just went through a lot of the various places that I buy from online and every single one of them has at minimum a manufacturer part number listed and most also have a manufacturer listed, both in that same spot where Reference is. If there is no easy way to to accomplish that, does anybody know what .tpl that "Reference" is in? Edited October 10, 2013 by sscardefield (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 10, 2013 Share Posted October 10, 2013 in this case you have to extend product object and define new fields in database. (1) in ps_product table create field named "mpn" (2) in file: ADMIN/themes/default/template/controllers/products/informations.tpl right after code: <tr> <td class="col-left"><label>{$bullet_common_field} {l s='Reference:'}</label></td> <td style="padding-bottom:5px;"> <input size="55" type="text" name="reference" value="{$product->reference|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> add code: <tr> <td class="col-left"><label>{$bullet_common_field} {l s='Part number:'}</label></td> <td style="padding-bottom:5px;"> <input size="55" type="text" name="mpn" value="{$product->mpn|htmlentitiesUTF8}" style="width: 130px; margin-right: 44px;" /> </span> </td> </tr> effect: (3) open classes/Product.tpl file right after: class ProductCore extends ObjectModel { /** @var string Tax name */ public $tax_name; add: public $mpn; then right after: public static $definition = array( 'table' => 'product', 'primary' => 'id_product', 'multilang' => true, 'multilang_shop' => true, 'fields' => array( // Classic fields 'id_shop_default' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32), add: 'mpn' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32), (4) now your field works in back office well. Just modify product.tpl file and add code to display your new variable somewhere {$product->mpn} 3 Link to comment Share on other sites More sharing options...
sscardefield Posted October 10, 2013 Author Share Posted October 10, 2013 Awesome, thank you for taking the time to type that out, I really appreciate it. I'll give it a try tonight and report back. Link to comment Share on other sites More sharing options...
vekia Posted October 11, 2013 Share Posted October 11, 2013 how did it go? have you tried it? waiting for your response in this case thanks in advance, Milos Link to comment Share on other sites More sharing options...
marco94310 Posted December 3, 2013 Share Posted December 3, 2013 Hello vekia,I try to find a solution for 3 days now to add a field in prestashop 1.5.5, the category page with override imposiible but I tried everything but it does not work ... Is anyone can us help give us the steps please? Link to comment Share on other sites More sharing options...
ibndawood Posted December 3, 2013 Share Posted December 3, 2013 (edited) Hi, I am a prestashop developer as well as I run an online mobile shop. Usually products have lot of attributes. It is not required to add those attributes as separate fields unless you want them to be indexed. For example in mobiles we have so many attributes, technical specifications, etc. The best way to achieve them is to add them in product description (or short description if you want). I do that all the time . Like this : https://www.diigo.com/item/image/4h50p/91ak If you do not know HTML, you can simply use word document to create a table and use "Paste from Word" option in the Product Description editor to paste the table. (or if you know HTML you can simply create HTML tables) Hope this helps. Edited December 3, 2013 by ibndawood (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 3, 2013 Share Posted December 3, 2013 Hello vekia, I try to find a solution for 3 days now to add a field in prestashop 1.5.5, the category page with override imposiible but I tried everything but it does not work ... Is anyone can us help give us the steps please? what you exactly expect? i don't understand, guide above allows to create new field for product. you want to category? or what? Link to comment Share on other sites More sharing options...
ibndawood Posted December 4, 2013 Share Posted December 4, 2013 I almost forgot . You can also use features to display Part Numbers. https://www.diigo.com/item/image/4h50p/nc3k Link to comment Share on other sites More sharing options...
imagixel Posted February 3, 2016 Share Posted February 3, 2016 This was the only mod that actually worked. Thanks a lot. I know that PS 1.6 comes already with a "Supplier Reference" field, but never managed to get it on the Frontend because is on a diferent table. in this case you have to extend product object and define new fields in database. (1) in ps_product table create field named "mpn" (2) in file: ADMIN/themes/default/template/controllers/products/informations.tpl right after code: <tr> <td class="col-left"><label>{$bullet_common_field} {l s='Reference:'}</label></td> <td style="padding-bottom:5px;"> <input size="55" type="text" name="reference" value="{$product->reference|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> add code: <tr> <td class="col-left"><label>{$bullet_common_field} {l s='Part number:'}</label></td> <td style="padding-bottom:5px;"> <input size="55" type="text" name="mpn" value="{$product->mpn|htmlentitiesUTF8}" style="width: 130px; margin-right: 44px;" /> </span> </td> </tr> effect: (3) open classes/Product.tpl file right after: class ProductCore extends ObjectModel { /** @var string Tax name */ public $tax_name; add: then right after: public static $definition = array( 'table' => 'product', 'primary' => 'id_product', 'multilang' => true, 'multilang_shop' => true, 'fields' => array( // Classic fields 'id_shop_default' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32), add: 'mpn' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32), (4) now your field works in back office well. Just modify product.tpl file and add code to display your new variable somewhere {$product->mpn} Link to comment Share on other sites More sharing options...
nbarnum Posted August 10, 2016 Share Posted August 10, 2016 Could this be done with an override? Or does it have to go into the main class file? Link to comment Share on other sites More sharing options...
doanthitoan1960 Posted November 28, 2016 Share Posted November 28, 2016 Hello vekia Cant i add this to 1.7 version? Link to comment Share on other sites More sharing options...
Ezequielb Posted May 17, 2020 Share Posted May 17, 2020 On 11/27/2016 at 10:51 PM, doanthitoan1960 said: Hello vekia Cant i add this to 1.7 version? Any help for PS 1.7.6.5 version? Link to comment Share on other sites More sharing options...
HaCos Posted November 11, 2020 Share Posted November 11, 2020 On 5/17/2020 at 8:03 AM, Ezequielb said: Any help for PS 1.7.6.5 version? Any update? Link to comment Share on other sites More sharing options...
tasoschatzi Posted March 12, 2022 Share Posted March 12, 2022 Any update? Link to comment Share on other sites More sharing options...
mickeyboy1 Posted March 16, 2022 Share Posted March 16, 2022 Im pretty sure 1.7 versions already have MPN in the options tab of the product you are editing 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