PrestaShop - Update Product
Description
Section titled “Description”This module allows updating fields of a product in PrestaShop, identifying it by its product_id or reference. Supports updating basic information, prices, dimensions, SEO, and product status.
Configuration
Section titled “Configuration”Credentials
Section titled “Credentials”Before using this module, you need to configure PrestaShop credentials:
- Access your PrestaShop admin panel
- Go to Advanced Settings > Web Services
- Enable the web service
- Create a new API key with read/write permissions on “products”
- Save the generated API key
Credential Fields
Section titled “Credential Fields”| Field | Description | Example |
|---|---|---|
urlBase | PrestaShop store base URL (without /api) | https://my-store.com |
apiKey | API key generated in the backoffice | ABCD1234567890XYZ |
Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
credentials_id | string | Yes | PrestaShop credentials ID |
product_id | number/string | Conditional | Product ID to update |
reference | string | Conditional | Product reference (alternative to product_id) |
name | string | No | New product name |
price | number | No | Price without taxes |
wholesale_price | number | No | Cost/wholesale price |
description | string | No | Long product description |
description_short | string | No | Short description |
active | boolean | No | Active status (true/false) |
new_reference | string | No | New product reference |
ean13 | string | No | EAN13 code |
weight | number | No | Weight in kg |
width | number | No | Width in cm |
height | number | No | Height in cm |
depth | number | No | Depth in cm |
meta_title | string | No | SEO meta title |
meta_description | string | No | SEO meta description |
link_rewrite | string | No | SEO-friendly URL |
Either
product_idORreferenceis required to identify the product.
Output
Section titled “Output”{ "success": true, "product_id": 123, "fields_updated": ["name", "price", "active"], "message": "Product 123 updated successfully"}Error Output
Section titled “Error Output”{ "error": { "message": "Error updating product: [error description]" }}Usage Example
Section titled “Usage Example”Update product price
Section titled “Update product price”{ "credentials_id": "presta_tienda", "product_id": 123, "price": 29.99}Update product by reference
Section titled “Update product by reference”{ "credentials_id": "presta_tienda", "reference": "SKU-001", "name": "Camiseta Premium Edicion 2024", "price": 24.99, "active": true}Update SEO information
Section titled “Update SEO information”{ "credentials_id": "presta_tienda", "product_id": 456, "meta_title": "Camiseta Premium - Envio Gratis", "meta_description": "Descubre nuestra camiseta premium de algodon 100%. Envio gratis en pedidos +50EUR", "link_rewrite": "camiseta-premium-algodon"}Update shipping dimensions
Section titled “Update shipping dimensions”{ "credentials_id": "presta_tienda", "product_id": 789, "weight": 0.5, "width": 30, "height": 40, "depth": 5}Deactivate product
Section titled “Deactivate product”{ "credentials_id": "presta_tienda", "reference": "DISCONTINUED-001", "active": false}Usage with Dynamic Data
Section titled “Usage with Dynamic Data”You can use workflow data to dynamically update products:
// In a previous ExecuteScript nodectx.data = { product_id: ctx.data.producto.id, price: ctx.data.nuevo_precio, active: ctx.data.stock > 0};Example Workflow: Price Sync
Section titled “Example Workflow: Price Sync”[HTTP Trigger] -> [Get CSV data] -> [Loop] -> [PrestaUpdateProduct] -> [Notification]- HTTP Trigger: Receives webhook with price updates
- Get CSV data: Parses the price file
- Loop: Iterates over each product
- PrestaUpdateProduct: Updates price in PrestaShop
- Notification: Sends summary via email/Slack
- The module first gets the current product and then applies the updates
- Multilingual text fields (name, description) are updated in the default language
- If no fields are specified for update, the node returns a message indicating this
- The PrestaShop API uses XML internally, but the module handles the conversion automatically
Common Errors
Section titled “Common Errors”| Error | Cause | Solution |
|---|---|---|
| ”Missing credentials” | Empty urlBase or apiKey | Verify credential configuration |
| ”Product not found” | Incorrect ID or reference | Verify the product exists |
| ”Authentication error” | Invalid API Key | Generate a new API Key |
| ”No permissions” | API Key without permissions | Enable product permissions in the backoffice |
Related Nodes
Section titled “Related Nodes”- PrestaGetOrders - Get orders that include the product