Quick_View_Pro implements Registerable

Integrates with WooCommerce Quick View Pro.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable

Table of Contents

enqueue_quick_view_integration_script()  : void
Enqueue the Quick View integration script on shop and archive pages.
get_bundle_items_for_message()  : array<string|int, mixed>
Get bundle items for success message instead of the original product.
handle_bundle_request()  : bool|null
Handle bundle requests in QVP's add-to-cart process.
is_quick_view_pro_enabled()  : bool
Check if Quick View Pro is enabled based on plugin settings.
register()  : mixed
render_discounts_list()  : void
Render the discounts list for the product.
discount_has_relevant_display_locations()  : bool
Check if the discount has a relevant display location.
get_bundle_items_from_cart()  : array<string|int, mixed>
Get bundle items that were added to the cart by WDM.
has_quick_view_pro_display_locations()  : bool
Check if Quick View Pro has any display locations enabled.
is_wdm_bundle_request()  : bool
Check if this is a WooCommerce Discount Manager bundle request.

Methods

enqueue_quick_view_integration_script()

Enqueue the Quick View integration script on shop and archive pages.

public enqueue_quick_view_integration_script() : void
Return values
void

get_bundle_items_for_message()

Get bundle items for success message instead of the original product.

public get_bundle_items_for_message(array<string|int, mixed> $products_added, int $product_id) : array<string|int, mixed>
Parameters
$products_added : array<string|int, mixed>

The currently tracked products added

$product_id : int

The product ID being processed

Return values
array<string|int, mixed>

Modified products added array with bundle items

handle_bundle_request()

Handle bundle requests in QVP's add-to-cart process.

public handle_bundle_request(mixed $result, int $product_id, int $quantity, int $variation_id, array<string|int, mixed> $variations) : bool|null
Parameters
$result : mixed

The current result (null to continue normal processing)

$product_id : int

The product ID

$quantity : int

The quantity

$variation_id : int

The variation ID

$variations : array<string|int, mixed>

The variations array

Return values
bool|null

True if bundle was processed, null to continue normal processing

is_quick_view_pro_enabled()

Check if Quick View Pro is enabled based on plugin settings.

public static is_quick_view_pro_enabled() : bool
Return values
bool

True if Quick View Pro is enabled, false otherwise.

register()

public register() : mixed
Tags
inheritdoc
Return values
mixed

render_discounts_list()

Render the discounts list for the product.

public render_discounts_list(WC_Product $product) : void
Parameters
$product : WC_Product

The product.

Return values
void

discount_has_relevant_display_locations()

Check if the discount has a relevant display location.

private discount_has_relevant_display_locations(Discount $discount) : bool

We only check for the 'woocommerce_before_add_to_cart_form' and 'woocommerce_product_meta_start' locations, as these are the only locations that are relevant to us.

Parameters
$discount : Discount

The discount.

Return values
bool

get_bundle_items_from_cart()

Get bundle items that were added to the cart by WDM.

private get_bundle_items_from_cart(int $product_id) : array<string|int, mixed>
Parameters
$product_id : int

The main product ID

Return values
array<string|int, mixed>

Array of product_id => quantity for items added

has_quick_view_pro_display_locations()

Check if Quick View Pro has any display locations enabled.

private has_quick_view_pro_display_locations() : bool

This only checks if the cart or meta are enabled, as these are the only locations that are relevant to us.

Return values
bool

is_wdm_bundle_request()

Check if this is a WooCommerce Discount Manager bundle request.

private is_wdm_bundle_request(int $product_id) : bool
Parameters
$product_id : int

The product ID being added

Return values
bool

True if this is a bundle request

Search results