Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Prestashop Product Form

ASecurity

Skill for modifying the PrestaShop Product and Combination forms (V2) using Symfony Form Modifiers. Compatible PS 8.1+ and PS 9.

4 stars
0 votes
0 copies
0 views
Added 9/28/2026
developmentphp

Security Analysis

A100/100

Scanned 9/28/2026

Install to Claude Code

$npx -y skills add ecomyseo/prestashop_skills --skill prestashop-product-form --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prestashop Product Form?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Prestashop Product Form
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecomyseo-prestashop-product-form/badge)](https://www.skillsdirectory.com/skills/ecomyseo-prestashop-product-form)

More formats (shields.io, HTML) on the badges page.

Files
SKILL.md
---
name: prestashop-product-form
description: Skill for modifying the PrestaShop Product and Combination forms (V2) using Symfony Form Modifiers. Compatible PS 8.1+ and PS 9.
---

# PrestaShop Product Form Skill (V2)

This skill covers the modern way (PrestaShop 8.1+/9) to hook into and modify the product and combination forms in the back-office using the `FormBuilderModifier`.

> **IMPORTANT**: Product V2 fue introducido en PS 8.1. En PS 8.0 estos hooks NO existen. En PS 9 es el unico sistema.

## 1. Technical Guide

### Hooking into the Product Form
Use the `hookActionProductFormBuilderModifier` hook to access the form builder.

```php
declare(strict_types=1);

public function hookActionProductFormBuilderModifier(array $params): void
{
    // PS 8: se puede usar service locator
    // PS 9 (Symfony 6.4): usar constructor injection (ver seccion servicios)
    /** @var \PrestaShopBundle\Form\FormBuilderModifier $formBuilderModifier */
    $formBuilderModifier = $this->get('prestashop.bundle.form.form_builder_modifier');

    $formBuilder = $params['form_builder'];
    $productId = isset($params['id']) ? (int) $params['id'] : null;

    // Example: Adding a field to the description tab
    $descriptionTab = $formBuilder->get('description');
    $formBuilderModifier->addAfter(
        $descriptionTab,
        'description', // field to add after
        'my_custom_field',
        \Symfony\Component\Form\Extension\Core\Type\TextType::class,
        [
            'label' => $this->trans('My Custom Field', [], 'Modules.Mymodule.Admin'),
            'data' => 'current value', // fetch from DB in real usage
        ]
    );
}
```

### Hooking into the Combination Form
Use the `hookActionCombinationFormFormBuilderModifier` hook.

```php
public function hookActionCombinationFormFormBuilderModifier(array $params): void
{
    $formBuilder = $params['form_builder'];
    // Similar usage to product form
}
```

### Saving Custom Data
Use `hookActionAfterUpdateProductFormHandler` and `hookActionAfterCreateProductFormHandler`.

```php
public function hookActionAfterUpdateProductFormHandler(array $params): void
{
    $productId = (int) $params['id'];
    $formData = $params['form_data'];
    $customValue = $formData['my_custom_field'] ?? '';

    // Logic to save $customValue for $productId
}

// Tambien para productos NUEVOS
public function hookActionAfterCreateProductFormHandler(array $params): void
{
    $productId = (int) $params['id'];
    $formData = $params['form_data'];
    $customValue = $formData['my_custom_field'] ?? '';

    // Logic to save $customValue for $productId
}
```

### Hook Registration (install)
```php
public function install()
{
    return parent::install()
        && $this->registerHook('actionProductFormBuilderModifier')
        && $this->registerHook('actionAfterUpdateProductFormHandler')
        && $this->registerHook('actionAfterCreateProductFormHandler')
        && $this->registerHook('actionCombinationFormFormBuilderModifier');
}
```

## 2. Professional Development Guide

### Architecture Checklist
- **Modifiers**: Create a dedicated service class (e.g., `ProductFormModifier`) to handle the logic instead of putting it all in the main module file.
- **Form Types**: For complex modifications or new tabs, create custom `AbstractType` classes.
- **Dependency Injection**: Use `services.yml` to register your modifiers. En PS 9 (Symfony 6.4), `$this->get()` esta deprecated. Usar constructor injection.

### Service Registration (PS 9 compatible)
```yaml
services:
    MyModule\Form\ProductFormModifier:
        arguments:
            - '@prestashop.bundle.form.form_builder_modifier'
            - '@translator'
        public: true
```

### Custom Tabs
To add a new tab, you usually add a "Tab" (the header) and a "TabContent" (the vertical section). PrestaShop 8.1+ uses specific form types for this in the product V2 page.

### Compatibilidad PS 8.0 vs 8.1+
Si el modulo debe funcionar en PS 8.0 (Product V1), detectar la version:
```php
if (version_compare(_PS_VERSION_, '8.1.0', '>=')) {
    // Product V2 hooks disponibles
} else {
    // Usar displayAdminProductsExtra (legacy)
}
```

## 3. User Guide

### Requirements
- Product V2 hooks: PrestaShop 8.1+ y PrestaShop 9.
- En PS 8.0, usar `displayAdminProductsExtra` como alternativa.

## Rules & Best Practices
- **Strict Typing**: Always use `declare(strict_types=1);` in your modifier classes.
- **Namespace**: Classes inside `src/` must be properly namespaced.
- **Safety**: Verify if the field exists before using `addAfter` or `get`.
- **`ClassName::class`**: Usar libremente (valido desde PHP 5.5). Solo evitar `$obj::class` si se necesita compatibilidad con PHP < 8.0 (PS 8.0).

Attribution

ecomyseoecomyseo
View sourceMore from ecomyseo →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284972 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

10311 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →