Skip to content
Snippets Groups Projects
Commit 1727c632 authored by dyszczo's avatar dyszczo
Browse files

usage in readme

parent e5a8505c
No related branches found
No related tags found
No related merge requests found
......@@ -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()
)
);
}
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment