setLabel( 'WooCommerce' );
$this->addHook( APEX_TOOLBOX_HOOK_FILTER, 'woocommerce_product_tabs', 'disableWooCommerceReviews', Array(
'label' => 'Disable reviews on all products',
'description' => 'Will disable reviews from being available on any product and hide the tab on the product page',
'priority' => 98,
'args' => 1
) );
$this->addHook( APEX_TOOLBOX_HOOK_FILTER, 'woocommerce_subcategory_count_html', 'disableCategoryProductCount', Array(
'label' => 'Disable product count',
'description' => 'Removes the total products available for a given category',
'priority' => 98,
'args' => 1
) );
$this->addHook( APEX_TOOLBOX_HOOK_ACTION, 'init', 'disableProductCategoryList', Array(
'label' => 'Remove product category list',
'description' => 'Removes the list of categories a product is in on the single product page',
) );
$this->addHook( APEX_TOOLBOX_HOOK_ACTION, 'init', 'enhanceJupiterWooCommerce', Array(
'label' => 'Enhance Jupiter WooCommerce Experience',
'description' => 'Various tweaks to the category, cart, and checkout pages to improve the user experience',
) );
}
/**
* Will disable reviews from being available on any product and hide the tab on the product page
*
* @param array $tabs Tabs available for output
*
* @author Nigel Wells
* @version 0.4.0.17.04.20
* @return array;
*/
public function disableWooCommerceReviews( $tabs ) {
if ( isset( $tabs['reviews'] ) ) {
unset( $tabs['reviews'] );
}
return $tabs;
}
/**
* Removes the total products available for a given category
*
* @author Nigel Wells
* @version 0.4.0.17.04.20
* @return void;
*/
public function disableCategoryProductCount() {
}
/**
* Removes the list of categories a product is in on the single product page
*
* @author Nigel Wells
* @version 0.4.0.17.04.21
* @return void;
*/
public function disableProductCategoryList() {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
return;
}
public function enhanceJupiterWooCommerce() {
// Create settings
$this->Toolbox->addSetting( Array(
'name' => 'wc_shipping_text',
'label' => 'Shipping and Delivery text',
'type' => 'textarea',
'value' => $this->Toolbox->getOption( 'wc_shipping_text' ),
'description' => 'HTML text to show above the table of shipping options available'
), $this->getLabel() );
$this->Toolbox->addSetting( Array(
'name' => 'wc_hide_shipping_table',
'label' => 'Shipping Table Visibility',
'type' => 'checkbox',
'range' => [ 1 => 'Yes' ],
'value' => $this->Toolbox->getOption( 'wc_hide_shipping_table' ),
'description' => 'Hide the shipping table options'
), $this->getLabel() );
// Setup various hooks
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_style( 'apex-woocommerce-styles', APEX_TOOLBOX_PLUGIN_URL . 'assets/css/apex-woocommerce-styles.min.css?' . filemtime( APEX_TOOLBOX_PLUGIN_PATH . 'assets/css/apex-woocommerce-styles.min.css' ) );
wp_enqueue_script( 'apex-woocommerce-script', APEX_TOOLBOX_PLUGIN_URL . 'assets/js/apex-woocommerce-scripts.js?' . filemtime( APEX_TOOLBOX_PLUGIN_PATH . 'assets/js/apex-woocommerce-scripts.js' ) );
} );
add_action( 'woocommerce_before_main_content', function () {
if ( $this->isShowingShopFilter() ) {
echo '
';
do_action( 'product_filters_plugin' );
echo '
';
}
}, 50 );
add_action( 'woocommerce_after_main_content', function () {
if ( $this->isShowingShopFilter() ) {
echo '