π¦ 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