Got it π This is a very common (and important) requirement for PrestaShopβespecially for Google Merchant / SEO / structured data.
Iβll break it down cleanly π
1οΈβ£ What are SKU, MPN, GTIN in PrestaShop?
| Field | Meaning | Used for |
|---|---|---|
| SKU | Stock Keeping Unit | Internal product tracking |
| MPN | Manufacturer Part Number | Google Shopping, Schema |
| GTIN | Global Trade Item Number (EAN / UPC / ISBN) | Google, Rich snippets |
π In PrestaShop:
- SKU = Reference
- GTIN = EAN-13 / UPC / ISBN
- MPN = NOT available by default (needs customization)
2οΈβ£ How to Add SKU (Reference)
Admin path:
Back Office β Catalog β Products β Edit product
β‘οΈ Go to Options / Stock / Details tab (varies by version)
- Reference β This is your SKU
- Can be set per combination also
β Already built-in β no extra module needed.
3οΈβ£ How to Add GTIN (EAN / UPC / ISBN)
PrestaShop already supports GTIN fields π
Admin path:
Catalog β Products β Edit β Options
Available fields:
- EAN-13 β GTIN-13
- UPC β GTIN-12
- ISBN β Books only
π‘ Google accepts any ONE GTIN.
4οΈβ£ How to Add MPN (Manufacturer Part Number)
β PrestaShop does NOT have MPN by default
β
You must add it manually (3 ways)
πΉ Option A: Use a Module (Easiest)
Search in Addons marketplace:
- βMPN Product Fieldβ
- βExtra Product Fieldsβ
- βGoogle Merchant Center modulesβ
These modules:
- Add MPN field in product page
- Support combinations
- Automatically inject into schema
β Best if you donβt want coding
πΉ Option B: Add MPN as a Product Feature (No Code)
Back Office β Catalog β Attributes & Features β Features
- Add new feature:
- Name: MPN
- Assign value per product
β Downside:
- Not ideal for Google schema unless you customize theme
- Treated as descriptive data, not technical
πΉ Option C: Add Custom Database Field (Best / Advanced)
Add MPN as a real product field.
1οΈβ£ Database
ALTER TABLE ps_product ADD mpn VARCHAR(64);
2οΈβ£ Override Product class
/override/classes/Product.php
public $mpn;
public static $definition = array(
'table' => 'product',
'primary' => 'id_product',
'fields' => array(
'mpn' => array('type' => self::TYPE_STRING, 'size' => 64),
),
);
3οΈβ£ Add input field in admin product form
(override AdminProductsController)
β οΈ Needs override index rebuild:
Advanced Parameters β Performance β Clear cache
β Best for:
- Google Merchant
- JSON-LD schema
- Multi-language not required
5οΈβ£ Showing SKU / MPN / GTIN on Product Page
Edit your theme file:
π themes/your-theme/templates/catalog/product.tpl
Example:
{if $product.reference}
<p><strong>SKU:</strong> {$product.reference}</p>
{/if}
{if $product.ean13}
<p><strong>GTIN:</strong> {$product.ean13}</p>
{/if}
{if $product.mpn}
<p><strong>MPN:</strong> {$product.mpn}</p>
{/if}
6οΈβ£ Adding SKU, MPN, GTIN in JSON-LD (Very Important)
Since you care about schemas (I remember π), this is crucial.
Example Product Schema:
"sku": "SKU123",
"mpn": "MPN-456",
"gtin13": "8901234567890"
In PrestaShop theme:
π templates/_partials/microdata-jsonld.tpl
Make sure:
skuβ referencempnβ custom fieldgtin13/gtin12β ean13 / upc
7οΈβ£ Google Merchant Rules (Important)
| Condition | What to send |
|---|---|
| GTIN exists | Send gtin only |
| No GTIN | Send mpn + brand |
| Custom product | Use identifier_exists = no |
8οΈβ£ Best Practice (Recommended Setup)
β SKU β Reference
β GTIN β EAN-13 / UPC
β MPN β Custom field (Option C)
β Brand β Manufacturer
β Schema JSON-LD β Enabled
Β
