Product
Product model class.
Description #
Source #
Changelog #
Version | Description |
---|---|
4.6.0 | Introduced. |
Methods #
- enroll — Adds access for a user.
- get_allowed_post_types — Returns allowed post types.
- get_display_price — Returns the display price.
- get_display_trial_price — Returns the display trial price.
- get_formatted_display_price — Returns the formatted display price (with the currency).
- get_pricing — Returns a pricing DTO.
- get_pricing_settings — Returns formatted post pricing data.
- get_pricing_type — Returns a product type (buy now, subscription, free, open, closed, etc).
- get_type_label — Returns a product type label. Usually "Course" or "Group".
- has_trial — Returns true when the product has a trial.
- is_content_visible — Returns whether the product content should be visible.
- is_price_type_closed — Returns if the product price type is closed.
- is_price_type_free — Returns if the product price type is free.
- is_price_type_open — Returns if the product price type is open.
- is_price_type_paynow — Returns if the product price type is paynow.
- is_price_type_subscribe — Returns if the product price type is subscribe.
- unenroll — Removes access for a user.
- user_has_access — Returns true if a user has access to this product, false otherwise.