From 1727c6324206f02f4b0bbb8c3e0032cc12da4cfa Mon Sep 17 00:00:00 2001 From: dyszczo <krzysztof.dyszczyk@gmail.com> Date: Fri, 29 Nov 2019 19:01:56 +0100 Subject: [PATCH] usage in readme --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index 982ba2a..058d458 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,41 @@ WordPress Library to ask for good rate in repository. =================================================== + +### Usage + +When using in shipping zones: +```php +private function init_repository_rating() { + $time_tracker = new ShippingMethodWatcher( + FedexShippingService::UNIQUE_ID, + 'plugin_activation_flexible-shipping-fedex/flexible-shipping-fedex.php', + '28-11-2019', + FedexShippingMethod::class + ); + $this->add_hookable( $time_tracker ); + $this->add_hookable( + new RatingPetitionNotice( + $time_tracker, + FedexShippingService::UNIQUE_ID, + $this->plugin_info->get_plugin_name() + ) + ); +} +``` + +When using in shipping method: + +```php +private function init_repository_rating() { + $time_tracker = new ShippingMethodGlobalSettingsWatcher( FedexShippingService::UNIQUE_ID ); + $this->add_hookable( $time_tracker ); + $this->add_hookable( + new RatingPetitionNotice( + $time_tracker, + FedexShippingService::UNIQUE_ID, + $this->plugin_info->get_plugin_name() + ) + ); +} +``` -- GitLab