flatweight

package
v1.4.5-alpha1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2019 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConstShippingCode = "flat_weight"
	ConstShippingName = "Flat Weight"

	ConstConfigPathGroup   = "shipping.flat_weight"
	ConstConfigPathEnabled = "shipping.flat_weight.enabled"
	ConstConfigPathRates   = "shipping.flat_weight.rates"

	ConstErrorModule = "shipping/flatweight"
	ConstErrorLevel  = env.ConstErrorLevelActor
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Rate

type Rate struct {
	Title            string
	Code             string
	Price            float64
	WeightFrom       float64
	WeightTo         float64
	AllowedCountries string
	BannedCountries  string
}

type Rates

type Rates []Rate

type ShippingMethod

type ShippingMethod struct{}

ShippingMethod is a implementer of InterfaceShippingMethod for a "Flat Weight" shipping method

func (ShippingMethod) GetAllRates

func (it ShippingMethod) GetAllRates() []checkout.StructShippingRate

GetAllRates returns a list of all rates that are configured

func (ShippingMethod) GetCode

func (it ShippingMethod) GetCode() string

GetCode returns the shipping method's code

func (ShippingMethod) GetName

func (it ShippingMethod) GetName() string

GetName return the internal name of the shipping method

func (ShippingMethod) GetRates

func (it ShippingMethod) GetRates(checkoutInstance checkout.InterfaceCheckout) []checkout.StructShippingRate

GetRates returns the rates allowed for this order weight, based on config criteria

func (ShippingMethod) IsAllowed

func (it ShippingMethod) IsAllowed(checkoutInstance checkout.InterfaceCheckout) bool

IsAllowed Whether the method is enabled

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL