Méthode |
Description |
|
add_to_cart_url ( ) : string |
Get the add to url used mainly in loops. |
|
get_attributes ( string $context = 'view' ) : array |
Returns array of attribute name value pairs. Keys are prefixed with attribute_, as stored. |
|
get_backorders ( string $context = 'view' ) : string |
Get backorders. |
|
get_height ( string $context = 'view' ) : string |
Returns the product height. |
|
get_image_id ( string $context = 'view' ) : string |
Get main image ID. |
|
get_length ( string $context = 'view' ) : string |
Returns the product length. |
|
get_manage_stock ( string $context = 'view' ) : boolean | string |
Return if product manage stock. |
|
get_permalink ( $item_object = null ) : string |
Wrapper for get_permalink. Adds this variations attributes to the URL. |
|
get_sku ( string $context = 'view' ) : string |
Get SKU (Stock-keeping unit) - product unique ID. |
|
get_stock_managed_by_id ( ) : integer |
If the stock level comes from another product ID. |
|
get_stock_quantity ( string $context = 'view' ) : integer | null |
Returns number of items available for sale. |
|
get_tax_class ( string $context = 'view' ) : string |
Returns the tax class. |
|
get_title ( ) : string |
Get the product's title. For variations this is the parent product name. |
|
get_type ( ) : string |
Get internal type. |
|
get_variation_attributes ( ) : array |
Get variation attribute values. Keys are prefixed with attribute_, as stored. |
|
get_weight ( string $context = 'view' ) : string |
Returns the product's weight. |
|
get_width ( string $context = 'view' ) : string |
Returns the product width. |
|
is_purchasable ( ) : boolean |
Returns false if the product cannot be bought. |
|
set_attributes ( array $raw_attributes ) |
Set attributes. Unlike the parent product which uses terms, variations are assigned
specific attributes using name value pairs. |
|
set_parent_data ( $parent_data ) |
Set the parent data array for this variation. |
|
variation_is_active ( ) : boolean |
Controls whether this particular variation will appear greyed-out (inactive) or not (active). |
|
variation_is_visible ( ) : boolean |
Checks if this particular variation is visible. Invisible variations are enabled and can be selected, but no price / stock info is displayed. |
|