Plugin_Wholesale_Pro implements Registerable

Provides integration with the Wholesale Pro plugin.

Interfaces, Classes and Traits

Registerable

Table of Contents

generate_all_taxonomies_choices_count()  : Collection
Change the count of indexed terms for the Taxonomy filter.
generate_stock_all_choices_count()  : bool|string
Return the proper count of purchasable products by checking whether or not products are protected.
generate_stock_choices_count()  : bool|string
Return the proper count of purchasable products by checking whether or not products are protected.
get_search_base_url()  : string
Adjust the search base url if we're on a wholesale page.
hide_protected_products()  : array<string|int, mixed>
Hide protected products from the filtered search query.
register()  : void
Hook into WP if the plugin is found.
init()  : void
Run hooks.
get_filtered_collection()  : Collection
Parse a collection of indexed values and reject products that are protected.
get_hidden_categories_ids()  : array<string|int, mixed>
Get the list of hidden categories ids.
get_hidden_products()  : array<string|int, mixed>
Get the list of products from the hidden categories.

Methods

generate_all_taxonomies_choices_count()

Change the count of indexed terms for the Taxonomy filter.

public generate_all_taxonomies_choices_count(bool $bypass, Taxonomy $filter) : Collection

This is needed because WWP hides categories only so any other type of term doesn't actually know how many visible posts it has.

Parameters
$bypass : bool
$filter : Taxonomy
Return values
Collection

generate_stock_all_choices_count()

Return the proper count of purchasable products by checking whether or not products are protected.

public generate_stock_all_choices_count(bool|string $bypass, Stock $filter) : bool|string
Parameters
$bypass : bool|string

initial bypass value.

$filter : Stock

filter instance.

Return values
bool|string

generate_stock_choices_count()

Return the proper count of purchasable products by checking whether or not products are protected.

public generate_stock_choices_count(bool|string $bypass, Stock $filter[, array<string|int, mixed> $post_ids = [] ]) : bool|string
Parameters
$bypass : bool|string

initial bypass value.

$filter : Stock

filter instance.

$post_ids : array<string|int, mixed> = []

list of ids to specifically check

Return values
bool|string

get_search_base_url()

Adjust the search base url if we're on a wholesale page.

public get_search_base_url(string $base_url) : string
Parameters
$base_url : string
Return values
string

hide_protected_products()

Hide protected products from the filtered search query.

public hide_protected_products(array<string|int, mixed> $products, Collection $filters) : array<string|int, mixed>
Parameters
$products : array<string|int, mixed>
$filters : Collection
Return values
array<string|int, mixed>

register()

Hook into WP if the plugin is found.

public register() : void
Return values
void

get_filtered_collection()

Parse a collection of indexed values and reject products that are protected.

private get_filtered_collection(Collection $collection) : Collection
Parameters
$collection : Collection
Return values
Collection

get_hidden_categories_ids()

Get the list of hidden categories ids.

private get_hidden_categories_ids() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_hidden_products()

Get the list of products from the hidden categories.

private get_hidden_products() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results