=== SLM Delivery Service ===
Contributors: skroutzlastmile
Donate link: https://www.skroutzlastmile.gr/
Tags: skroutz, skroutzlastmile, slm, delivery, shipping, locker
Requires at least: 4.4
Tested up to: 4.4
Stable tag: 6.1
Requires PHP: 7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Integrate SLM locker map into WooCommerce for seamless e-shop navigation and convenience.

== Description ==

The **SLM Delivery Service** is a robust solution that elevates your WooCommerce store by seamlessly incorporating the convenient SLM ship-to-locker 
functionality for customer orders. This plugin empowers your customers with the flexibility to opt for SLM lockers as their preferred delivery choice 
while completing their purchases. By seamlessly integrating SLM's shipping services into your WooCommerce platform, it delivers a smooth and effective 
process for fulfilling orders, enhancing the overall order management experience.

**Installation**

1. Upload the plugin files to the `/wp-content/plugins/slm-woocommerce-plugin` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to WooCommerce -> Settings -> Shipping -> Shipping Zones and add the SLM Delivery shipping method to your desired shipping zones.
4. The plugin is now installed and activated.

**Configuration**

Ensure that all fields are filled in correctly to ensure proper functionality of the Plugin.

*Shipping Fields*

*Title: Title of SLM service as will be seen by the client on available shipping methods.
*Taxable
*Cost: The Cost of the SLM Shipping Method that you will charge your clients.
*Free delivery: Optionally free shipping from a total account and above, leave blank to disable.

*SLM Settings*

* Base Url: SLM Server URL.
* Map Url: URL of the map that your clients will select Skroutz Point.
* API Token: Access Authorization Token for Creating SLM Orders.
* Pickup Location Code: This establishes both your identity and your warehouse location. You can have more than one warehouse separated by a comma.
* Partner Id: This is for further Identification.
* Store Number: This is your phone number of your store.

*Optional Fields*

* WooCommerce Order Status on Voucher Create: What WC Order status should be after the SLM Voucher is created.
* WooCommerce Order Status on Voucher Cancel: What WC Order status should be after the SLM Voucher is canceled.
* WooCommerce Order Status on Voucher Fail: What WC Order status should be after the SLM Voucher is failed.
* WooCommerce Order Status on Voucher Complete: What WC Order status should be after the SLM Voucher is completed.
* Include Categories: For the plugin to work you have to include at least one category of products.

**Basic Features**

*Client Side*

Client will have the option to select **SLM Locker** Delivery Method. The client can search for an address, discover the lockers on the map, and select one of them.

*Admin Side*

* Create Voucher: When an order is made from a customer, then you will have to create a voucher to inform SLM to provide a voucher for you. You will have to pick Pickup Location (as added from Pickup Location Codes in SLM Settings) and Pickup date/time.
* Update Voucher: You can only edit the Pickup Date and time when Updating an order in SLM.
* Complete Voucher: For any reason, you can mark the order as complete. This does not have any effect on SLM Servers.
* Cancel Voucher: You can also cancel an order by pressing the circled 'x' button. This will cancel the order on your system and on SLM Servers.
* Sync Latest Status of SLM: You have to click the refresh button to update your orders with the latest status from SLM. If an order is in the final state, then it gets its status changed on your store too (WooCommerce System). An order may be marked as canceled, failed, or completed depending on the order's status on SLM Servers (SLM Tracking Column). **You have to do this often to sync your system with the latest SLM status change.**

== Changelog ==


= 1.1.12 =

- Improvement: Disable Create Voucher on click.


= 1.1.11 =

- Fix: Evening pickup window send as morning pickup window
- Improvement: Add WC Order status column

= 1.1.10 =

- Fix: Do a hack fix for duplicate maps
- Fix: Some times disabled slm option message appears when it should not.
- Fix: Allow pickup of the same day for evening if its before 2pm.

= 1.1.9 =

- Improvement: Let the auto sync to the sync and remove sync orders button.

= 1.1.8 =

- Improvement: Various code fixes/improvements
- Feature: Add link to Tracking-Page for each voucher, and improve styling of Voucher Column.


= 1.1.7 =

- Fix: Replace php 8 function str_contains with strpos for better compatibility.
- Fix: Add support for other weight units.

= 1.1.6 =

- Fix: IPhone safari map becoming grey and unclickable
- Fix: Remove popup map for Locker on order page
- Improvement: Add description for Tax Status

= 1.1.5 =

- Fix: Give Popup button left margin
- Improvement: Make Popup map bigger
- Improvement: Parse option urls to remove '/' and replace http with https
- Improvement: Add warning message if testing keys are used

= 1.1.4 =

- Fix: If free delivery is not bound to a value (empty) then cost doesn't calculated.
- Improvement: Add Soft Include option on settings. For a product to be eligible for SLM Delivery. Disabled (Default): All categories of products must be included. Enabled: At least one category from the list of product categories must be included.

= 1.1.3 =

- Improvement: Make map with bigger width to show vertical-split view of the map .

= 1.1.2 =

- Fix: Make map-open-button not full width.
- Fix: Fix map close icon not showing up.
- Fix: Mobile view map height from 70% to 100%.
- Fix: 3rd Plugin conflict.

= 1.1.1 =

- Fix: SLM Orders page -> Locker popup map sometimes redirecting to user's location. Disabled that.

= 1.1.0 =

- Fix: WooCommerce Order Status on Voucher Create/Cancel/Fail/Complete options, if not set at init, changing the order to the first available WC Status.
- Fix: Disabling slm shipping method info messages appearing outside cart/checkout pages.
- Fix: Show error message from SLM Servers when available on slm sync error message bar.
- Fix: Pdf not opening on chrome and some other programs.

- Improvement: Add locker name instead of locker external id on SLM Orders page, make it backwards compatible to fallback to locker external id if name does not exist.
- Improvement: Change styling of map to window instead of fullscreen, and make background grey.
- Improvement: Add confirmation before submitting complete, cancel buttons.
- Improvement: Change style of slm-settings.
- Improvement: Change exclude categories to be include categories, and the style of the component in slm-settings.

- Feature (client): Disable cash on delivery with SLM (options Cash On Delivery disappears)
- Feature (admin): Locker name on click opens map with locker selected.
- Feature (admin): Add proper install/update/uninstall plugin hooks. IMPORTANT: Uninstall of plugin now removes tables and all data of SLM plugin.
- Feature (admin): Add SLM Last Sync timestamp display before refresh button, also do a sync automatically on SLM Orders page load if it hasn't be done in the last three hours.
- Feature (admin): Add status colors on orders table.
- Feature (admin): Add required fields check before saving slm-settings.
- Feature (admin): Add weight calculation enable/disable options.
- Feature (admin): Add option to change map type from popup to iframe with shortcode available.

== Frequently Asked Questions ==
= How will I get keys/tokens for SLM Delivery Service? =
You have to contact Skroutz Last Mile