diff --git a/README.md b/README.md index 982ba2a54e99f23aba596b1b204e618dc5e3da51..058d458ed6cca07bd964783dc7d2be4517112c5c 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() + ) + ); +} +```