| 1 |
<?php |
| 2 |
|
| 3 |
namespace UltimateStoreKit\Modules\ProductCategory; |
| 4 |
|
| 5 |
use UltimateStoreKit\Base\Ultimate_Store_Kit_Module_Base; |
| 6 |
|
| 7 |
if (!defined('ABSPATH')) { |
| 8 |
exit; |
| 9 |
} // Exit if accessed directly |
| 10 |
|
| 11 |
class Module extends Ultimate_Store_Kit_Module_Base { |
| 12 |
|
| 13 |
public static function is_active() { |
| 14 |
return class_exists('woocommerce'); |
| 15 |
} |
| 16 |
|
| 17 |
public function get_name() { |
| 18 |
return 'usk-product-category'; |
| 19 |
} |
| 20 |
|
| 21 |
public function get_widgets() { |
| 22 |
return ['Product_Category']; |
| 23 |
} |
| 24 |
|
| 25 |
public function add_product_post_class($classes) { |
| 26 |
$classes[] = 'product'; |
| 27 |
|
| 28 |
return $classes; |
| 29 |
} |
| 30 |
|
| 31 |
public function add_products_post_class_filter() { |
| 32 |
add_filter('post_class', [$this, 'add_product_post_class']); |
| 33 |
} |
| 34 |
|
| 35 |
public function remove_products_post_class_filter() { |
| 36 |
remove_filter('post_class', [$this, 'add_product_post_class']); |
| 37 |
} |
| 38 |
|
| 39 |
public function register_wc_hooks() { |
| 40 |
wc()->frontend_includes(); |
| 41 |
} |
| 42 |
} |
| 43 |
|