📦 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:
- Tells Estimated Delivery which warehouses exist.
- 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:
Key | Description |
---|---|
id_product | The product ID PrestaShop is checking |
id_product_attribute | The 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
.
- Only one warehouse should have
- 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.
Related Modules
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