BlockCompatibility.php
1 week ago
FlexibleWishlistReview.php
1 week ago
Notice.php
1 week ago
NoticeIntegration.php
1 week ago
ReviewNotice.php
1 week ago
BlockCompatibility.php
42 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPDesk\FCF\Free\Notice; |
| 4 | |
| 5 | use Automattic\WooCommerce\Blocks\Utils\CartCheckoutUtils; |
| 6 | |
| 7 | class BlockCompatibility implements Notice { |
| 8 | |
| 9 | private const NOTICE_NAME = 'notice_flexible_wishlist_compatibility'; |
| 10 | |
| 11 | public function get_notice_name(): string { |
| 12 | return self::NOTICE_NAME; |
| 13 | } |
| 14 | |
| 15 | public function is_active(): bool { |
| 16 | if ( ! isset( $_GET['page'] ) || $_GET['page'] !== 'wpdesk_checkout_fields_settings' ) { |
| 17 | return false; |
| 18 | } |
| 19 | |
| 20 | if ( ! CartCheckoutUtils::is_checkout_block_default() ) { |
| 21 | return false; |
| 22 | } |
| 23 | |
| 24 | return true; |
| 25 | } |
| 26 | |
| 27 | public function get_template_path(): string { |
| 28 | return 'notices/compatibility-notice'; |
| 29 | } |
| 30 | |
| 31 | public function get_vars_for_view(): array { |
| 32 | return []; |
| 33 | } |
| 34 | |
| 35 | public function set_notice_as_hidden( bool $is_permanently ) { |
| 36 | } |
| 37 | |
| 38 | public function add_notice_scripts(): void { |
| 39 | add_thickbox(); |
| 40 | } |
| 41 | } |
| 42 |