Frontend_Templates implements Premium_Service, Registerable, Conditional

Loads the various scripts and styles needed for the cart modal

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Premium_Service
Registerable
Conditional

Table of Contents

$settings  : mixed
$version  : mixed
__construct()  : mixed
Constructor
add_cart_close_wrapper()  : void
Closing tag for cart template.
add_cart_open_wrapper()  : void
Outputs opening tag for cart template controlled by Fast Cart.
add_fast_cart_shortcode()  : mixed
add_wfc_flag_to_redirect()  : string
Adds wfc-cart to GET request parameters of woocommerce cart redirection url when parameter is present in request headers
cart_classes()  : array<string|int, mixed>
Adds classes to Fast Cart wrapper to hide unavailable features of Fast Cart
close_cart_actions_wrapper()  : void
Outputs closing tag for cart actions DOM
close_checkout_wrapper()  : void
Closes div wrapper on wfc checkout template
fast_cart_shortcode_output()  : string
Outputs the [fast_cart] shortcode button
get_cart_button_args()  : array<string|int, mixed>
Returns the args for showing the fast cart button
is_required()  : bool
Tests to see if templates need to be loaded at all
maybe_change_totals_template()  : string
DEPRECATED replaces cart totals template with fast cart version
maybe_get_cart_template()  : mixed
Overrides default WC cart template when 'wfc-cart' is present GET request parameters hooks into `template_include` filter
maybe_get_checkout_template()  : string
Overrides default WC checkout template when 'wfc-checkout' is present GET request parameters hooks into `template_include` filter
maybe_send_cors_headers()  : void
Add CORS headers to a response object, not needed for most websites.
maybe_trigger_the_cart_open()  : void
Hooks a cart open event when a product is added by URL
open_cart_actions_wrapper()  : void
Outputs opening tag for cart actions DOM
open_checkout_wrapper()  : void
Adds div wrapper to wfc checkout template
prepare_fast_cart()  : void
Sets up actions for display of Fast Cart template functions
register()  : void
Adds Fast Cart templates to WordPress and WooCommerce actions and filters
remove_cart_functions()  : void
DEPRECATED. disables various cart functions on Fast Cart according to settings
set_logged_in_cookie()  : mixed
When the login cookies are set, they are not available until the next page reload. (Modified from WooCommerce Store API)
show_fast_cart_button()  : mixed
Outputs fast cart button on page
wfc_cart_totals()  : void
Cart totals template
wfc_checkout_buttons()  : void
Outputs cart checkout buttons
wfc_coupons()  : void
Outputs coupon code html
wfc_cross_sells()  : void
Outputs cross sells carousel
wfc_show_product()  : void
Outputs product within cross sells carousel
wfc_template_loop_rating()  : void
Outputs product star ratings

Properties

Methods

__construct()

Constructor

public __construct(string $version) : mixed
Parameters
$version : string

Plugin version

Tags
Return values
mixed

add_cart_close_wrapper()

Closing tag for cart template.

public add_cart_close_wrapper() : void
Tags
Return values
void

add_cart_open_wrapper()

Outputs opening tag for cart template controlled by Fast Cart.

public add_cart_open_wrapper() : void
Tags
Return values
void

add_fast_cart_shortcode()

public add_fast_cart_shortcode() : mixed
Tags
Return values
mixed

add_wfc_flag_to_redirect()

Adds wfc-cart to GET request parameters of woocommerce cart redirection url when parameter is present in request headers

public add_wfc_flag_to_redirect(string $url) : string
Parameters
$url : string

url to redirect after cart action

Tags
since

v0.1

Return values
string

cart_classes()

Adds classes to Fast Cart wrapper to hide unavailable features of Fast Cart

public cart_classes(array<string|int, mixed> $classes) : array<string|int, mixed>
Parameters
$classes : array<string|int, mixed>

original wfc wrapper classes

Tags
since

v0.1

Return values
array<string|int, mixed>

close_cart_actions_wrapper()

Outputs closing tag for cart actions DOM

public static close_cart_actions_wrapper() : void
Tags
Return values
void

close_checkout_wrapper()

Closes div wrapper on wfc checkout template

public static close_checkout_wrapper() : void
Tags
since

v0.1

Return values
void

fast_cart_shortcode_output()

Outputs the [fast_cart] shortcode button

public fast_cart_shortcode_output(mixed $atts) : string
Parameters
$atts : mixed
Tags
Return values
string

fast cart button

get_cart_button_args()

Returns the args for showing the fast cart button

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

a list of parameters for fast cart button

is_required()

Tests to see if templates need to be loaded at all

public is_required() : bool
Tags
Return values
bool

maybe_change_totals_template()

DEPRECATED replaces cart totals template with fast cart version

public maybe_change_totals_template(string $template, string $template_name) : string
Parameters
$template : string

original template path

$template_name : string

name of template

Tags
since

v0.1

Return values
string

new template path

maybe_get_cart_template()

Overrides default WC cart template when 'wfc-cart' is present GET request parameters hooks into `template_include` filter

public maybe_get_cart_template(mixed $template) : mixed
Parameters
$template : mixed

original template from WC

Tags
since

v0.1

Return values
mixed

maybe_get_checkout_template()

Overrides default WC checkout template when 'wfc-checkout' is present GET request parameters hooks into `template_include` filter

public maybe_get_checkout_template(string $template) : string
Parameters
$template : string

original template from WC

Tags
since

v0.1

Return values
string

maybe_send_cors_headers()

Add CORS headers to a response object, not needed for most websites.

public maybe_send_cors_headers() : void
Tags
Return values
void

maybe_trigger_the_cart_open()

Hooks a cart open event when a product is added by URL

public maybe_trigger_the_cart_open() : void
Tags
Return values
void

open_cart_actions_wrapper()

Outputs opening tag for cart actions DOM

public static open_cart_actions_wrapper() : void
Tags
Return values
void

open_checkout_wrapper()

Adds div wrapper to wfc checkout template

public static open_checkout_wrapper() : void
Tags
since

v0.1

Return values
void

prepare_fast_cart()

Sets up actions for display of Fast Cart template functions

public prepare_fast_cart() : void
Tags
since

v0.1

Return values
void

register()

Adds Fast Cart templates to WordPress and WooCommerce actions and filters

public register() : void
Tags
Return values
void

remove_cart_functions()

DEPRECATED. disables various cart functions on Fast Cart according to settings

public remove_cart_functions() : void
Tags
since

v0.1

Return values
void

When the login cookies are set, they are not available until the next page reload. (Modified from WooCommerce Store API)

public set_logged_in_cookie(string $logged_in_cookie) : mixed
Parameters
$logged_in_cookie : string

The value for the logged in cookie.

Tags
Return values
mixed

show_fast_cart_button()

Outputs fast cart button on page

public show_fast_cart_button() : mixed
Tags
since

v0.1

Return values
mixed

wfc_cart_totals()

Cart totals template

public wfc_cart_totals() : void
Tags
since

v0.1

Return values
void

wfc_checkout_buttons()

Outputs cart checkout buttons

public wfc_checkout_buttons() : void
Tags
since

v0.1

Return values
void

wfc_coupons()

Outputs coupon code html

public wfc_coupons() : void
Tags
since

v0.1

Return values
void

wfc_cross_sells()

Outputs cross sells carousel

public wfc_cross_sells() : void
Tags
since

v0.1

Return values
void

wfc_show_product()

Outputs product within cross sells carousel

public wfc_show_product(WP_Post $post) : void
Parameters
$post : WP_Post

WP_Post or WC_Product object

Tags
since

v0.1

Return values
void

wfc_template_loop_rating()

Outputs product star ratings

public wfc_template_loop_rating() : void
Tags
since

v0.1

Return values
void

Search results