Property | Type | Description | |
---|---|---|---|
$extra_data | array | Stores product data. |
Method | Description | |
---|---|---|
__construct ( integer | WC_Product | object $product ) | Merges external product data into the parent object. | |
add_to_cart_text ( ) : string | Get the add to cart button text. | |
add_to_cart_url ( ) : string | Get the add to url used mainly in loops. | |
get_button_text ( string $context = 'view' ) : string | Get button text. | |
get_product_url ( string $context = 'view' ) : string | Get product url. | |
get_type ( ) : string | Get internal type. | |
is_purchasable ( ) : boolean | Returns false if the product cannot be bought. | |
set_backorders ( string $backorders ) | xternal products cannot be backordered. | |
set_button_text ( string $button_text ) | Set button text. | |
set_manage_stock ( $manage_stock ) | External products cannot be stock managed. | |
set_product_url ( string $product_url ) | Set product URL. | |
set_stock_status ( $stock_status = '' ) | External products cannot be stock managed. | |
single_add_to_cart_text ( ) : string | Get the add to cart button text for the single page. |
Method | Description | |
---|---|---|
read_product_data ( ) | Read post data. | |
update_post_meta ( ) | Helper method that updates all the post meta for an external product. |
public __construct ( integer | WC_Product | object $product ) | ||
$product | integer | WC_Product | object | Product to init. |
public add_to_cart_text ( ) : string | ||
return | string |
public add_to_cart_url ( ) : string | ||
return | string |
public get_button_text ( string $context = 'view' ) : string | ||
$context | string | |
return | string |
public get_product_url ( string $context = 'view' ) : string | ||
$context | string | |
return | string |
public is_purchasable ( ) : boolean | ||
return | boolean |
public set_backorders ( string $backorders ) | ||
$backorders | string | Options: 'yes', 'no' or 'notify'. |
public set_button_text ( string $button_text ) | ||
$button_text | string | Button text. |
public set_manage_stock ( $manage_stock ) |
public set_product_url ( string $product_url ) | ||
$product_url | string | Product URL. |
public set_stock_status ( $stock_status = '' ) |
public single_add_to_cart_text ( ) : string | ||
return | string |
protected update_post_meta ( ) |