Skip to content

Purchasable ​

Type
Class
Namespace
craft\commerce\helpers
Inherits
craft\commerce\helpers\Purchasable
Since
3.2.8

Purchasable helper

View source

Public Methods ​

MethodDescription
availableForPurchaseInputHtml()
catalogPricingRulesTableByPurchasableId()
isTempSku()Returns whether the given SKU is temporary.
skuInputHtml()
tempSku()Generates a new temporary SKU.

availableForPurchaseInputHtml() ​

Since
5.0.0

View source

Arguments ​

Returns ​

string

catalogPricingRulesTableByPurchasableId() ​

View source

Arguments ​

  • $purchasableId (integer)
  • $storeId (integer)
  • $catalogPricing (\Illuminate\Support\Collection, null)

Returns ​

string

Throws ​

isTempSku() ​

Since
3.2.8

Returns whether the given SKU is temporary.

View source

Arguments ​

  • $sku

skuInputHtml() ​

Since
5.0.0

View source

Arguments ​

Returns ​

string

tempSku() ​

Since
3.2.8

Generates a new temporary SKU.

View source

Constants ​

ConstantDescription
TEMPORARY_SKU_PREFIX