Restaurant_Ordering implements Standard_Service, Registerable
Handles the WooCommerce Restaurant Ordering integration.
Tags
Interfaces, Classes and Traits
- Standard_Service
- Registerable
Table of Contents
- add_modal_data() : array<string|int, mixed>
- Add the HTML for the options to the lightbox.
- load_scripts() : mixed
- Load the scripts required for WPO
- register() : mixed
- Register the integrations points for WRO.
- 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 Options we don't know at this stage whether there are options for the product, so we return 'check'.
Methods
add_modal_data()
Add the HTML for the options 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 WPO
public
load_scripts() : mixed
Tags
Return values
mixed —register()
Register the integrations points for WRO.
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 Options we don't know at this stage whether there are options for the product, so we return 'check'.
public
set_order_type(string $order_type, WC_Product $product) : 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
Tags
Return values
string —The order type - OT_QUICK, OT_LIGHTBOX, or OT_CHECK