DeprecatedVariables

Type
Trait
Namespace
craft\commerce\plugin
Implemented by
craft\commerce\Plugin
Since
2.0

Trait Deprecated Variables

View source

Public Methods

MethodDescription
getAvailableShippingMethods()Returns all available shipping methods for the current cart.
getCart()Returns the current Cart.
getCountriesList()Return an array of country names, indexed by ID.
getCustomer()Returns the current customer.
getDiscountByCode()Returns a discount by its code.
getPrimaryPaymentCurrency()Returns the primary payment currency.
getStatesArray()Returns a 2D array of state names indexed by state ids, grouped by country ids.

getAvailableShippingMethods()

DEPRECATED

Deprecated as of 2.0

Returns all available shipping methods for the current cart.

View source

Returns

array

Signature

public array getAvailableShippingMethods ( )

getCart()

DEPRECATED

Deprecated as of 2.0

Returns the current Cart.

View source

Returns

craft\commerce\elements\Order

Signature

public craft\commerce\elements\Order getCart ( )

getCountriesList()

DEPRECATED

Deprecated as of 2.0

Return an array of country names, indexed by ID.

View source

Returns

array – [id => name]

Signature

public array getCountriesList ( )

getCustomer()

DEPRECATED

Deprecated as of 2.0

Returns the current customer.

View source

Returns

craft\commerce\models\Customer

Signature

public craft\commerce\models\Customer getCustomer ( )

getDiscountByCode()

DEPRECATED

Deprecated as of 2.0

Returns a discount by its code.

View source

Arguments

  • $code (string) – The discount code

Returns

\craft\commerce\plugin\Discount, null

Signature

public \craft\commerce\plugin\Discount, null getDiscountByCode ( $code )

getPrimaryPaymentCurrency()

DEPRECATED

Deprecated as of 2.0

Returns the primary payment currency.

View source

Returns

\craft\commerce\plugin\PaymentCurrency, null

Signature

public \craft\commerce\plugin\PaymentCurrency, null getPrimaryPaymentCurrency ( )

getStatesArray()

DEPRECATED

Deprecated as of 2.0

Returns a 2D array of state names indexed by state ids, grouped by country ids.

View source

Returns

array – [countryId => [id => name]]

Signature

public array getStatesArray ( )