te_meta_key( $key ); if ( isset( self::TYPES[ $key ] ) ) { if ( in_array( self::TYPES[ $key ], [ 'bool', 'boolean', ], true ) ) { $value = wc_bool_to_string( $value ); } else { settype( $value, self::TYPES[ $key ] ); } } $coupon->update_meta_data( $this->prefix_meta_key( $key ), $value ); $coupon->save_meta_data(); } /** * * @param WC_Coupon $coupon * @param string $key * * @throws InvalidMeta If the meta key is invalid. */ public function delete( WC_Coupon $coupon, string $key ) { self::validate_meta_key( $key ); $coupon->delete_meta_data( $this->prefix_meta_key( $key ) ); $coupon->save_meta_data(); } /** * * @param WC_Coupon $coupon * @param string $key * * @return mixed The value, or null if the meta key doesn't exist. * * @throws InvalidMeta If the meta key is invalid. */ public function get( WC_Coupon $coupon, string $key ) { self::validate_meta_key( $key ); $value = null; if ( $coupon->meta_exists( $this->prefix_meta_key( $key ) ) ) { $value = $coupon->get_meta( $this->prefix_meta_key( $key ), true ); if ( isset( self::TYPES[ $key ] ) && in_array( self::TYPES[ $key ], [ 'bool', 'boolean', ], true ) ) { $value = wc_string_to_bool( $value ); } } return $value; } /** * * @param string $key * * @throws InvalidMeta If the meta key is invalid. */ protected static function validate_meta_key( string $key ) { if ( ! self::is_meta_key_valid( $key ) ) { do_action( 'woocommerce_gla_error', sprintf( 'Coupon meta key is invalid: %s', $key ), __METHOD__ ); throw InvalidMeta::invalid_key( $key ); } } /** * * @param string $key * * @return bool Whether the meta key is valid. */ public static function is_meta_key_valid( string $key ): bool { return isset( self::TYPES[ $key ] ); } /** * Returns all available meta keys. * * @return array */ public static function get_all_meta_keys(): array { return array_keys( self::TYPES ); } }
Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Coupon\CouponMetaHandler does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73

Warning: foreach() argument must be of type array|object, bool given in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73

Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Admin\BulkEdit\CouponBulkEdit does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73

Fatal error: Uncaught Error: Interface "Automattic\WooCommerce\GoogleListingsAndAds\Admin\BulkEdit\BulkEditInterface" not found in /htdocs/wp-content/plugins/google-listings-and-ads/src/Admin/BulkEdit/CouponBulkEdit.php:23 Stack trace: #0 /htdocs/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php(90): require() #1 [internal function]: Automattic\Jetpack\Autoloader\jpf11009ded9fc4592b6a05b61ce272b3c_jetpackā“„13_5\al3_0_8\PHP_Autoloader::load_class('Automattic\\WooC...') #2 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php(73): class_implements('Automattic\\WooC...') #3 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/CoreServiceProvider.php(389): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\AbstractServiceProvider->share_with_tags('Automattic\\WooC...', 'Automattic\\WooC...', 'Automattic\\WooC...', 'Automattic\\WooC...') #4 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php(102): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\CoreServiceProvider->register() #5 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(172): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\ServiceProvider\ServiceProviderAggregate->register('Automattic\\WooC...') #6 /htdocs/wp-content/plugins/google-listings-and-ads/src/Container.php(90): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #7 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(130): Automattic\WooCommerce\GoogleListingsAndAds\Container->get('Automattic\\WooC...') #8 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(91): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->maybe_register_services() #9 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\{closure}('') #10 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #11 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #12 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #13 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #14 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #15 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #16 /htdocs/index.php(17): require('/htdocs/wp-blog...') #17 {main} thrown in /htdocs/wp-content/plugins/google-listings-and-ads/src/Admin/BulkEdit/CouponBulkEdit.php on line 23