Site icon PrestaShop | General Knowledge

PrestaShop How to add SKU MPN GTIN Products information

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?

FieldMeaningUsed for
SKUStock Keeping UnitInternal product tracking
MPNManufacturer Part NumberGoogle Shopping, Schema
GTINGlobal Trade Item Number (EAN / UPC / ISBN)Google, Rich snippets

πŸ‘‰ In PrestaShop:


2️⃣ How to Add SKU (Reference)

Admin path:

Back Office β†’ Catalog β†’ Products β†’ Edit product

➑️ Go to Options / Stock / Details tab (varies by version)

βœ… 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:

πŸ’‘ 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:

These modules:

βœ” Best if you don’t want coding


πŸ”Ή Option B: Add MPN as a Product Feature (No Code)

Back Office β†’ Catalog β†’ Attributes & Features β†’ Features

  1. Add new feature:
    • Name: MPN
  2. Assign value per product

❗ Downside:


πŸ”Ή 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:


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:


7️⃣ Google Merchant Rules (Important)

ConditionWhat to send
GTIN existsSend gtin only
No GTINSend mpn + brand
Custom productUse 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


Β 

Exit mobile version