Class ProductShippingModel

Instances of ProductShippingModel provide access to product-level shipping information, such as applicable or inapplicable shipping methods and shipping cost defined for the product for a specified shipping method.

Use ShippingMgr.getProductShippingModel(Product) to get the shipping model for a specific product.

Property Summary 

PropertyDescription
applicableShippingMethods: Collection (read-only)Returns the active applicable shipping methods for the product related to this shipping model, i.e.
inapplicableShippingMethods: Collection (read-only)Returns the active inapplicable shipping methods for the product related to this shipping model, i.e.
shippingMethodsWithShippingCost: Collection (read-only)Returns the active shipping methods for which either any fixed-price or surcharge product-level shipping cost is defined for the specified product.

Constructor Summary 

This class does not have a constructor, so you cannot create it directly.

Method Summary 

MethodDescription
getApplicableShippingMethods()Returns the active applicable shipping methods for the product related to this shipping model, i.e.
getInapplicableShippingMethods()Returns the active inapplicable shipping methods for the product related to this shipping model, i.e.
getShippingCost(ShippingMethod)Returns the shipping cost object for the related product and the specified shipping method, or null if no product-level fixed-price or surcharge shipping cost are defined for the specified product.
getShippingMethodsWithShippingCost()Returns the active shipping methods for which either any fixed-price or surcharge product-level shipping cost is defined for the specified product.

Methods inherited from class Object 

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

Property Details 

applicableShippingMethods 

applicableShippingMethods: Collection (read-only)

Returns the active applicable shipping methods for the product related to this shipping model, i.e. shipping methods the product can be shipped with. A product can be shipping with a shipping methods if the shipping method is not explicitely marked as inapplicable for this product.


inapplicableShippingMethods 

inapplicableShippingMethods: Collection (read-only)

Returns the active inapplicable shipping methods for the product related to this shipping model, i.e. shipping methods the product cannot be shipped with. A product cannot be shipping with a shipping methods if the shipping method is explicitely marked as inapplicable for this product.


shippingMethodsWithShippingCost 

shippingMethodsWithShippingCost: Collection (read-only)

Returns the active shipping methods for which either any fixed-price or surcharge product-level shipping cost is defined for the specified product.

Note that this can include inapplicable shipping methods (see getInapplicableShippingMethods()).


Method Details 

getApplicableShippingMethods() 

getApplicableShippingMethods(): Collection

Returns the active applicable shipping methods for the product related to this shipping model, i.e. shipping methods the product can be shipped with. A product can be shipping with a shipping methods if the shipping method is not explicitely marked as inapplicable for this product.

Returns:

  • Applicable shipping methods for the product

getInapplicableShippingMethods() 

getInapplicableShippingMethods(): Collection

Returns the active inapplicable shipping methods for the product related to this shipping model, i.e. shipping methods the product cannot be shipped with. A product cannot be shipping with a shipping methods if the shipping method is explicitely marked as inapplicable for this product.

Returns:

  • Inapplicable shipping methods for the product

getShippingCost(ShippingMethod) 

getShippingCost(shippingMethod: ShippingMethod): ProductShippingCost

Returns the shipping cost object for the related product and the specified shipping method, or null if no product-level fixed-price or surcharge shipping cost are defined for the specified product.

The following rules apply:

  • if fixed and surcharge shipping cost is defined for a product, the fixed cost takes precedence
  • if a product is member of multiple shipping cost groups, the lowest shipping cost takes precedence

Parameters:

  • shippingMethod - the shipping method to use.

Returns:

  • Product shipping cost

getShippingMethodsWithShippingCost() 

getShippingMethodsWithShippingCost(): Collection

Returns the active shipping methods for which either any fixed-price or surcharge product-level shipping cost is defined for the specified product.

Note that this can include inapplicable shipping methods (see getInapplicableShippingMethods()).

Returns:

  • Shipping methods with shipping cost

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!