=== Asapp Delivery for WooCommerce === Contributors: jonandreasasapp Tags: woocommerce, delivery, shipping, same-day, express Requires at least: 6.0 Tested up to: 7.2 Requires PHP: 7.4 Requires Plugins: woocommerce Stable tag: 1.1.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Let your customers choose delivery within the hour in Oslo, right in your WooCommerce checkout. == Description == **Asapp!** is a Norwegian technology platform for delivery within the hour in Oslo. Customers get their order within 60 minutes of ordering, with no fixed pickup times. The trips are driven by Oslo Taxi, with more than 750 cars in Oslo. This plugin connects your WooCommerce store to Asapp!. Your customers see live price and availability in the checkout, and you handle the delivery from WooCommerce admin. The plugin's settings and messages are in Norwegian, since Asapp! currently serves stores in Norway. **What the plugin does:** * Creates a shipping zone ("ASAPP - Levering per time") on activation, ready to use * Calculates the delivery price live from the customer's address, rounded to whole kroner * Shows Asapp! at the top of the shipping options in the checkout, with an estimated delivery time ("Asapp – få det om ca. 40 min") that includes the store's preparation time and the time the car needs to reach the store * Shows Asapp! only when the store is open: opening hours per weekday, automatically closed on Norwegian public holidays, and your own closed days * Pause button in the WordPress toolbar to turn Asapp! off for a while (1 hour, 2 hours or the rest of the day) – it turns itself back on * Text message (SMS) to the store as soon as an Asapp! order comes in, so the package is prepared right away * Registers the order with Asapp! when the WooCommerce order is set to "Processing". The car is booked only when the store reports that the package is "ready for pickup" * Generates a shipping label with a QR code for printing * Gives the customer a tracking link for the delivery * Lets you choose a region (Oslo, Bergen, Trondheim, Stavanger or all of Norway) to set up the right postcodes on the shipping zone **When is the car booked?** Only when the store reports that the package is "ready for pickup": with the button on the order in WooCommerce, in the Asapp! Butikk app or in the Asapp! portal. "Completed" and other order statuses never book a car. **Coverage area:** Asapp! delivers in Oslo today. The service is validated thoroughly before it is rolled out to more cities. Would you like Asapp! in your city? Send us an e-mail at hello@asapp.tech – we will take it into account in our planning. **Requirements:** * New stores register themselves under WooCommerce → Asapp and get their own API key. Stores that are already connected can keep using their API key and store ID in the shipping method settings * Delivery addresses within the Asapp! coverage area Contact hello@asapp.tech or visit [asapp.tech](https://asapp.tech) to get started. == Installation == 1. Upload and activate the plugin. A shipping zone ("ASAPP - Levering per time") is created automatically. 2. Go to WooCommerce → Asapp, enter your organisation number, contact person and store, read the terms and the data processing agreement to the end, and accept. The store then gets its own API key, which the plugin saves. 3. Go to WooCommerce → Settings → Shipping, and open the shipping zone that was created (or choose an existing zone and click "Add shipping method"). 4. Choose "Asapp Delivery" as the shipping method and open its settings. (Stores with an older API key can keep using it in these settings.) 5. Choose a region to get suggested postcodes for the zone, and adjust them under WooCommerce → Shipping → Zones if needed. 6. Under "Åpningstider" (opening hours): tick "Vis Asapp kun når butikken er åpen" (show Asapp only when the store is open), enter the opening hours for each day (for example `11:00-18:00`, empty field = closed), and add any other closed days (for example `24.12, 31.12`). Norwegian public holidays are closed automatically. 7. Save. == Frequently Asked Questions == = Do I need an Asapp! account? = You create the account yourself under WooCommerce → Asapp. There you register the company and the store, accept the terms and get your own API key. Stores that already have an API key and store ID from Asapp! can keep using them. Questions: hello@asapp.tech. = Which areas does Asapp! cover? = Asapp! delivers in Oslo today. We are expanding step by step – send an e-mail to hello@asapp.tech if you would like Asapp! in your city. = When is the car booked? = The order is registered with Asapp! when it is set to "Processing". The car is booked only when the store reports that the package is "ready for pickup": with the button on the order in WooCommerce, in the Asapp! Butikk app or in the Asapp! portal. Setting the order to "Completed" never books a car. = How do I stop customers from ordering Asapp! when the store is closed? = Turn on "Vis Asapp kun når butikken er åpen" (show Asapp only when the store is open) in the shipping method settings and enter your opening hours. Asapp! stops showing a chosen number of minutes before closing time (30 by default), so you have time to prepare the package. Norwegian public holidays are closed automatically, and you can add your own closed days, such as Christmas Eve. = Can I turn Asapp! off for a while, for example on a market day? = Yes. When you are logged in to WordPress, "● Asapp aktiv" is shown in the toolbar at the top (also on mobile). Choose "Pause 1 time" (1 hour), "Pause 2 timer" (2 hours) or "Pause resten av dagen" (rest of the day). Asapp! disappears from the checkout at once, and comes back by itself when the pause is over. Choose "Slå på igjen nå" (turn on now) to end the pause early. = Why is the price rounded? = Asapp! calculates the price from the actual driving distance. The plugin rounds the price the customer sees to the nearest whole krone, so it says for example 189.00 kr instead of 189.20 kr. = Is the store notified when an Asapp! order comes in? = Yes, in two ways: WooCommerce's usual "New order" e-mail (WooCommerce → Settings → Emails), and from 1.0.10 a text message (SMS) from Asapp! as soon as the order comes in. The phone numbers for SMS are registered by Asapp! – send us the number at hello@asapp.tech. = What happens if Asapp! is not available for an address? = The shipping method is not shown in the checkout for addresses outside the coverage area. If Asapp! does not respond, the option is hidden by default; the store can choose to show a fallback price instead. = What data is sent to Asapp!? = Only what is needed to carry out the delivery: the recipient's name, delivery address, phone number, e-mail and order ID/reference. See "External services" below for details. = Is the plugin free? = The plugin itself is free to install. You only pay for actual deliveries through your Asapp! account. Contact hello@asapp.tech for information about getting started and prices. == External Services == This plugin connects your WooCommerce store to the Asapp! delivery API (api.asapp.tech), operated by ASAPP! AS. This is required for the plugin to work, and happens in these cases: * **When shipping is calculated in the checkout:** the customer's delivery address is sent to Asapp! to check availability and calculate the price. * **When an order is set to "Processing":** the recipient's name, address, phone number, e-mail and order ID are sent to Asapp! to register the delivery. No car is booked yet. * **When a package is marked "ready for pickup":** a reference to the order is sent to Asapp!, and Asapp! books the car. * **When an Asapp! order is set to "Cancelled" or "Refunded" (from 1.1.1):** a reference to the order is sent to Asapp!, so that no car is booked, and a car that has not yet picked up the package is cancelled. * **When you register the store under WooCommerce → Asapp (from 1.1.0):** organisation number, contact person (first name, last name, e-mail address and role in the company), store name, store address and the time the terms were shown and accepted are sent to Asapp!. The organisation number is also looked up in the Brønnøysund Register Centre via Asapp!. If the register does not respond, the company name and any address you enter yourself are also sent. The response contains the store's API key, which the plugin saves in the WordPress database. The data is sent only when you click «Godta og aktiver» (accept and activate). * **When the WooCommerce → Asapp page is opened while the store is not connected, and once a day for connected stores:** the plugin fetches the current terms and data processing agreement from api.asapp.tech (`/terms/current`) to show them or to tell you about a new version. No information about the store or its customers is sent in this request. * **When you click «Lag ny nøkkel» (create new key):** the plugin asks Asapp! for a new API key. The old key is sent in the request to confirm that you own the store. No payment or card details are sent through this plugin. All communication uses https and is authenticated with an API key that only the store has access to. The key is never shown in full in WordPress, and is not written to logs or order notes. Service: [asapp.tech](https://asapp.tech), operated by ASAPP! AS Terms: [asapp.tech/vilkar](https://asapp.tech/vilkar) Privacy policy: [asapp.tech/personvern](https://asapp.tech/personvern) == Upgrade Notice == = 1.1.4 = The car is now booked only when the package is reported "ready for pickup". Supreme mode, where "Completed" booked a car, has been removed. Recommended for everyone. = 1.1.3 = Small fix in the registration: when the company is already a customer, the message about the link sent by e-mail is shown as information, not as an error. = 1.1.2 = Stores with an older key can now switch to their own key per store from WooCommerce → Asapp. SMS to the store and Asapp! Butikk keep working after the switch. = 1.1.1 = New: when an Asapp! order is cancelled or refunded, Asapp! automatically cancels the car if it has not picked up the package yet. Recommended for everyone. = 1.1.0 = New: a separate page under WooCommerce → Asapp where new stores register and get their own API key. Stores already in operation notice nothing: key, store ID and addresses work as before. = 1.0.14 = Important fix: the plugin could crash when Asapp! rejected an order. The "Mark ready for pickup" and "Print" buttons now work. New, shorter text in the checkout: "Asapp – få det om ca. 40 min". Recommended for everyone. = 1.0.13 = For stores using the Asapp! Butikk app: variant and product image are shown on each line item. = 1.0.12 = Tested with WordPress 7.1. Asapp! is now hidden when the service does not respond, instead of showing an error message and a fallback price. Order notes are in Norwegian. = 1.0.11 = Important fix: the Asapp! API is now reached at the right address, and the tracking links work. Recommended for all stores. Includes everything from 1.0.8–1.0.10. = 1.0.10 = New: SMS to the store when an Asapp! order comes in. Includes everything from 1.0.8 and 1.0.9 (opening hours, public holidays, pause button, whole kroner). Contact hello@asapp.tech to register a phone number. = 1.0.9 = New: opening hours, automatically closed on public holidays, pause button and prices in whole kroner. Also includes 1.0.8 (Asapp! at the top of the checkout, delivery time including preparation). Your settings are kept. Turn on opening hours in the shipping settings after updating. = 1.0.8 = Asapp! is shown at the top of the checkout, and the delivery time now includes the store's preparation time. == Changelog == = 1.1.4 = * Change: Supreme mode has been removed. The car is booked only when the store reports "ready for pickup" (the button on the order, Asapp! Butikk or the Asapp! portal). Setting the order to "Completed" never books a car, also for stores that had chosen Supreme. The "Operasjonsmodus" setting has been replaced by an explanation. = 1.1.3 = * Fixed: when the company is already an Asapp! customer, Asapp! sends a link to connect the store to the account. The message about this is now shown as information (blue), not as an error (red). = 1.1.2 = * New: "Switch to new key" is turned on again for stores with an older key. Asapp! now recognises the new key also for SMS to the store and orders to Asapp! Butikk. = 1.1.1 = * New: When an Asapp! order is set to "Cancelled" or "Refunded", the plugin tells Asapp!. If the car is booked and has not picked up the package, it is cancelled. If no car is booked yet, none will be. The outcome is written as an order note. = 1.1.0 = * New: Separate page under WooCommerce → Asapp. New stores register themselves: the organisation number is looked up in the Brønnøysund Register Centre, contact person and store are filled in from WordPress and WooCommerce, and the terms and data processing agreement are shown in scroll boxes. The acceptance box cannot be ticked until both have been read to the end. * New: Each store gets its own API key on registration. The key is stored in a separate setting, shown only as "…abcd", and never written to HTML, logs or order notes. The "Lag ny nøkkel" (create new key) button replaces the key. * New: Stores with an older key in the shipping settings (in operation today) work as before. The Asapp page shows that they are connected with an older key, and optionally offers to switch to a new key when all shipping methods have the same store ID. * New: Notices in wp-admin (for store managers only): the store is not connected, the terms have not been accepted (Asapp! is hidden in the checkout), the API key has been revoked, and new terms have been published. * Change: The default Asapp! API address for new installations is now https://api.asapp.tech/api/v1/external. Saved addresses and stores with an older key are not changed. * Change: The API key and store ID fields in the shipping settings can no longer be edited when the store has its own key from the Asapp page. * Change: Uninstalling removes the key, store ID and registration info that the plugin itself has saved. = 1.0.14 = * Fix (important): When Asapp! rejected an order, the plugin could crash instead of writing the order note. Now the note "Ordren ble ikke opprettet hos Asapp" (the order was not created at Asapp) is written with the error message from Asapp!, so the store sees that the order must be followed up. The bug came in 1.0.12. * Fix: The "Mark ready for pickup" button in the Asapp box on the order now works. * Fix: The "Print" and "Close" buttons on the shipping label now work. * Change: New text in the checkout. The shipping option is now called "Asapp – få det om ca. 40 min", where the minutes are preparation + the time the car needs to reach the store + driving, rounded up to the nearest 5 minutes. Above 55 minutes, or when the time cannot be calculated, it says "Asapp – få det innen 1 time". Below the option it says "Levert på døren · Følg bilen live". All texts can be changed under "Tekst i kassen" (checkout text). * Fix: The Asapp! logo could be shown several times in front of the shipping option. = 1.0.13 = * New: For stores using the Asapp! Butikk app, the variant (for example "M · Blå") and product image are now sent with each line item, so the employee sees exactly what to pick. The price is still never sent. = 1.0.12 = * Tested with WordPress 7.1 and WooCommerce 11.1, both in the new block checkout and in the order flow. * Change: When Asapp! does not respond, Asapp! is hidden in the checkout by default, so no one buys delivery within the hour that may not be possible. The store can choose to show a fallback price instead ("Når Asapp ikke svarer"). The customer never sees an error text. * Change: Asapp! is not shown until the plugin is set up with an API key and store ID. * Improvement: The reason why Asapp! is not shown is logged under WooCommerce → Status → Logs (asapp-delivery). * Improvement: Order notes are in Norwegian, and show the error message from Asapp! when an order could not be created. * Fix: The address sent to Asapp! no longer contains empty fields when address line 2 is empty. = 1.0.11 = * Fix: The default Asapp! API address (api.asapp.tech) did not respond. The plugin now uses the address that works, and stores that saved the old default address are corrected automatically. Custom addresses are not changed. * Fix: The tracking link on the order now points to a tracking page that works. * New: Stores using the Asapp! Butikk app get new Asapp! orders directly in the app, with items and recipient name. Price, phone, e-mail and address are not sent. = 1.0.10 = * New: The store gets an SMS as soon as an Asapp! order comes in (when the order goes to "Processing"), asking it to prepare the package within 20 minutes. It also gets an SMS if the order did not reach Asapp!. Phone numbers are registered by Asapp! – contact hello@asapp.tech. SMS notification never stops the order itself. = 1.0.9 = * New: Opening hours per weekday in the shipping settings. When "Begrens til åpningstid" (limit to opening hours) is on, Asapp! is shown only when the store is open – and stops showing a chosen number of minutes before closing time (30 by default), so the store has time to prepare the package. Off by default, so existing stores are not affected until they turn it on. * New: Asapp! is automatically closed on Norwegian public holidays, calculated for each year – can be turned off. The store can also add its own closed days, for example "24.12, 31.12". * New: Pause button in the WordPress toolbar ("● Asapp aktiv"). The store can pause Asapp! for 1 hour, 2 hours or the rest of the day, for example on market days. The pause ends automatically, so it cannot be left on by mistake. * Change: The shipping price is now rounded to whole kroner (for example 189.00 instead of 189.20). * Improvement: The shipping options are recalculated at least every 10 minutes, so Asapp! disappears at closing time also for customers already in the checkout. = 1.0.8 = * Fix: The delivery estimate in the checkout showed the name of the transport provider – it is now shown only as "Levering om ~X min", without naming the subcontractor. * Change: The delivery estimate now includes the store's contractual preparation time (25 min) in addition to driving time, for a more realistic and transparent estimate for the customer. * New: Asapp! is now always shown at the top of the shipping options in the checkout, regardless of how each store has ordered its own shipping zone. = 1.0.7 = * New: The shipping zone "ASAPP - Levering per time" is created automatically on activation (all of Norway by default, can be adjusted). * New: Region dropdown in the settings (Oslo, Bergen, Trondheim, Stavanger, all of Norway) with suggested postcodes. * Improvement: The API endpoints are now pre-filled with the correct api.asapp.tech address – no manual input needed. * Fix: The tracking link no longer depends on the content of the order endpoint field. * Fix: Removed an incorrect BOM byte in the label template that could cause "headers already sent" warnings in some setups. = 1.0.6 = * Fix: Norwegian special characters (å, ø, æ) are now shown correctly in the shipping method settings. = 1.0.5 = * Cleanup of readme metadata and Plugin Check warnings. = 1.0.4 = * Adjusted slug/text domain to asapp-delivery-for-woocommerce; improved prefixing. = 1.0.3 = * WordPress.org compliance fixes. = 1.0.2 = * WordPress.org compliance fixes. = 1.0.1 = * Maintenance update (metadata and encoding fixes). = 1.0.0 = * First version.