Show_Single_Variations extends Plugin_Integration implements Registerable

Show Single Variations Plugin Integration.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable

Table of Contents

$plugin_class  : string
The main plugin class to check for existence.
$plugin_function  : string
The main plugin function to check for existence.
after_create_wc_product_query()  : void
After the WooCommerce product query is created.
after_delete_product()  : void
Automatically delete variations data when the product is deleted.
before_search()  : void
Before the search is performed.
get_variation_visibility()  : array<string|int, mixed>
Get the visibility setting of a variation.
index_variations()  : mixed
Index variations of a product.
init_wssv_query()  : void
Add variations to the query.
plugin_is_enabled()  : bool
Check if the plugin is enabled.
rebuild_index()  : void
Index our products when running the iconic indexer.
register()  : void
Register the integration.

Properties

$plugin_class

The main plugin class to check for existence.

protected string $plugin_class = '\\Iconic_WSSV'

$plugin_function

The main plugin function to check for existence.

protected string $plugin_function = ''

Methods

after_create_wc_product_query()

After the WooCommerce product query is created.

public after_create_wc_product_query(WP_Query $query, WC_Query $wc_query) : void
Parameters
$query : WP_Query
$wc_query : WC_Query
Return values
void

after_delete_product()

Automatically delete variations data when the product is deleted.

public after_delete_product(string|int $product_id) : void
Parameters
$product_id : string|int
Return values
void

Before the search is performed.

public before_search(WP_REST_Request $request, Search_Api $search_api) : void
Parameters
$request : WP_REST_Request
$search_api : Search_Api
Return values
void

get_variation_visibility()

Get the visibility setting of a variation.

public get_variation_visibility(string|int $variation_id) : array<string|int, mixed>
Parameters
$variation_id : string|int
Return values
array<string|int, mixed>

index_variations()

Index variations of a product.

public index_variations(string|int $post_id, object $product, array<string|int, mixed> $filters, Indexer $indexer) : mixed
Parameters
$post_id : string|int

the id of the product

$product : object

instance of a WC product

$filters : array<string|int, mixed>

collection of filters for which the index is being generated

$indexer : Indexer

instance of the indexer

Return values
mixed

init_wssv_query()

Add variations to the query.

public init_wssv_query(WP_Query $query, array<string|int, mixed> $product_ids, string $order_by) : void
Parameters
$query : WP_Query

The query object.

$product_ids : array<string|int, mixed>

The array of product IDs to sort.

$order_by : string

The ordering criteria.

Return values
void

plugin_is_enabled()

Check if the plugin is enabled.

public plugin_is_enabled() : bool
Return values
bool

rebuild_index()

Index our products when running the iconic indexer.

public rebuild_index(string|int $product_id) : void
Parameters
$product_id : string|int
Return values
void

Search results