PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.2
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.2
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
woocommerce-pos / includes / API / V1 / Traits / Product_Helpers.php

Product_Helpers.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.2, at includes/API/V1/Traits/Product_Helpers.php

55 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Product_Helpers.
4 *
5 * @package WCPOS\WooCommercePOS
6 */
7
8 namespace WCPOS\WooCommercePOS\API\V1\Traits;
9
10 use WC_Product;
11 use WC_Product_Variation;
12 use WCPOS\WooCommercePOS\Services\Barcode_Field;
13 use WCPOS\WooCommercePOS\Services\Settings;
14
15 trait Product_Helpers {
16 /**
17 * Get custom barcode postmeta.
18 *
19 * Thin delegate to {@see Barcode_Field}, THE owner of the barcode-key
20 * decision. Kept as a public trait method because Pro subclasses inherit it.
21 *
22 * @param WC_Product|WC_Product_Variation $object The product object.
23 *
24 * @return string
25 */
26 public function wcpos_get_barcode( $object ) {
27 return Barcode_Field::read( $object );
28 }
29
30 /**
31 * Get barcode field from settings.
32 *
33 * @deprecated No caller remains in this repository. Kept because
34 * this trait is aliased as public API in
35 * includes/API/class-aliases.php, so callers outside this
36 * repository may still use it. Use
37 * {@see \WCPOS\WooCommercePOS\Services\Barcode_Field::meta_key()}
38 * instead.
39 *
40 * @return string
41 */
42 public function wcpos_get_barcode_field() {
43 return Barcode_Field::meta_key();
44 }
45
46 /**
47 * Whether the POS-only products feature is enabled.
48 *
49 * @return bool
50 */
51 public function wcpos_pos_only_products_enabled() {
52 return Settings::instance()->pos_only_products_enabled();
53 }
54 }
55