Skip to content

PrestaShop Category

This component helps you manage product categories in your PrestaShop store. It allows you to fetch lists of categories, filter them based on criteria like status or name, and update category details. It connects directly to your PrestaShop store to keep your automation data in sync.

How it Works

This component acts as a bridge between your Nappai automation and your PrestaShop store. When you configure it, it sends requests to the PrestaShop API to retrieve or update category information. It handles the security connection automatically once you link the correct credential. The component can return a list of categories, details about pagination for large datasets, and status information to confirm if actions were successful.

Connection & Credentials

This component requires configuring a credential in the Nappai panel before interacting with the external service:

  1. Go to the Credentials section in your Nappai panel.
  2. Create a new credential of the type PrestaShop and fill in the required fields (Shop URL and PrestaShop API Key).
  3. In your workflow, select the saved credential in the Credential input field of this node.

Note: You can generate your PrestaShop API key in your store by going to Advanced Parameters > Webservice. Make sure to enable the web service and grant the necessary permissions to the key.

Inputs

Mapping Mode

This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:

  • Fixed: You type the value directly into the field.
  • Mapped: You connect the output of another component to use its result as the value.
  • Javascript: You write Javascript code to dynamically calculate the value.

This flexibility allows you to create more dynamic and connected workflows.

Input Fields

The following fields are available to configure this component. Each field may be visible in different operations:

  • Operation: Select the PrestaShop operation to perform.
  • Query Type: Get categories list or a specific category by ID.
  • Category ID: The ID of the category to get, update, or delete.
  • Max Results: The maximum number of categories to return.
  • Category Name: The name of the category.
  • Description: The description of the category.
  • Parent Category: The parent category for the hierarchical structure.
  • Active: Whether the category is active or visible in the store.

Outputs

This component produces a Data output containing the result of the operation. You can use this data in subsequent steps, such as saving to a database, sending notifications, or triggering further automations.

Output Data Example (JSON)json

{ “categories_list”: [ { “id”: 25, “name”: “Electronics”, “active”: true, “level_depth”: 1, “image_url”: “/img/c/25.jpg” }, { “id”: 26, “name”: “Smartphones”, “active”: true, “level_depth”: 2, “parent_id”: 25 } ], “pagination_info”: { “total”: 42, “limit”: 50, “offset”: 0 } }

Connectivity

This component connects to your PrestaShop store via the selected credential. The output Data can be connected to other components in your workflow. Common connections include:

  • Database Components: To store fetched category lists for reporting or archival.
  • Filter Components: To refine the category data based on specific business rules.
  • CRM/ERP Systems: To synchronize category updates with external management tools.
  • Notification Tools: To alert teams when new categories are created or changes occur.

Usage Example

Imagine you need to generate a report of all active product categories for an inventory review. You can use this component to fetch the list. Set the Query Type to retrieve a list, use the Active field to filter only visible categories, and connect the Data output to a component that formats an email or saves the results to a spreadsheet. You can also use the Parent Category field to organize items by subcategory.

Tips and Best Practices

  • Use the Filters options to narrow down results and improve performance.
  • Enable Mapping Mode if you need to transform or rearrange data before passing it to the next step.
  • Check Pagination settings if your store has a large number of categories to avoid timeouts.
  • Ensure your PrestaShop API key has the minimum permissions required for your specific workflow.
  • Use Category ID to target specific categories when you need to update or delete a single item.

Security Considerations

Ensure your PrestaShop API key is stored securely within the Nappai credential manager. Never share your API key directly in workflow diagrams or logs. Always configure your API key with only the permissions necessary for the actions you intend to perform. Keep your API key up to date and rotate it periodically following best security practices.