php - Prestashop 1.7 adding custom field on admin product page -
i'm using prestashop 1.7.2.0 , want add backoffice product page in options tab. want add ean13 field, named ean13_current_shop have done far doesn't work.
in src/prestashopbundle/form/admin/product/productoptions.php added after original ean13:
->add('ean13_current_shop', 'symfony\component\form\extension\core\type\texttype', array(         'required' => false,         'error_bubbling' => true,         'label' => $this->translator->trans('ean-13 or jan barcodez', [], 'admin.catalog.feature'),         'constraints' => array(             new assert\regex("/^[0-9]{0,13}$/"),         )     )) in src/prestashopbundle/model/product/adminmodeladapter.php: after ean13:
'ean13_current_shop' => $this->product->ean13_current_shop, in src/prestashopbundle/resources/views/admin/product/form.html.twig after ean13 field:
<fieldset class="col-md-4 form-group">                     <label class="form-control-label">                       [spam-filter] form.step6.ean13_current_shop.vars.label [spam-filter]                       <span class="help-box" data-toggle="popover"                         data-content="[spam-filter] "this type of product code specific europe , japan, used internationally. superset of upc code: products marked ean accepted in north america."|trans({}, 'admin.catalog.help') [spam-filter]" ></span>                     </label>                     [spam-filter] form_errors(form.step6.ean13_current_shop) [spam-filter]                     [spam-filter] form_widget(form.step6.ean13_current_shop) [spam-filter]                   </fieldset> and edited product.php class directly. , added:
/** @var string ean-13 barcode */ public $ean13_current_shop; and
'ean13_current_shop' =>                        array('type' => self::type_string, 'validate' => 'isean13', 'size' => 13), i no error it, , not appear. not know else edit. thanks
 
 
Comments
Post a Comment