Jump to content

Edit History

ps8modules

ps8modules

And can you be specific about what you need to rewrite?
Have you discovered the Product.php override and the hookActionProductFormBuilderModifier yet?

e.g.:

use Symfony\Component\Form\Extension\Core\Type as FormType;
use PrestaShopBundle\Form\Admin\Type\FormattedTextareaType;
use PrestaShopBundle\Form\Admin\Type\TranslateType;

public function hookActionProductFormBuilderModifier($params)
{
    $formBuilder = $params['form_builder'];

    $allFields = $formBuilder->all();

    foreach ($allFields as $inputField => $input) {
        $formBuilder->add($input);
        if ($inputField == 'reference') {
            $formBuilder->add(
                'custom_reference', 
                 TextType::class, 
                 ['label' => 'Custom reference']
            );
        }
     }
  }

 

ps8modules

ps8modules

And can you be specific about what you need to rewrite?
Have you discovered the Product.php override and the hookActionProductFormBuilderModifier yet?

e.g.:

public function hookActionProductFormBuilderModifier($params)
{
    $formBuilder = $params['form_builder'];

    $allFields = $formBuilder->all();

    foreach ($allFields as $inputField => $input) {
        $formBuilder->add($input);
        if ($inputField == 'reference') {
            $formBuilder->add(
                'custom_reference', 
                 TextType::class, 
                 ['label' => 'Custom reference']
            );
        }
     }
  }

 

×
×
  • Create New...