Quick help: I’ve been hacked

Fresh products with WooCommerce

The WooCommerce integration required understanding its hooks and working on the checkout.

We used PHP’s DateTime class with a recursive function to determine delivery feasibility on future dates.

Some products have a longer production time and, if they are in the cart, they affect delivery feasibility.

A pastry shop that sells its fresh products online needed a system on its new website to:

  • Offer its fresh products across mainland Spain.
  • Allow buyers to schedule the date they want to receive it.
  • Ensure the system takes the product’s expiry date into account in relation to its manufacturing date, and the dispatch time in relation to the distance from the factory. Based on this, decide whether shipping can be scheduled for a given date.
    In other words, a product that expires in 4 days cannot be scheduled for a date if it cannot be manufactured in the 3 days prior to delivery (due to distance, Sunday, weekend, or a public holiday).
    For example, a cake cannot be scheduled for delivery on Tuesday, October 13, 2020 because Monday the 12th is a public holiday, the 11th is Sunday, the 10th is Saturday, and therefore production and shipping can be carried out at the earliest on Friday the 9th.
  • In addition, the system must account for the fact that some products require a longer preparation time at the factory, so the factory would need 2 consecutive business days to process it and then ship it.
  • Additionally, for products that do not require prior preparation, allow the option to place particularly fast orders, with delivery within 3 hours in the city center near the production site.
We developed a new plugin to implement this integration without having to modify the theme or other plugins.
The plugin creates a new shipping method in WooCommerce.

Once all these ideas were organized and all requirements captured, we worked on a development that could accommodate all these features.

We developed a new plugin that creates a new shipping method in the WooCommerce platform that:

  • Includes a calendar to allow the buyer to select the delivery date.
  • In the calendar, dates that do not meet the requirements for delivery (weekends, public holidays, or days when the product would not arrive in good condition at the selected destination) appear disabled and cannot be selected.
    For usability, we preferred this solution, which allows the customer to be aware of the delivery date before making the purchase, rather than a pop-up message or a notification during or after the process.
  • Depending on the destination provided, the customer can select different delivery options:
    • Express: within 3 hours, only shown if the address is in the city center near the factory, the product does not require special preparation, and the delivery service is within operating hours.
    • Next-day: if the order is placed in the morning, it is delivered in the afternoon; if placed in the afternoon, it is delivered the next morning. Only available in the metropolitan area near the factory and if the product does not require more than 1 day of preparation.
    • Standard: 24–48h, available across mainland Spain, allows selecting the delivery date within the date calendar.

This plugin integrates with their existing online commerce system, WooCommerce on WordPress, so with a bit of specific training the team quickly adapted to the new functionality.

The user can select the delivery date using a calendar when placing an order

For fast deliveries, they can also select the time slot.

Shipping time depends on the delivery location, and can be less than 3 hours.

In WooCommerce order management, the agreed delivery date and time are displayed.

We can help you with WooCommerce integrations

Talk to us

Briefly tell us what you need: what is happening, what type of project it is and, if possible, its scope. The more context you provide, the better we can advise you.

    Phone
    L-J 11-17h
    • Granada
    • Valladolid
    • Berlin