PluginProbe
Weight Based Shipping Table Rate for WooCommerce – Flexible Shipping / trunk
Weight Based Shipping Table Rate for WooCommerce – Flexible Shipping vtrunk
6.12.1 6.12.0 6.11.0 6.10.0 6.9.1 6.9.0 6.8.1 6.8.0 6.7.4 6.7.3 6.7.2 6.7.0 4.21.7 4.22.0 4.22.1 4.23.0 4.23.1 4.23.2 4.23.3 4.24.0 4.24.1 4.24.10 4.24.11 4.24.12 4.24.13 All 285 releases
flexible-shipping / src / WPDesk / FS / TableRate / ShippingMethod / Duplicate / DuplicateTracker.php
DuplicateTracker.php
36 lines 717 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class DuplicateTracker
4 *
5 * @package WPDesk\FS\TableRate\ShippingMethod\Duplicate
6 */
7
8 namespace WPDesk\FS\TableRate\ShippingMethod\Duplicate;
9
10 use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
12 /**
13 * Tracking of duplicate usages.
14 */
15 class DuplicateTracker implements Hookable {
16 const PRIORITY_AFTER_FS_TRACKER = 12;
17
18 /**
19 * Hooks.
20 */
21 public function hooks() {
22 add_filter( 'wpdesk_tracker_data', [ $this, 'add_tracking_data' ], self::PRIORITY_AFTER_FS_TRACKER );
23 }
24
25 /**
26 * @param array $data .
27 *
28 * @return array
29 */
30 public function add_tracking_data( $data ): array {
31 $data['flexible_shipping']['duplicate'] = (int) get_option( DuplicateAction::OPTION, 0 );
32
33 return $data;
34 }
35 }
36