Product_Addons implements Premium_Service, Registerable
Handles the WooCommerce Product Addons integration.
Tags
Interfaces, Classes and Traits
- Premium_Service
- Registerable
Table of Contents
- add_modal_data() : array<string|int, mixed>
- Add the HTML for the addons to the lightbox.
- load_scripts() : mixed
- Load the scripts required for the WooCommerce Product Addons integration.
- register() : mixed
- Register the integrations for Product Addons.
- set_checked_order_type() : string
- Sets the order type during the REST request, if 'OT_CHECK' was used for the product.
- set_order_type() : string
- If using WooCommerce Product Addons we don't know at this stage whether there are addons for the product, so we return 'check'.
- storefront_remove_handheld_footer_bar_cart_link() : array<string|int, mixed>
- Remove 'cart' from mobile menu as it conflicts with Product Addons 4.7.0.
Methods
add_modal_data()
Add the HTML for the addons to the lightbox.
public
add_modal_data(array<string|int, mixed> $data, WC_Product $product) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
-
The modal data before this filter ran
- $product : WC_Product
-
The product
Tags
Return values
array<string|int, mixed> —The updated modal data
load_scripts()
Load the scripts required for the WooCommerce Product Addons integration.
public
load_scripts() : mixed
Tags
Return values
mixed —register()
Register the integrations for Product Addons.
public
register() : mixed
Tags
Return values
mixed —set_checked_order_type()
Sets the order type during the REST request, if 'OT_CHECK' was used for the product.
public
set_checked_order_type(string $order_type, WC_Product $product) : string
Parameters
- $order_type : string
-
The order type before this filter ran
- $product : WC_Product
-
The product
Tags
Return values
string —The order type - OT_QUICK or OT_LIGHTBOX
set_order_type()
If using WooCommerce Product Addons we don't know at this stage whether there are addons for the product, so we return 'check'.
public
set_order_type(string $order_type, WC_Product $product, Menu_Options $options) : string
If this product is ordered, we then perform the full check on the product and either add the product (if there are no addons) or show the modal if there are.
Parameters
- $order_type : string
-
The order type before this filter ran
- $product : WC_Product
-
The product
- $options : Menu_Options
-
The menu options
Tags
Return values
string —The order type - OT_QUICK, OT_LIGHTBOX, or OT_CHECK
storefront_remove_handheld_footer_bar_cart_link()
Remove 'cart' from mobile menu as it conflicts with Product Addons 4.7.0.
public
storefront_remove_handheld_footer_bar_cart_link(array<string|int, mixed> $links) : array<string|int, mixed>
Parameters
- $links : array<string|int, mixed>
-
The links.
Tags
Return values
array<string|int, mixed> —The links.