This working method of the WooCommerce by AntsRoute plugin makes it possible to send WooCommerce orders manually or automatically to AntsRoute. Your customers do not have the possibility to choose the delivery date and time slot.
Here are the steps to follow to set up the plugin:
- Step 1 - Install the AntsRoute plugin on WordPress
- Step 2 - Manage the capacities of your vehicles on AntsRoute
- Step 3 - Get an API key from AntsRoute
- Step 4 - Set up the WooCommerce by AntsRoute plugin on WordPress
- Step 5 - Send the status of AntsRoute deliveries to WooCommerce using webhooks
- Step 6 - Manage the custom fields on AntsRoute
Step 1 - Install the AntsRoute plugin on WordPress
First, you must install the “WooCommerce Local Delivery Date Picker & Time Slots by AntsRoute” plugin on your WordPress website. To do this, you need to follow the steps below:
- Get the “WooCommerce Local Delivery Date Picker & Time Slots by AntsRoute” integration file by contacting us by email or directly from the WooCommerce marketplace.
- Login to your WordPress account.
- Go to “Extensions” > “Add new”.
- Click on the “Upload plugin” button.
- Click on the “Choose a file” button and select the file to be installed.
- Once the file name is displayed, click on the “Install Now” button.
- Click on the “Activate plugin” button.
Step 2 - Manage the capacities of your vehicles on AntsRoute
The “Number” and “Weight” capacities must be created in your AntsRoute account. These capacities make it possible to manage the quantities (number of items and weight) that each of your vehicles can carry during the route.
1. Create the “Number” and “Weight” capacities
First, you need to create these two capacities from the settings by following these few steps:
- Go to the “Settings” module.
- Click on the “Capacities” tab.
- Click on the “Add” button.
- Create the first capacity “Number”:
- Number (Name) ;
- Unit (Unit) ;
- Optional (Validation mode).
- Click on the “Save” button.
- Click the “Add” button again to create the second capacity.
- Create the second capacity “Weight”:
- Weight (Name) ;
- Kg (Unit) ;
- Optional (Validation mode).
- Click on the “Save” button.
💡 Respect the use of upper and lower case for Number and Weight to make it possible to synchronize data between AntsRoute and WooCommerce.
2. Determine the capacities of your vehicles
Once you have created the capacities, you must indicate the quantities that can be carried by each of your vehicles.
- Go to the “Resources” module.
- Click on the “Vehicles” tab.
- For the first vehicle, click on “...” and “Edit”.
- Determine the “Number” quantity that can be carried by the vehicle.
- Determine the “Weight” quantity that can be carried by the vehicle.
- Click on the “Save” button.
- Click on the “Confirm” button.
- Repeat these steps for each vehicle.
Step 3 - Get an API key from AntsRoute
From your AntsRoute account, you need to retrieve an API key that you will be asked for later when setting up the WooCommerce by AntsRoute plugin. To do this, you need to follow these steps:
- Click on the blue circle at the top right.
- Click on the “Integrations” tab.
- Click on “API Keys”.
- Click on the “+” button.
- Enter the “Name” of this key.
- Select the warehouse for which to generate an API key.
- Click on the “Create” button.
- Click on the “Copy” button.
- Click on the “Continue” button.
💡 In the next step, you will be asked to enter this API key. Meanwhile, you can paste it in a text file.
Step 4 - Set up the WooCommerce by AntsRoute plugin on WordPress
In order to set up the WooCommerce by AntsRoute plugin, you need to login to WordPress and follow these few steps:
- Go to “WooCommerce” > “AntsRoute”.
- Click on “Settings”.
- Choose the option “Don't let the customers choose the date and time slot”.
- Choose a “Shipping zone and method” that you have defined in the WooCommerce settings.
- Enter the “AntsRoute site API key” that you retrieved in the previous step.
- Choose the “Send to AntsRoute trigger”. For example, if you choose the “Pending payment” option, as soon as the order changes to the “Pending payment” status on WooCommerce, the delivery is sent to AntsRoute.
- Choose the “AntsRoute order deletion trigger”. For example, if you choose the “Refunded” option, as soon as the order changes to the “Refunded” status on WooCommerce, the delivery is cancelled on AntsRoute.
- Select the module where to “Add order to”.
- Select the “Delivery days” to be displayed to your customers.
- Enter the “Minimum open calendar date”, i.e. the date from which the delivery can be scheduled. For example, “0” makes it possible to schedule a delivery for the same day; “1” makes it possible to schedule a delivery for the next day; “2” makes it possible to schedule a delivery on D+2; etc.
- If you have chosen a minimum open calendar date of “0” or “1”, you can set a “Delivery cut-off hour”, i.e. the time after which your customers can no longer schedule a delivery. For example, if you choose a delivery cut-off hour of 18:00, your customers can schedule a delivery for the same day (or the next day) until 6pm.
- Set the default “Delivery duration”, i.e. the time required in minutes for your delivery driver to get the goods out of the vehicle and hand them to the customer.
- If necessary, enter the “Holidays and days off” in the format yyyy-mm-dd. For example, 2022-11-11.
- Click on the “Save” button.
💡 If your drivers make several returns to the warehouse during their routes in order to reload their vehicles, you must activate the “Pick-up & Delivery” option. When activating this option, other fields must be filled in: Warehouse name; Warehouse address; Loading time; Loading time slots.
Step 5 - Send the status of AntsRoute deliveries to WooCommerce using webhooks
We also have webhooks on AntsRoute to send delivery status to WooCommerce. Here are some steps to follow to set up webhooks:
- Go to WordPress > WooCommerce > AntsRoute.
- Click on the “Webhooks” tab.
- Copy the URL.
- Go to your AntsRoute account.
- Click on the blue circle at the top right.
- Click on the “Integrations” tab.
- Click on the “Webhooks” tab.
- Click on the “+” button.
- Enter the “Name” of this webhook.
- Paste the “URL address” you retrieved earlier.
- Choose the “Authentication mode” > “None”.
- Select the “Events to send”:
- Delivery done;
- Delivery cancelled ;
- Delivery deleted ;
- Delivery locked.
- Select the “Concerned warehouse”.
- Click on the “Save” button.
💡 Once this is done, you can go to WordPress > WooCommerce > Orders to view the status of each delivery.
Step 6 - Manage the custom fields on AntsRoute
The creation of custom fields makes it possible to send information from WooCommerce to AntsRoute. For example, the description and price of the items, the payment method, etc.
💡 The use of this custom fields is optional. If you use the custom fields, make sure to enter exactly the same name.
1. Create a new category
The creation of a category is useful to group custom fields together to make the information easier to read. For example, “Custom Fields” or “WooCommerce Fields”.
- Go to the “Settings” module.
- Click on the “Custom fields” tab.
- Click on the “Delivery” tab.
- Click on the “Create a category” button.
- Enter a “Name” for this category.
- Click on the “Save” button.
💡 When adding the custom fields below, you will need to sort them into the category you have just created.
2. Add the custom field “Price”
- Click on the “Create a field” button.
- Enter the name “Price”.
- For the field type, choose the “Text type” option.
- Click on the “Save” button.
3. Add the custom field “Description”
- Click on the “Create a field” button.
- Enter the name “Description”.
- For the field type, choose the “Text type” option.
- Click on the “Save” button.
4. Add the custom field “Payment method”
- Click on the “Create a field” button.
- Enter the name “Payment method”.
- For the field type, choose the “Text type” option.
- Click on the “Save” button.
5. Add the custom field “Currency”
- Click on the “Create a field” button.
- Enter the name “Currency”.
- For the field type, choose the “Text type” option.
- Click on the “Save” button.
6. Add the custom field “Paid”
- Click on the “Create a field” button.
- Enter the name “Paid”.
- For the field type, choose the “List type” option.
- Add the options “true” and “false”.
- Click on the button “Save”.