Skip to main content

πŸ“¦ Custom Warehouses Integration Guide

This guide will show you how to integrate your own warehouse and stock system with the Estimated Delivery module in PrestaShop.
No coding experience is needed β€” we’ll explain everything clearly so anyone can follow along.


πŸ“ What Are Custom Warehouses?​

In some stores, products can be shipped from different locations (warehouses).
Each warehouse may have different stock levels and shipping times.

The Estimated Delivery module lets you connect your own warehouse system using two simple hooks.


πŸ”§ What You Need to Do​

You need to create a small module (or use our sample) that:

  1. Tells Estimated Delivery which warehouses exist.
  2. Provides the stock quantity of each product in each warehouse.

πŸ“Œ The Two Hooks You Must Use​

1. actionEDGetWarehousesList​

This hook sends a list of your warehouses.

2. actionEDGetWarehouseQuantities​

This hook sends stock quantity for a product, split by warehouse.


πŸ“‚ Example Output for Each Hook​

Hook 1: Warehouses List​

Your module must return data like this:

[
[
'id_warehouse' => 1,
'name' => 'Main Warehouse',
'priority' => 0, // Lower = higher priority
'default_warehouse' => true, // Only one warehouse can be true
'location' => 'Barcelona'
],
[
'id_warehouse' => 2,
'name' => 'Backup Warehouse',
'priority' => 1,
'default_warehouse' => false,
'location' => 'Madrid'
]
];

Note: Only one warehouse can have default_warehouse => true.


Hook 2: Product Quantities per Warehouse​

When Estimated Delivery asks for stock, your module should return something like:

[
1 => 25, // Warehouse ID 1 has 25 units
2 => 10 // Warehouse ID 2 has 10 units
];

What You Receive in $params​

When this hook is called, you will receive:

KeyDescription
id_productThe product ID PrestaShop is checking
id_product_attributeThe combination ID (0 if the product has none)

πŸš€ Use Our Sample Module​

We created a ready-to-use module called edcustomwarehouses. It shows exactly how to use the hooks with sample data.

You can start with this, and replace the static data with real warehouse info.

Want the module? Download Here (Link to ZIP or repo)


βœ… Final Checklist​

  • Create or use the sample module (edcustomwarehouses).
  • Register the two required hooks in your module:
    • actionEDGetWarehousesList
    • actionEDGetWarehouseQuantities
  • Return a valid warehouse list with correct structure:
    • Only one warehouse should have 'default_warehouse' => true.
    • All warehouses must have unique id_warehouse.
  • Return correct product stock per warehouse.
  • Replace static sample data with your dynamic warehouse and stock data.
  • Test and verify delivery estimates are shown correctly on product and cart pages.

Estimated Delivery​

Check it on 🌐smart-modules.com Check it on 🌐PrestaShop Addons

πŸ’¬ Need Help?​

Contact Smart Modules support β€” we’re happy to help!

🌐 Support for Purchases on smart-modules.com 🌐 Support for Purchases on the Addons Marketplace