Frontend_Preview implements Registerable, Premium_Service

Sets up settings preview feature

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable
Premium_Service

Table of Contents

$plugin  : mixed
$features_enabled  : mixed
__construct()  : mixed
Constructor
enabled_features()  : array<string|int, mixed>
Return list of enabled features.
install_preview()  : array<string|int, mixed>
Add preview setting to Fast Cart settings array.
is_feature_allowed()  : bool
Test to see if the feature requested is a valid previewable feature.
is_feature_enabled()  : bool
Test to see if a feature is enabled.
preview_bar()  : void
Outputs feature preview control bar.
register()  : void
Register the service
setup_installed_features()  : void
Install enabled features.
setup_preview_cart()  : void
Add some sample products to the cart if it's empty.
try_cancel()  : void
Test to see if the user requested exiting the feature preview and then conditionally exit.
try_install()  : void
Check to see if the user requested a feature preview and conditionally install it.
allowed_features()  : array<string|int, mixed>
Returns list of previewable features.
enable_feature()  : void
Enable a feature.

Properties

Methods

__construct()

Constructor

public __construct(Plugin $plugin) : mixed
Parameters
$plugin : Plugin

Fast Cart plugin object

Tags
Return values
mixed

enabled_features()

Return list of enabled features.

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

install_preview()

Add preview setting to Fast Cart settings array.

public install_preview(array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
$settings : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

Filtered settings.

is_feature_allowed()

Test to see if the feature requested is a valid previewable feature.

public is_feature_allowed(string $feature) : bool
Parameters
$feature : string

Feature slug

Tags
Return values
bool

Is the feature allowed?

is_feature_enabled()

Test to see if a feature is enabled.

public static is_feature_enabled(string $feature) : bool
Parameters
$feature : string

Feature slug

Tags
Return values
bool

preview_bar()

Outputs feature preview control bar.

public preview_bar() : void
Tags
Return values
void

register()

Register the service

public register() : void
Tags
Return values
void

setup_installed_features()

Install enabled features.

public setup_installed_features() : void
Tags
Return values
void

setup_preview_cart()

Add some sample products to the cart if it's empty.

public setup_preview_cart() : void
Tags
Return values
void

try_cancel()

Test to see if the user requested exiting the feature preview and then conditionally exit.

public try_cancel() : void
Tags
Return values
void

try_install()

Check to see if the user requested a feature preview and conditionally install it.

public try_install() : void
Tags
Return values
void

allowed_features()

Returns list of previewable features.

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

enable_feature()

Enable a feature.

private enable_feature(string $feature) : void
Parameters
$feature : string

Feature slug.

Tags
Return values
void

Search results