File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 11
11
* This helper class should ONLY be used for unit tests!.
12
12
*/
13
13
class WC_Deposits_Product_Manager {
14
- public static function get_deposit_type ( WC_Product_Simple $ product ) {
14
+ /**
15
+ * @param WC_Product_Simple|int $product
16
+ * @return mixed
17
+ */
18
+ public static function get_deposit_type ( $ product ) {
19
+ if ( is_int ( $ product ) ) {
20
+ $ product = wc_get_product ( $ product );
21
+ }
15
22
return $ product ->get_meta ( '_wc_deposit_type ' );
16
23
}
17
- public static function deposits_enabled ( WC_Product_Simple $ product ) {
24
+
25
+ /**
26
+ * @param WC_Product_Simple|int $product
27
+ * @return bool
28
+ */
29
+ public static function deposits_enabled ( $ product ) {
30
+ if ( is_int ( $ product ) ) {
31
+ $ product = wc_get_product ( $ product );
32
+ }
18
33
return true === $ product ->get_meta ( '_wc_deposits_enabled ' );
19
34
}
20
35
}
You can’t perform that action at this time.
0 commit comments