Menu

## WC_Shipping_Shipcloud extends WC_Shipping_Method
in package

class-wc-shipping-shipcloud.php : 16

### Table of Contents

$allowed_carriers : array<string|int, mixed>
  Allowed Carriers
$allowed_carriers_options : array<string|int, mixed>
  Allowed carriers select options
$api : WC_Shipping_Shipcloud_API_Adapter
  API Adapter
$calculated_parcels : array<string|int, mixed>
  All Parcels which have been requested at shipcloud for later usage
$carriers : array<string|int, mixed>
  Loaded Carriers
$carriers_options : array<string|int, mixed>
  Carriers select options
$options : array<string|int, mixed>
  Loaded Options
$recipient : array<string|int, mixed>
  Recipient data
$sender : array<string|int, mixed>
  Sender data
__construct() : void
  Constructor.
add_calculate_shipping_fields() : void
  Setting Address field after submiting
add_calculate_shipping_form_fields() : bool
  Adding form field for Address Field and enabling City field
admin_options() : void
  This method is called just before the settings are displayed.
calculate_shipping() : void
  Calculate shipping costs.
clear_transients() : void
  Clear Template transients.
generate_hidden_html() : string
  Generate hidden HTML.
generate_multiselect_html() : string
  Generate multi-select HTML.
get_allowed_carriers() : array<string|int, mixed>
  Getting allowed carriers
get_carriers() : array<string|int, mixed>
  Getting carriers
get_instance_form_fields() : array<string|int, mixed>
  Get settings fields for instances of this shipping method (within zones).
get_option() : mixed|string
  Getting option (overwrite instance values if there option of instance is empty
init_form_fields() : void
  Set form fields.
is_available() : bool
  Checks whether shipping method is available or not.
process_admin_options() : void
  This method is called once settings are saved.
add_admin_notice() : void
  Output an admin notice.
check_webhook_preconditions() : void
  Check if webhook woocommerce api is enabled when shipcloud webhook should be used
environment_check() : void
  Environment check.
get_carrier_options() : array<string|int, mixed>
  Extract carrier options for multiselect list.
get_parcel_dimensions() : array<string|int, mixed>
  Getting dimensions for each parcel
get_product_dimensions() : array<string|int, mixed>
  Getting product dimensions
get_recipient() : array<string|int, mixed>
  Getting recipient address from package
get_sender() : array<string|int, mixed>
  Getting sender address
get_shipping_class_dimensions() : array<string|int, mixed>|null
  Getting shipping class dimensions
get_shipping_classes() : array<string|int, mixed>
  Getting shipping classes for order package
get_shipping_costs() : float
  Calculate the costs for parcel shipping.
init() : void
  Initialization.
log() : void
  Output a debug message.
set_settings() : bool
  Initialize settings is called on init and after saving plugin settings.

### Properties

#### $allowed_carriers

class-wc-shipping-shipcloud.php : 58

Allowed Carriers

`private array<string|int, mixed> $allowed_carriers`

#### $allowed_carriers_options

class-wc-shipping-shipcloud.php : 51

Allowed carriers select options

`private array<string|int, mixed> $allowed_carriers_options`

#### $api

class-wc-shipping-shipcloud.php : 23

API Adapter

`private WC_Shipping_Shipcloud_API_Adapter $api`

#### $calculated_parcels

class-wc-shipping-shipcloud.php : 79

All Parcels which have been requested at shipcloud for later usage

`private array<string|int, mixed> $calculated_parcels = []`

#### $carriers

class-wc-shipping-shipcloud.php : 37

Loaded Carriers

`private array<string|int, mixed> $carriers`

#### $carriers_options

class-wc-shipping-shipcloud.php : 44

Carriers select options

`private array<string|int, mixed> $carriers_options`

#### $options

class-wc-shipping-shipcloud.php : 30

Loaded Options

`private array<string|int, mixed> $options`

#### $recipient

class-wc-shipping-shipcloud.php : 72

Recipient data

`private array<string|int, mixed> $recipient = []`

#### $sender

class-wc-shipping-shipcloud.php : 65

Sender data

`private array<string|int, mixed> $sender = []`

### Methods

#### __construct()

class-wc-shipping-shipcloud.php : 87

Constructor.

`public __construct(int $instance_id) : void`

##### Parameters

$instance_id : int

  Instance ID.

##### Return values

void —

#### add_calculate_shipping_fields()

class-wc-shipping-shipcloud.php : 534

Setting Address field after submiting

`public add_calculate_shipping_fields() : void`

##### Return values

void —

#### add_calculate_shipping_form_fields()

class-wc-shipping-shipcloud.php : 519

Adding form field for Address Field and enabling City field

`public add_calculate_shipping_form_fields(bool $wc_shipping_calculator_enable_city) : bool`

##### Parameters

$wc_shipping_calculator_enable_city : bool

##### Return values

bool —

#### admin_options()

class-wc-shipping-shipcloud.php : 543

This method is called just before the settings are displayed.

`public admin_options() : void`

##### Return values

void —

#### calculate_shipping()

class-wc-shipping-shipcloud.php : 284

Calculate shipping costs.

`public calculate_shipping([array<string|int, mixed> $package = [] ]) : void`

##### Parameters

$package : array<string|int, mixed> = []

  Package to ship.

##### Return values

void —

#### clear_transients()

class-wc-shipping-shipcloud.php : 272

Clear Template transients.

`public clear_transients() : void`

##### Return values

void —

#### generate_hidden_html()

class-wc-shipping-shipcloud.php : 715

Generate hidden HTML.

`public generate_hidden_html(string $key, array<string|int, mixed> $data) : string`

##### Parameters

$key : string

  Field key.

$data : array<string|int, mixed>

  Field data.

##### Return values

string —

#### generate_multiselect_html()

class-wc-shipping-shipcloud.php : 661

Generate multi-select HTML.

`public generate_multiselect_html(string $key, array<string|int, mixed> $data) : string`

##### Parameters

$key : string

  Field key.

$data : array<string|int, mixed>

  Field data.

##### Return values

string —

#### get_allowed_carriers()

class-wc-shipping-shipcloud.php : 260

Getting allowed carriers

`public get_allowed_carriers() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### get_carriers()

class-wc-shipping-shipcloud.php : 251

Getting carriers

`public get_carriers() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### get_instance_form_fields()

class-wc-shipping-shipcloud.php : 203

Get settings fields for instances of this shipping method (within zones).

`public get_instance_form_fields() : array<string|int, mixed>`

Should be overridden by shipping methods to add options.

##### Return values

array<string|int, mixed> —

#### get_option()

class-wc-shipping-shipcloud.php : 742

Getting option (overwrite instance values if there option of instance is empty

`public get_option(string $key[, null $empty_value = null ]) : mixed|string`

##### Parameters

$key : string
$empty_value : null = null

##### Return values

mixed|string —

#### init_form_fields()

class-wc-shipping-shipcloud.php : 187

Set form fields.

`public init_form_fields() : void`

##### Return values

void —

#### is_available()

class-wc-shipping-shipcloud.php : 213

Checks whether shipping method is available or not.

`public is_available(array<string|int, mixed> $package) : bool`

##### Parameters

$package : array<string|int, mixed>

  Package to ship.

##### Return values

bool —

True if shipping method is available.

#### process_admin_options()

class-wc-shipping-shipcloud.php : 569

This method is called once settings are saved.

`public process_admin_options() : void`

##### Return values

void —

#### add_admin_notice()

class-wc-shipping-shipcloud.php : 759

Output an admin notice.

`private add_admin_notice(string $message[, string $type = 'info' ][, bool $dismissible = true ]) : void`

##### Parameters

$message : string

  Debug message.

$type : string = 'info'

  Message type.

$dismissible : bool = true

  Message type.

##### Return values

void —

#### check_webhook_preconditions()

class-wc-shipping-shipcloud.php : 613

Check if webhook woocommerce api is enabled when shipcloud webhook should be used

`private check_webhook_preconditions() : void`

##### Return values

void —

#### environment_check()

class-wc-shipping-shipcloud.php : 580

Environment check.

`private environment_check() : void`

##### Return values

void —

#### get_carrier_options()

class-wc-shipping-shipcloud.php : 143

Extract carrier options for multiselect list.

`private get_carrier_options(array<string|int, mixed> $carriers[, bool $only_allowed = false ][, bool $grouped = false ]) : array<string|int, mixed>`

##### Parameters

$carriers : array<string|int, mixed>
$only_allowed : bool = false
$grouped : bool = false

##### Return values

array<string|int, mixed> —

#### get_parcel_dimensions()

class-wc-shipping-shipcloud.php : 345

Getting dimensions for each parcel

`private get_parcel_dimensions(mixed $package) : array<string|int, mixed>`

##### Parameters

$package : mixed

##### Return values

array<string|int, mixed> —

$parcels

#### get_product_dimensions()

class-wc-shipping-shipcloud.php : 389

Getting product dimensions

`private get_product_dimensions( $product) : array<string|int, mixed>`

##### Parameters

$product :

##### Return values

array<string|int, mixed> —

#### get_recipient()

class-wc-shipping-shipcloud.php : 493

Getting recipient address from package

`private get_recipient( $package) : array<string|int, mixed>`

##### Parameters

$package :

##### Return values

array<string|int, mixed> —

#### get_sender()

class-wc-shipping-shipcloud.php : 471

Getting sender address

`private get_sender() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

$sender

#### get_shipping_class_dimensions()

class-wc-shipping-shipcloud.php : 418

Getting shipping class dimensions

`private get_shipping_class_dimensions( $shipping_class) : array<string|int, mixed>|null`

##### Parameters

$shipping_class :

##### Return values

array<string|int, mixed>|null —

#### get_shipping_classes()

class-wc-shipping-shipcloud.php : 368

Getting shipping classes for order package

`private get_shipping_classes( $package) : array<string|int, mixed>`

##### Parameters

$package :

  Package given on

##### Return values

array<string|int, mixed> —

$shipping_classes

#### get_shipping_costs()

class-wc-shipping-shipcloud.php : 452

Calculate the costs for parcel shipping.

`private get_shipping_costs( $parcel_dimensions) : float`

##### Parameters

$parcel_dimensions :

##### Return values

float —

#### init()

class-wc-shipping-shipcloud.php : 166

Initialization.

`private init() : void`

##### Return values

void —

#### log()

class-wc-shipping-shipcloud.php : 771

Output a debug message.

`private log(string $message[, string $level = 'info' ][, mixed $context = [] ]) : void`

##### Parameters

$message : string

  Debug message.

$level : string = 'info'

  Debug level.

$context : mixed = []

  The Debug context.

##### Return values

void —

#### set_settings()

class-wc-shipping-shipcloud.php : 233

Initialize settings is called on init and after saving plugin settings.

`private set_settings() : bool`

##### Return values

bool —

## Search results