Skip to content
Snippets Groups Projects
Commit 76b9f7e5 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

Merge branch 'feature/readme' into 'master'

chore(readme): more documentation

See merge request !4
parents 073bea30 7d14b515
No related branches found
No related tags found
1 merge request!4chore(readme): more documentation
Pipeline #3025 passed
variables:
DISABLE_ACCEPTANCE: "1"
DISABLE_FUNCTIONAL: "1"
IS_LIBRARY: 1
DISABLE_PHP_5_5: 1
DISABLE_CODECEPTION: 1
include: 'https://gitlab.com/wpdesk/gitlab-ci/raw/master/gitlab-ci-1.2.yml'
...@@ -2,48 +2,59 @@ ...@@ -2,48 +2,59 @@
[![coverage report](https://gitlab.com/wpdesk/wp-wpdesk-rating-petition/badges/master/coverage.svg)](https://gitlab.com/wpdesk/wp-wpdesk-rating-petition/commits/master) [![coverage report](https://gitlab.com/wpdesk/wp-wpdesk-rating-petition/badges/master/coverage.svg)](https://gitlab.com/wpdesk/wp-wpdesk-rating-petition/commits/master)
[![Latest Stable Version](https://poser.pugx.org/wpdesk/wp-wpdesk-rating-petition/v/stable)](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition) [![Latest Stable Version](https://poser.pugx.org/wpdesk/wp-wpdesk-rating-petition/v/stable)](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition)
[![Total Downloads](https://poser.pugx.org/wpdesk/wp-wpdesk-rating-petition/downloads)](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition) [![Total Downloads](https://poser.pugx.org/wpdesk/wp-wpdesk-rating-petition/downloads)](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition)
[![Latest Unstable Version](https://poser.pugx.org/wpdesk/wp-wpdesk-rating-petition/v/unstable)](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition)
[![License](https://poser.pugx.org/wpdesk/wp-wpdesk-rating-petition/license)](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition) [![License](https://poser.pugx.org/wpdesk/wp-wpdesk-rating-petition/license)](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition)
WordPress Library to ask for good rate in repository. WordPress Library to ask for good rate in repository.
=================================================== ====================================================
### Usage ## Requirements
When using in shipping zones: PHP 7.0 or later.
## Installation via Composer
In order to install the bindings via Composer run the following command:
```bash
composer require wpdesk/wp-wpdesk-rating-petition
```
## Example usage
### When using in shipping zones:
```php ```php
private function init_repository_rating() { function init_repository_rating() {
$time_tracker = new ShippingMethodWatcher( $time_tracker = new \WPDesk\RepositoryRating\TimeWatcher\ShippingMethodInstanceWatcher(
FedexShippingService::UNIQUE_ID, FedexShippingService::UNIQUE_ID,
'plugin_activation_flexible-shipping-fedex/flexible-shipping-fedex.php', 'plugin_activation_flexible-shipping-fedex/flexible-shipping-fedex.php',
'28-11-2019', '28-11-2019',
FedexShippingMethod::class FedexShippingMethod::class
); );
$this->add_hookable( $time_tracker ); $time_tracker->hooks();
$this->add_hookable( ( new \WPDesk\RepositoryRating\RatingPetitionNotice(
new RatingPetitionNotice(
$time_tracker, $time_tracker,
FedexShippingService::UNIQUE_ID, 'flexible_shipping_fedex',
$this->plugin_info->get_plugin_name(), $this->plugin_info->get_plugin_name(),
'https://wpde.sk/fs-fedex-rate' 'https://wpde.sk/fs-fedex-rate'
) ) )->hooks();
);
} }
``` ```
When using in shipping method: ### When using in shipping method:
```php ```php
private function init_repository_rating() { <?php
$time_tracker = new ShippingMethodGlobalSettingsWatcher( FedexShippingService::UNIQUE_ID ); function init_repository_rating() {
$this->add_hookable( $time_tracker ); $time_tracker = new \WPDesk\RepositoryRating\TimeWatcher\ShippingMethodGlobalSettingsWatcher(
$this->add_hookable( 'flexible_shipping_fedex'
new RatingPetitionNotice( );
$time_tracker->hooks();
( new \WPDesk\RepositoryRating\RatingPetitionNotice(
$time_tracker, $time_tracker,
FedexShippingService::UNIQUE_ID, 'flexible_shipping_fedex',
$this->plugin_info->get_plugin_name(), $this->plugin_info->get_plugin_name(),
'https://wpde.sk/fs-fedex-rate' 'https://wpde.sk/fs-fedex-rate'
) )
); )->hooks();
} }
``` ```
{ {
"name": "wpdesk/wp-wpdesk-rating-petition", "name": "wpdesk/wp-wpdesk-rating-petition",
"license": "MIT",
"authors": [ "authors": [
{ {
"name": "Krzysiek", "name": "Krzysiek",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment