WC_Product_Offline_Gift_Card
extends WC_Product
in package
extending wc_product class to add a new product type overriding all the necessary methods
Table of Contents
- __construct() : mixed
- init the custom product type
- add_to_cart_description() : string
- button description used in tags
- add_to_cart_text() : string
- get the add to cart button text.
- get_max_price() : float
- returns the maximum price for given product
- get_min_price() : float
- returns the minimum price for given product
- get_price_html() : string
- formats the price html
- get_recommended_price() : float
- returns the recommended price for given product
- get_tax_status() : string
- returns the tax status
- get_type() : string
- returns the product type
Methods
__construct()
init the custom product type
public
__construct(mixed $product) : mixed
@param Int|WC_Product $product The product object
Parameters
- $product : mixed
Return values
mixed —add_to_cart_description()
button description used in tags
public
add_to_cart_description() : string
Return values
string —The description
add_to_cart_text()
get the add to cart button text.
public
add_to_cart_text() : string
Return values
string —The text
get_max_price()
returns the maximum price for given product
public
get_max_price() : float
Return values
float —get_min_price()
returns the minimum price for given product
public
get_min_price() : float
Return values
float —get_price_html()
formats the price html
public
get_price_html([int|string $price = '' ]) : string
Parameters
- $price : int|string = ''
-
The price to format
Return values
string —Price html
get_recommended_price()
returns the recommended price for given product
public
get_recommended_price() : float
Return values
float —get_tax_status()
returns the tax status
public
get_tax_status([mixed $context = 'view' ]) : string
Parameters
- $context : mixed = 'view'
Return values
string —get_type()
returns the product type
public
get_type() : string
Return values
string —Product type