class-wc-abstract-order-data-store-interface.php
5 years ago
class-wc-coupon-data-store-interface.php
5 years ago
class-wc-customer-data-store-interface.php
5 years ago
class-wc-customer-download-data-store-interface.php
5 years ago
class-wc-customer-download-log-data-store-interface.php
5 years ago
class-wc-importer-interface.php
5 years ago
class-wc-log-handler-interface.php
5 years ago
class-wc-logger-interface.php
5 years ago
class-wc-object-data-store-interface.php
5 years ago
class-wc-order-data-store-interface.php
1 year ago
class-wc-order-item-data-store-interface.php
3 years ago
class-wc-order-item-product-data-store-interface.php
5 years ago
class-wc-order-item-type-data-store-interface.php
5 years ago
class-wc-order-refund-data-store-interface.php
5 years ago
class-wc-payment-token-data-store-interface.php
5 years ago
class-wc-product-data-store-interface.php
1 year ago
class-wc-product-variable-data-store-interface.php
5 years ago
class-wc-queue-interface.php
4 months ago
class-wc-shipping-zone-data-store-interface.php
4 years ago
class-wc-webhooks-data-store-interface.php
5 years ago
class-wc-shipping-zone-data-store-interface.php
82 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Shipping Zone Data Store Interface |
| 4 | * |
| 5 | * @version 3.0.0 |
| 6 | * @package WooCommerce\Interface |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * WC Shipping Zone Data Store Interface. |
| 11 | * |
| 12 | * Functions that must be defined by shipping zone store classes. |
| 13 | * |
| 14 | * @version 3.0.0 |
| 15 | */ |
| 16 | interface WC_Shipping_Zone_Data_Store_Interface { |
| 17 | /** |
| 18 | * Get a list of shipping methods for a specific zone. |
| 19 | * |
| 20 | * @param int $zone_id Zone ID. |
| 21 | * @param bool $enabled_only True to request enabled methods only. |
| 22 | * @return array Array of objects containing method_id, method_order, instance_id, is_enabled |
| 23 | */ |
| 24 | public function get_methods( $zone_id, $enabled_only ); |
| 25 | |
| 26 | /** |
| 27 | * Get count of methods for a zone. |
| 28 | * |
| 29 | * @param int $zone_id Zone ID. |
| 30 | * @return int Method Count |
| 31 | */ |
| 32 | public function get_method_count( $zone_id ); |
| 33 | |
| 34 | /** |
| 35 | * Add a shipping method to a zone. |
| 36 | * |
| 37 | * @param int $zone_id Zone ID. |
| 38 | * @param string $type Method Type/ID. |
| 39 | * @param int $order Method Order ID. |
| 40 | * @return int Instance ID |
| 41 | */ |
| 42 | public function add_method( $zone_id, $type, $order ); |
| 43 | |
| 44 | /** |
| 45 | * Delete a method instance. |
| 46 | * |
| 47 | * @param int $instance_id Instance ID. |
| 48 | */ |
| 49 | public function delete_method( $instance_id ); |
| 50 | |
| 51 | /** |
| 52 | * Get a shipping zone method instance. |
| 53 | * |
| 54 | * @param int $instance_id Instance ID. |
| 55 | * @return object |
| 56 | */ |
| 57 | public function get_method( $instance_id ); |
| 58 | |
| 59 | /** |
| 60 | * Find a matching zone ID for a given package. |
| 61 | * |
| 62 | * @param object $package Zone package object. |
| 63 | * @return int |
| 64 | */ |
| 65 | public function get_zone_id_from_package( $package ); |
| 66 | |
| 67 | /** |
| 68 | * Return an ordered list of zones. |
| 69 | * |
| 70 | * @return array An array of objects containing a zone_id, zone_name, and zone_order. |
| 71 | */ |
| 72 | public function get_zones(); |
| 73 | |
| 74 | /** |
| 75 | * Return a zone ID from an instance ID. |
| 76 | * |
| 77 | * @param int $id Instance ID. |
| 78 | * @return int |
| 79 | */ |
| 80 | public function get_zone_id_by_instance_id( $id ); |
| 81 | } |
| 82 |