PHP 클래스 WC_Product_Grouped

Grouped products cannot be purchased - they are wrappers for other products.
저자: WooThemes
상속: extends WC_Product
파일 보기 프로젝트 열기: woocommerce/woocommerce 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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