PluginProbe
StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More / 2.1.0
StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More v2.1.0
2.3.0 2.2.0 2.1.1 2.1.0 2.0.0 1.10.0 1.9.1 1.9.0 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 All 59 releases
storeengine / includes / frontend.php

frontend.php in StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More 2.1.0, at includes/frontend.php

44 lines 848 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace StoreEngine;
4
5 use StoreEngine;
6
7 use StoreEngine\Utils\Helper;
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 class Frontend {
14
15 public static function init() {
16 $self = new self();
17 $self->dispatch_hooks();
18 }
19
20 public function dispatch_hooks() {
21 if ( StoreEngine\Utils\Helper::get_settings( 'enable_floating_cart', true ) ) {
22 Frontend\FloatingCart::init();
23 }
24
25 Frontend\Template::init();
26 Frontend\Coupon::init();
27 Frontend\Comments::init();
28 add_action( 'init', array( $this, 'init_frontend' ) );
29 }
30
31 public function init_frontend() {
32 if ( StoreEngine\Utils\Helper::is_request( 'frontend' ) ) {
33 StoreEngine::init()->load_cart();
34 }
35
36 $user = wp_get_current_user();
37
38 if ( $user && in_array( 'storeengine_customer', (array) $user->roles, true ) ) {
39 add_filter( 'show_admin_bar', '__return_false' );
40 }
41 }
42
43 }
44