| @@ -72,8 +72,12 @@ | ||
| 72 | 72 | 'price_display_suffix' => '', |
| 73 | 73 | 'tax_total_display' => '', |
| 74 | 74 | 'default_customer' => 0, |
| 75 | 75 | 'default_customer_is_cashier' => false, |
| 76 | + // The merchant's consent to anonymous usage data + error reports. The POS | |
| 77 | + // client reads it from here so its own error reporting follows the same | |
| 78 | + // switch as the plugin's analytics (POS > Settings > General). | |
| 79 | + 'tracking_consent' => 'undecided', | |
| 76 | 80 | // Pro properties (with WooCommerce defaults in free version). |
| 77 | 81 | 'url' => '', |
| 78 | 82 | 'phone' => '', |
| 79 | 83 | 'email' => '', |
| @@ -163,8 +167,11 @@ | ||
| 163 | 167 | public function set_woocommerce_pos_settings() { |
| 164 | 168 | $this->set_prop( 'default_customer', Settings::instance()->default_customer_id() ); |
| 165 | 169 | $this->set_prop( 'default_customer_is_cashier', Settings::instance()->default_customer_is_cashier() ); |
| 166 | 170 | $this->set_prop( 'prevent_overselling', Settings::instance()->prevent_overselling_enabled() ); |
| 171 | + // The POS client gates its OWN error reporting on this value, so it is a | |
| 172 | + // send gate one hop away: read the persisted answer, not the filtered view. | |
| 173 | + $this->set_prop( 'tracking_consent', Settings::instance()->raw_tracking_consent() ); | |
| 167 | 174 | } |
| 168 | 175 | |
| 169 | 176 | /** |
| 170 | 177 | * Get the store data as an array. |
| @@ -490,8 +497,18 @@ | ||
| 490 | 497 | * @return bool |
| 491 | 498 | */ |
| 492 | 499 | public function get_default_customer_is_cashier( $context = 'view' ) { |
| 493 | 500 | return $this->get_prop( 'default_customer_is_cashier', $context ); |
| 501 | + } | |
| 502 | + | |
| 503 | + /** | |
| 504 | + * Get the merchant's tracking consent: 'undecided', 'allowed' or 'denied'. | |
| 505 | + * | |
| 506 | + * @param string $context What the value is for. Valid values are view and edit. | |
| 507 | + * @return string | |
| 508 | + */ | |
| 509 | + public function get_tracking_consent( $context = 'view' ) { | |
| 510 | + return $this->get_prop( 'tracking_consent', $context ); | |
| 494 | 511 | } |
| 495 | 512 | |
| 496 | 513 | /** |
| 497 | 514 | * Set Pro property defaults from WooCommerce settings. |