Shipping_Handler implements Registerable, Standard_Service

Shipping Method Handler

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable
Standard_Service

Table of Contents

add_shipping_methods()  : array<string|int, WC_Shipping_Method>
Add all the Wholesale shipping methods to the list of available shipping methods.
filter_shipping_methods()  : array<string|int, WC_Shipping_Rate>
Filter WC Shipping Method by roles
is_free_shipping_rate_available()  : bool
Whether the wholesale free shipping method is available for the current user
is_shipping_rate_hidden()  : bool
Alter the Flat Rate visibility based on whether or not a free shipping rate is available
register()  : mixed
{@inheritdoc}
shipping_method_add_rate()  : WC_Shipping_Rate
Add the hide property to the instances of the Wholesale Flat Rate shipping method

Methods

add_shipping_methods()

Add all the Wholesale shipping methods to the list of available shipping methods.

public add_shipping_methods(array<string|int, WC_Shipping_Method$shipping_methods) : array<string|int, WC_Shipping_Method>
Parameters
$shipping_methods : array<string|int, WC_Shipping_Method>
Tags
Return values
array<string|int, WC_Shipping_Method>

filter_shipping_methods()

Filter WC Shipping Method by roles

public filter_shipping_methods(array<string|int, WC_Shipping_Rate$shipping_rates) : array<string|int, WC_Shipping_Rate>
Parameters
$shipping_rates : array<string|int, WC_Shipping_Rate>
Tags
Return values
array<string|int, WC_Shipping_Rate>

is_free_shipping_rate_available()

Whether the wholesale free shipping method is available for the current user

public is_free_shipping_rate_available(array<string|int, WC_Shipping_Rates$shipping_rates) : bool
Parameters
$shipping_rates : array<string|int, WC_Shipping_Rates>

The shipping rates available for the current package

Tags
Return values
bool

is_shipping_rate_hidden()

Alter the Flat Rate visibility based on whether or not a free shipping rate is available

public is_shipping_rate_hidden(bool $is_rate_hidden, array<string|int, mixed> $roles, WC_Shipping_Rate $shipping_rate, array<string|int, WC_Shipping_Rate$shipping_rates) : bool
Parameters
$is_rate_hidden : bool
$roles : array<string|int, mixed>
$shipping_rate : WC_Shipping_Rate
$shipping_rates : array<string|int, WC_Shipping_Rate>
Tags
Return values
bool

register()

{@inheritdoc}

public register() : mixed
Tags
Return values
mixed

shipping_method_add_rate()

Add the hide property to the instances of the Wholesale Flat Rate shipping method

public shipping_method_add_rate(WC_Shipping_Rate $rate, array<string|int, mixed> $args, WC_Shipping_Method $method) : WC_Shipping_Rate
Parameters
$rate : WC_Shipping_Rate
$args : array<string|int, mixed>
$method : WC_Shipping_Method
Tags
Return values
WC_Shipping_Rate

Search results