*/ class WFC_admin{ /** * The ID of this plugin. * * @since 1.0.1 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.1 * @access private * @var string $plugin_version The current version of this plugin. */ private $plugin_version; /** * Initialize the class and set its properties. * * @since 1.0.1 * @param string $plugin_name The name of this plugin. * @param string $plugin_version The version of this plugin. */ public function __construct( $plugin_name, $plugin_version ) { $this->plugin_name = $plugin_name; $this->plugin_version = $plugin_version; } /** * Register the stylesheets for the front-end area. * * @since 1.0.1 */ public function WFC_frontend_enqueue_styles() { wp_enqueue_style( 'wfc-frontend', WFC_URL . 'assets/css/wfc-core.css', array(), $this->plugin_version, 'all' ); wp_enqueue_script('wfc-main', WFC_URL . 'assets/js/wfc-main.js', array( 'jquery' ), $this->plugin_version, false); $siteurl = array( 'siteurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('ajax-nonce') ); wp_localize_script( 'wfc-main', 'object_wfc', $siteurl ); // Enqueued script with localized data. wp_enqueue_script( 'wfc-main' ); } // WOOCOMMERCE TEMPLATE LOCATE public function WFC_wc_template_load($template, $template_name, $template_path){ global $woocommerce; $_template = $template; if ( ! $template_path ) $template_path = $woocommerce->template_url; $plugin_path = untrailingslashit( WFC_DIR ) . '/template/woocommerce/'; // Look within passed path within the theme - this is priority $template = locate_template( array( $template_path . $template_name, $template_name ) ); // Modification: Get the template from this plugin, if it exists if ( ! $template && file_exists( $plugin_path . $template_name ) ) $template = $plugin_path . $template_name; // Use default template if ( ! $template ) $template = $_template; // Return what we found return $template; } // FLOATING CART HTML FOOTER public function WFC_floating_cart_init() { global $woocommerce; $quantityP = is_object( WC()->cart ) ? WC()->cart->get_cart_contents_count() : ''; $amount = explode(' ', $quantityP); ?>

Product Busket