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 with stages
in 2 minutes and 23 seconds
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 @@
[![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)
[![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)
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
private function init_repository_rating() {
$time_tracker = new ShippingMethodWatcher(
function init_repository_rating() {
$time_tracker = new \WPDesk\RepositoryRating\TimeWatcher\ShippingMethodInstanceWatcher(
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(),
'https://wpde.sk/fs-fedex-rate'
)
);
$time_tracker->hooks();
( new \WPDesk\RepositoryRating\RatingPetitionNotice(
$time_tracker,
'flexible_shipping_fedex',
$this->plugin_info->get_plugin_name(),
'https://wpde.sk/fs-fedex-rate'
) )->hooks();
}
```
When using in shipping method:
### 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(
<?php
function init_repository_rating() {
$time_tracker = new \WPDesk\RepositoryRating\TimeWatcher\ShippingMethodGlobalSettingsWatcher(
'flexible_shipping_fedex'
);
$time_tracker->hooks();
( new \WPDesk\RepositoryRating\RatingPetitionNotice(
$time_tracker,
FedexShippingService::UNIQUE_ID,
'flexible_shipping_fedex',
$this->plugin_info->get_plugin_name(),
'https://wpde.sk/fs-fedex-rate'
)
);
)->hooks();
}
```
{
"name": "wpdesk/wp-wpdesk-rating-petition",
"license": "MIT",
"authors": [
{
"name": "Krzysiek",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment