handle bundle product prices editor and prices summary

This commit is contained in:
Almira Krdzic
2018-10-18 09:57:38 +02:00
parent b7ab761a25
commit 6d65a5f30c
18 changed files with 702 additions and 369 deletions

View File

@@ -46,7 +46,9 @@ class Wiaas_Product_Category {
public static function register_product_categories() {
foreach (self::$available_product_categories as $key => $available_product_category) {
wp_insert_term($key, 'product_cat');
if (! has_term_meta($key)) {
wp_insert_term($key, 'product_cat');
}
}
}
@@ -83,6 +85,26 @@ class Wiaas_Product_Category {
return self::_get_product_category_type($product) === 'service';
}
/**
* Determines if provided product is hardware
* @param $product
*
* @return bool
*/
public static function is_hardware($product) {
return self::_get_product_category_type($product) === 'hardware';
}
/**
* Determines if provided product is software
* @param $product
*
* @return bool
*/
public static function is_software($product) {
return self::_get_product_category_type($product) === 'software';
}
// PRIVATE