Responses

Helper class with common methods used during json responses for ajax requests.

Table of Contents

cleanup_term_counters_on_taxonomy_page()  : Collection
Cleanup the term counters on taxonomy pages.
generate_no_products_template()  : string
Generate the not found message template.
get_additional_shared_json_props()  : array<string|int, mixed>
Get the additional shared json props for the prefiller and fallback request.

Methods

cleanup_term_counters_on_taxonomy_page()

Cleanup the term counters on taxonomy pages.

public static cleanup_term_counters_on_taxonomy_page(Collection $query, int $queried_term_id, string $queried_taxonomy_slug, string $queried_term_slug) : Collection

On taxonomy pages we only display terms that are related to the parent queried term.

Parameters
$query : Collection
$queried_term_id : int
$queried_taxonomy_slug : string
$queried_term_slug : string
Return values
Collection

generate_no_products_template()

Generate the not found message template.

public static generate_no_products_template() : string
Return values
string

get_additional_shared_json_props()

Get the additional shared json props for the prefiller and fallback request.

public static get_additional_shared_json_props() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results