PHP Класс WC_Product_Grouped

Grouped products cannot be purchased - they are wrappers for other products.
Автор: WooThemes
Наследование: extends WC_Product
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$extra_data array Stores product data.

Открытые методы

Метод Описание
__construct ( integer | WC_Product | object $product ) Merges grouped product data into the parent object.
add_to_cart_text ( ) : string Get the add to cart button text.
get_children ( string $context = 'view' ) : array Return the children of this product.
get_price_html ( string $price = '' ) : string Returns the price in html format.
get_type ( ) : string Get internal type.
is_on_sale ( ) : boolean Returns whether or not the product is on sale.
is_purchasable ( ) : boolean Returns false if the product cannot be bought.
set_children ( array $children ) Return the children of this product.
sync ( WC_Product | integer $product, boolean $save = true ) : WC_Product Sync a grouped product with it's children. These sync functions sync upwards (from child to parent) when the variation is saved.

Описание методов

__construct() публичный Метод

Merges grouped product data into the parent object.
public __construct ( integer | WC_Product | object $product )
$product integer | WC_Product | object Product to init.

add_to_cart_text() публичный Метод

Get the add to cart button text.
public add_to_cart_text ( ) : string
Результат string

get_children() публичный Метод

Return the children of this product.
public get_children ( string $context = 'view' ) : array
$context string
Результат array

get_price_html() публичный Метод

Returns the price in html format.
public get_price_html ( string $price = '' ) : string
$price string (default: '')
Результат string

get_type() публичный Метод

Get internal type.
public get_type ( ) : string
Результат string

is_on_sale() публичный Метод

Returns whether or not the product is on sale.
public is_on_sale ( ) : boolean
Результат boolean

is_purchasable() публичный Метод

Returns false if the product cannot be bought.
public is_purchasable ( ) : boolean
Результат boolean

set_children() публичный Метод

Return the children of this product.
public set_children ( array $children )
$children array

sync() публичный статический Метод

Sync a grouped product with it's children. These sync functions sync upwards (from child to parent) when the variation is saved.
public static sync ( WC_Product | integer $product, boolean $save = true ) : WC_Product
$product WC_Product | integer Product object or ID for which you wish to sync.
$save boolean If true, the prouduct object will be saved to the DB before returning it.
Результат WC_Product Synced product object.

Описание свойств

$extra_data защищенное свойство

Stores product data.
protected array $extra_data
Результат array