Chronopost
==========

Contributors: chronopost
Donate link: https://www.adexos.fr
Tags: shipping, delivery, pick-up, woocommerce
Requires at least: 5.0
Requires PHP: 7.4
Tested up to: 6.5.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Description
-----------

Chronopost for woocommerce

Installation
------------

This section describes how to install the plugin and get it working.

1. Download the plugin from https://www.chronopost.fr/fr/plateformes-e-commerce
2. Upload the plugin to wp-content/plugins/
3. Activate the plugin in the plugins menu
4. Go to the settings page and configure the plugin
5. Test the plugin by creating a new order
6. If everything is ok, you should see the shipping method in the order page

Frequently Asked Questions
--------------------------

Nothing here yet

Hooks
-----

The plugin exposes the following filters and actions for developers.

### Filters

**chronopost_tracking_request_timeout**
Adjusts the HTTP timeout (in seconds) for tracking API requests made by the cron job.
Default: 15

    add_filter( 'chronopost_tracking_request_timeout', function() { return 30; } );

---

**chronopost_use_rest_api**
Controls whether the REST API is used for ChronoPrecise. Return false to fall back to the legacy behaviour.
Default: true

    add_filter( 'chronopost_use_rest_api', '__return_false' );

---

**chrono_precise_template**
Overrides the ChronoPrecise appointment booking template path.
Default: locate_template( 'chronopost/chronoprecise.php' )

    add_filter( 'chrono_precise_template', function( $path ) {
        return get_stylesheet_directory() . '/chronopost/chronoprecise.php';
    } );

---

**chrono_relais_template**
Overrides the ChronoRelais pickup points map template path.
Default: locate_template( 'chronopost/chronorelais/map.php' )

    add_filter( 'chrono_relais_template', function( $path ) {
        return get_stylesheet_directory() . '/chronopost/chronorelais/map.php';
    } );

---

**chrono_can_change_postcode**
Allows customers to modify the postcode when selecting a relay point in the map.
Default: false

    add_filter( 'chrono_can_change_postcode', '__return_true' );

---

### Actions

**chronopost_relay_points_load_cart_session**
Fires when the cart session is loaded during a relay points REST API request.
Parameters: CartController $cart_controller, WP_REST_Request $request

    add_action( 'chronopost_relay_points_load_cart_session', function( $cart_controller, $request ) {
        // custom logic
    }, 10, 2 );

---

Change Log
----------

See changelog.txt
