WooCommerce_Functions_Wrapper

The WooCommerce Multilingual WooCommerce Functions Wrapper class.

Defined (1)

The class is defined in the following location(s).

/inc/woocommerce-functions-wrapper.php  
  1. class WooCommerce_Functions_Wrapper{ 
  2.  
  3. public static function is_deprecated() { 
  4.  
  5. if( version_compare( WC_VERSION , '3.0.0', '<' ) ) { 
  6. return true; 
  7. }else{ 
  8. return false; 
  9.  
  10.  
  11. public static function get_product_id( $product ) { 
  12. if( self::is_deprecated() ) { 
  13. return $product->id; 
  14. }else{ 
  15. return $product->get_id(); 
  16.  
  17. public static function get_product_type( $product_id ) { 
  18. if( self::is_deprecated() ) { 
  19. $product = wc_get_product( $product_id ); 
  20. return $product->product_type; 
  21. }else{ 
  22. return WC_Product_Factory::get_product_type( $product_id ); 
  23.  
  24. public static function reduce_stock( $product_id, $qty ) { 
  25. if( self::is_deprecated() ) { 
  26. $product = wc_get_product( $product_id ); 
  27. return $product->reduce_stock( $qty ); 
  28. }else{ 
  29. return wc_update_product_stock( $product_id, $qty, 'decrease' ); 
  30.  
  31. public static function increase_stock( $product_id, $qty ) { 
  32. if( self::is_deprecated() ) { 
  33. $product = wc_get_product( $product_id ); 
  34. return $product->increase_stock( $qty ); 
  35. }else{ 
  36. return wc_update_product_stock( $product_id, $qty, 'increase' ); 
  37.  
  38. public static function set_stock( $product_id, $qty ) { 
  39. if( self::is_deprecated() ) { 
  40. $product = wc_get_product( $product_id ); 
  41. return $product->set_stock( $qty ); 
  42. }else{ 
  43. return wc_update_product_stock( $product_id, $qty, 'set' ); 
  44.  
  45. public static function get_order_currency( $order ) { 
  46. if( self::is_deprecated() ) { 
  47. return $order->get_order_currency(); 
  48. }else{ 
  49. return $order->get_currency(); 
  50.  
  51. public static function get_item_downloads( $object, $item ) { 
  52. if( self::is_deprecated() ) { 
  53. return $object->get_item_downloads( $item ); 
  54. }else{ 
  55. return $item->get_item_downloads( ); 
  56.  
  57. public static function get_order_id( $order ) { 
  58. if( self::is_deprecated() ) { 
  59. return $order->id; 
  60. }else{ 
  61. return $order->get_id(); 
  62.