Menu

## WC_Shipping_Shipcloud_Order
in package

class-wc-shipping-shipcloud-order.php : 16

### Table of Contents

$_instance : mixed
  The Single instance of the class
$order_id : mixed
  Order ID
$allowed_carriers : array<string|int, mixed>
  Filtered Carriers
$api : WC_Shipping_Shipcloud_API_Adapter
  API Adapter
$carriers : array<string|int, mixed>
  Loaded Carriers
$options : array<string|int, mixed>
  Loaded Options
$wc_order : WC_Order
  WooCommerce Order object
add_care_of_as_billing_input_field() : array<string|int, mixed>
  Adds care of billing input field
add_care_of_as_shipping_input_field() : array<string|int, mixed>
  Adds care of shipping input field
add_legal_checkboxes() : void
  Add legal checkboxes to checkout page
add_metaboxes() : void
  Adding meta boxes
add_pakadoo_id_input_field() : array<string|int, mixed>
  Adds pakadoo id shipping input field
add_sender_phone_input_field() : array<string|int, mixed>
  Adds sender phone as shipping input field
additional_services_from_request() : string
  Returns parses additional services from request form and returns them in an api hash
admin_enqueue_scripts() : void
  Enqueuing needed Scripts & Styles
ajax_calculate_shipping() : json
  Calulating shipping after submitting calculation
ajax_create_pickup_request() : json
  Create a pickup request for a given shipment
ajax_create_shipment() : json
  Creating shipment
ajax_delete_shipment() : json
  Deleting a shipment
ajax_force_delete_shipment() : json
  Force deleting a shipment
ajax_get_pakadoo_point() : json
  Getting a pakadoo point
ajax_update_shipment() : json
  Updating a shipment
create_order() : WC_Shipping_Shipcloud_Order
  Factory to create or load an order.
create_pickup_request() : json
  Create pickup request at shipcloud
create_shipment() : mixed
create_shipment_center() : string
  Product metabox
display_tracking_information() : void
  Show tracking information at my account page
email_notification_enabled() : bool
  Getting option email notification enabled by customer
get_allowed_carriers() : array<string|int, mixed>
  Getting allowed carriers
get_calculated_weight() : float
  Calculate weight
get_description() : string|null
  Receive the description
get_email_for_notification() : string
  Gets email for notification.
get_global_reference_number() : string|null
  Receive the global reference number
get_instance() : object
  Main Instance
get_parcel_templates() : array<string|int, mixed>
  Creates an array of available parcel templates.
get_shipping_method_name() : string
  Getting shipping method name
get_wc_order() : WC_Order
  Getting WC order object.
handle_legal_checkboxes_update() : void
  Handle checkbox updates
is_auto_weight_calculation_on() : bool
  Determine if the config value 'auto_weight_calculation' is active
save_settings() : void
  Saving product metabox
__construct() : void
  Constructor
add_admin_notice() : void
  Output an admin notice.
add_care_of_input_field() : array<string|int, mixed>
  Adds care of input field
carrier_email_notification_enabled() : bool
  Getting option carrier email notification enabled
delete_shipment_from_db() : bool|WP_Error
  Deleting a shipment from the database
extract_pickup_time() : array<string|int, mixed>
  Extract pickup time from request
generate_parcel_template() : array<string|int, mixed>|bool
  Generates a single parcel template array.
get_addresses() : array<string|int, mixed>
  Getting addresses.
get_care_of() : string
  Resolve care of from order.
get_option() : mixed|string
  Getting option (overwrite instance values if there option of instance is empty
get_order() : WC_Order
  Getting order object.
get_phone() : string
  Resolve phone number from order.
get_recipient() : array<string|int, mixed>|mixed
  Getting recipient.
get_sender() : array<string|int, mixed>|mixed
  Getting sender.
handle_customs_declaration() : array<string|int, mixed>
  Handle customs declaration
handle_return_shipments() : array<string|int, mixed>
  Check to see if it's a return shipment
init() : void
  Initialize Hooks
log() : void
  Output a debug message.
prefix_data() : array<string|int, mixed>
  Prefixes data.
sanitize_address() : array<string|int, mixed>
  Help the user sanitizing the sender address.
sanitize_package() : array<string|int, mixed>
  Sanitize package data.
sanitize_parcel_data() : mixed
sanitize_reference_number() : array<string|int, mixed>
  Replace shipcloud shortcodes in reference_number
sanitize_shop_owner_data() : array<string|int, mixed>
  Sanitize shop owner data.
shipcloud_email_notification_enabled() : bool
  Getting option shipcloud email notification enabled

### Properties

#### $_instance

class-wc-shipping-shipcloud-order.php : 51

The Single instance of the class

`protected static mixed $_instance = ull`

#### $order_id

class-wc-shipping-shipcloud-order.php : 58

Order ID

`protected mixed $order_id`

#### $allowed_carriers

class-wc-shipping-shipcloud-order.php : 44

Filtered Carriers

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

#### $api

class-wc-shipping-shipcloud-order.php : 23

API Adapter

`private WC_Shipping_Shipcloud_API_Adapter $api`

#### $carriers

class-wc-shipping-shipcloud-order.php : 37

Loaded Carriers

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

#### $options

class-wc-shipping-shipcloud-order.php : 30

Loaded Options

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

#### $wc_order

class-wc-shipping-shipcloud-order.php : 65

WooCommerce Order object

`private WC_Order $wc_order = ull`

### Methods

#### add_care_of_as_billing_input_field()

class-wc-shipping-shipcloud-order.php : 281

Adds care of billing input field

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

##### Parameters

$data : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### add_care_of_as_shipping_input_field()

class-wc-shipping-shipcloud-order.php : 291

Adds care of shipping input field

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

##### Parameters

$data : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### add_legal_checkboxes()

class-wc-shipping-shipcloud-order.php : 382

Add legal checkboxes to checkout page

`public add_legal_checkboxes() : void`

##### Return values

void —

#### add_metaboxes()

class-wc-shipping-shipcloud-order.php : 202

Adding meta boxes

`public add_metaboxes() : void`

##### Return values

void —

#### add_pakadoo_id_input_field()

class-wc-shipping-shipcloud-order.php : 329

Adds pakadoo id shipping input field

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

##### Parameters

$data : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### add_sender_phone_input_field()

class-wc-shipping-shipcloud-order.php : 359

Adds sender phone as shipping input field

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

##### Parameters

$data : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### additional_services_from_request()

class-wc-shipping-shipcloud-order.php : 1850

Returns parses additional services from request form and returns them in an api hash

`public additional_services_from_request(array<string|int, mixed> $data, string $carrier[, WC_Order $order = null ]) : string`

##### Parameters

$data : array<string|int, mixed>
$carrier : string
$order : WC_Order = null

##### Return values

string —

#### admin_enqueue_scripts()

class-wc-shipping-shipcloud-order.php : 157

Enqueuing needed Scripts & Styles

`public admin_enqueue_scripts() : void`

##### Return values

void —

#### ajax_calculate_shipping()

class-wc-shipping-shipcloud-order.php : 452

Calulating shipping after submitting calculation

`public ajax_calculate_shipping() : json`

##### Return values

json —

#### ajax_create_pickup_request()

class-wc-shipping-shipcloud-order.php : 705

Create a pickup request for a given shipment

`public ajax_create_pickup_request() : json`

##### Return values

json —

#### ajax_create_shipment()

class-wc-shipping-shipcloud-order.php : 502

Creating shipment

`public ajax_create_shipment( $data) : json`

##### Parameters

$data :

##### Return values

json —

#### ajax_delete_shipment()

class-wc-shipping-shipcloud-order.php : 660

Deleting a shipment

`public ajax_delete_shipment() : json`

##### Return values

json —

#### ajax_force_delete_shipment()

class-wc-shipping-shipcloud-order.php : 695

Force deleting a shipment

`public ajax_force_delete_shipment() : json`

##### Return values

json —

#### ajax_get_pakadoo_point()

class-wc-shipping-shipcloud-order.php : 751

Getting a pakadoo point

`public ajax_get_pakadoo_point() : json`

##### Return values

json —

#### ajax_update_shipment()

class-wc-shipping-shipcloud-order.php : 543

Updating a shipment

`public ajax_update_shipment() : json`

##### Return values

json —

#### create_order()

class-wc-shipping-shipcloud-order.php : 148

Factory to create or load an order.

`public create_order(int $order_id) : WC_Shipping_Shipcloud_Order`

##### Parameters

$order_id : int

  ID of the order as chosen by WooCommerce and found in the database.

##### Return values

WC_Shipping_Shipcloud_Order —

#### create_pickup_request()

class-wc-shipping-shipcloud-order.php : 1633

Create pickup request at shipcloud

`public create_pickup_request(mixed $order_id, mixed $data) : json`

##### Parameters

$order_id : mixed
$data : mixed

##### Return values

json —

#### create_shipment()

class-wc-shipping-shipcloud-order.php : 786
`public create_shipment(mixed $data) : mixed`

##### Parameters

$data : mixed

##### Return values

mixed —

#### create_shipment_center()

class-wc-shipping-shipcloud-order.php : 216

Product metabox

`public create_shipment_center() : string`

##### Return values

string —

#### display_tracking_information()

class-wc-shipping-shipcloud-order.php : 424

Show tracking information at my account page

`public display_tracking_information(WC_Order $order) : void`

##### Parameters

$order : WC_Order

##### Return values

void —

#### email_notification_enabled()

class-wc-shipping-shipcloud-order.php : 2126

Getting option email notification enabled by customer

`public email_notification_enabled() : bool`

##### Return values

bool —

#### get_allowed_carriers()

class-wc-shipping-shipcloud-order.php : 2080

Getting allowed carriers

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

##### Return values

array<string|int, mixed> —

#### get_calculated_weight()

class-wc-shipping-shipcloud-order.php : 1591

Calculate weight

`public get_calculated_weight() : float`

##### Return values

float —

$calculated_weight

#### get_description()

class-wc-shipping-shipcloud-order.php : 2137

Receive the description

`public get_description() : string|null`

##### Return values

string|null —

#### get_email_for_notification()

class-wc-shipping-shipcloud-order.php : 1198

Gets email for notification.

`public get_email_for_notification() : string`

##### Return values

string —

#### get_global_reference_number()

class-wc-shipping-shipcloud-order.php : 2152

Receive the global reference number

`public get_global_reference_number() : string|null`

##### Return values

string|null —

#### get_instance()

class-wc-shipping-shipcloud-order.php : 134

Main Instance

`public static get_instance() : object`

##### Return values

object —

#### get_parcel_templates()

class-wc-shipping-shipcloud-order.php : 1275

Creates an array of available parcel templates.

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

##### Return values

array<string|int, mixed> —

#### get_shipping_method_name()

class-wc-shipping-shipcloud-order.php : 2089

Getting shipping method name

`public get_shipping_method_name() : string`

##### Return values

string —

#### get_wc_order()

class-wc-shipping-shipcloud-order.php : 1002

Getting WC order object.

`public get_wc_order([ $order_id = '' ]) : WC_Order`

##### Parameters

$order_id : = ''

##### Return values

WC_Order —

#### handle_legal_checkboxes_update()

class-wc-shipping-shipcloud-order.php : 400

Handle checkbox updates

`public handle_legal_checkboxes_update(int $order_id) : void`

##### Parameters

$order_id : int

##### Return values

void —

#### is_auto_weight_calculation_on()

class-wc-shipping-shipcloud-order.php : 1621

Determine if the config value 'auto_weight_calculation' is active

`public is_auto_weight_calculation_on() : bool`

##### Return values

bool —

#### save_settings()

class-wc-shipping-shipcloud-order.php : 244

Saving product metabox

`public save_settings(int $post_id) : void`

##### Parameters

$post_id : int

##### Return values

void —

#### __construct()

class-wc-shipping-shipcloud-order.php : 73

Constructor

`private __construct([null|mixed $order_id = null ]) : void`

##### Parameters

$order_id : null|mixed = null

##### Return values

void —

#### add_admin_notice()

class-wc-shipping-shipcloud-order.php : 2183

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 —

#### add_care_of_input_field()

class-wc-shipping-shipcloud-order.php : 301

Adds care of input field

`private add_care_of_input_field(array<string|int, mixed> $data, mixed $category) : array<string|int, mixed>`

##### Parameters

$data : array<string|int, mixed>
$category : mixed

##### Return values

array<string|int, mixed> —

#### carrier_email_notification_enabled()

class-wc-shipping-shipcloud-order.php : 2102

Getting option carrier email notification enabled

`private carrier_email_notification_enabled() : bool`

##### Return values

bool —

#### delete_shipment_from_db()

class-wc-shipping-shipcloud-order.php : 1822

Deleting a shipment from the database

`private delete_shipment_from_db(mixed $shipment_id) : bool|WP_Error`

##### Parameters

$shipment_id : mixed

##### Return values

bool|WP_Error —

#### extract_pickup_time()

class-wc-shipping-shipcloud-order.php : 1496

Extract pickup time from request

`private extract_pickup_time( $data[, $method = null ]) : array<string|int, mixed>`

##### Parameters

$data :
$method : = null

##### Return values

array<string|int, mixed> —

$pickup

#### generate_parcel_template()

class-wc-shipping-shipcloud-order.php : 1304

Generates a single parcel template array.

`private generate_parcel_template(WP_Post $data) : array<string|int, mixed>|bool`

##### Parameters

$data : WP_Post

##### Return values

array<string|int, mixed>|bool —

#### get_addresses()

class-wc-shipping-shipcloud-order.php : 1015

Getting addresses.

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

##### Return values

array<string|int, mixed> —

$addresses

#### get_care_of()

class-wc-shipping-shipcloud-order.php : 1158

Resolve care of from order.

`private get_care_of() : string`

This will take in advance:

- The custom field "care of"
- The shipping address
- At last the billing address

##### Return values

string —

#### get_option()

class-wc-shipping-shipcloud-order.php : 2171

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

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

##### Parameters

$key : string
$empty_value : null = null

##### Return values

mixed|string —

#### get_order()

class-wc-shipping-shipcloud-order.php : 992

Getting order object.

`private get_order() : WC_Order`

##### Return values

WC_Order —

#### get_phone()

class-wc-shipping-shipcloud-order.php : 1215

Resolve phone number from order.

`private get_phone() : string`

##### Return values

string —

#### get_recipient()

class-wc-shipping-shipcloud-order.php : 1108

Getting recipient.

`private get_recipient([string $prefix = '' ]) : array<string|int, mixed>|mixed`

##### Parameters

$prefix : string = ''

##### Return values

array<string|int, mixed>|mixed —

#### get_sender()

class-wc-shipping-shipcloud-order.php : 1029

Getting sender.

`private get_sender([mixed $prefix = '' ]) : array<string|int, mixed>|mixed`

##### Parameters

$prefix : mixed = ''

##### Return values

array<string|int, mixed>|mixed —

#### handle_customs_declaration()

class-wc-shipping-shipcloud-order.php : 1418

Handle customs declaration

`private handle_customs_declaration(array<string|int, mixed> $data) : array<string|int, mixed>`

##### Parameters

$data : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### handle_return_shipments()

class-wc-shipping-shipcloud-order.php : 1353

Check to see if it's a return shipment

`private handle_return_shipments(array<string|int, mixed> $data) : array<string|int, mixed>`

##### Parameters

$data : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### init()

class-wc-shipping-shipcloud-order.php : 83

Initialize Hooks

`private init() : void`

##### Return values

void —

#### log()

class-wc-shipping-shipcloud-order.php : 2195

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 —

#### prefix_data()

class-wc-shipping-shipcloud-order.php : 1083

Prefixes data.

`private prefix_data(array<string|int, mixed> $data, mixed $prefix) : array<string|int, mixed>`

##### Parameters

$data : array<string|int, mixed>
$prefix : mixed

##### Return values

array<string|int, mixed> —

#### sanitize_address()

class-wc-shipping-shipcloud-order.php : 1239

Help the user sanitizing the sender address.

`private sanitize_address( $data[, string $prefix = '' ]) : array<string|int, mixed>`

##### Parameters

$data :
$prefix : string = ''

##### Return values

array<string|int, mixed> —

#### sanitize_package()

class-wc-shipping-shipcloud-order.php : 1446

Sanitize package data.

`private sanitize_package(array<string|int, mixed> $package_data) : array<string|int, mixed>`

User enter package data that can:

- Have local decimal separator.

##### Parameters

$package_data : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### sanitize_parcel_data()

class-wc-shipping-shipcloud-order.php : 1467
`private sanitize_parcel_data(mixed $data) : mixed`

##### Parameters

$data : mixed

##### Return values

mixed —

#### sanitize_reference_number()

class-wc-shipping-shipcloud-order.php : 1404

Replace shipcloud shortcodes in reference_number

`private sanitize_reference_number(array<string|int, mixed> $data) : array<string|int, mixed>`

##### Parameters

$data : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### sanitize_shop_owner_data()

class-wc-shipping-shipcloud-order.php : 1371

Sanitize shop owner data.

`private sanitize_shop_owner_data(array<string|int, mixed> $data) : array<string|int, mixed>`

##### Parameters

$data : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### shipcloud_email_notification_enabled()

class-wc-shipping-shipcloud-order.php : 2114

Getting option shipcloud email notification enabled

`private shipcloud_email_notification_enabled() : bool`

##### Return values

bool —

## Search results