Astra_Admin_Settings::upgrade_to_pro_wc_notice()

Upgrade to Pro notice for Astra on WooCommerce pages.


Description


Source

File: inc/core/class-astra-admin-settings.php

		public static function upgrade_to_pro_wc_notice() {
			/** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
			$current_slug = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
			/** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort

			if ( '' !== $current_slug && function_exists( 'WC' ) && in_array( $current_slug, array( 'wc-admin', 'wc-reports', 'wc-status', 'wc-addons', 'wc-settings' ), true ) ) {

				$image_path = ASTRA_THEME_URI . 'inc/assets/images/astra-logo.svg';

				$astra_sites_notice_args = array(
					'id'                         => 'astra-upgrade-pro-wc',
					'type'                       => 'info',
					'message'                    => sprintf(
						'<div class="notice-image">
							<img src="%1$s" class="custom-logo" alt="Astra" itemprop="logo"></div>
							<div class="notice-content">
								<h2 class="notice-heading">
									%2$s
								</h2>
								<p>%3$s</p>
								<div class="astra-review-notice-container">
									<a class="%4$s" %5$s> %6$s </a>
								</div>
							</div>',
						$image_path,
						__( 'Astra Works Seamlessly with WooCommerce!', 'astra' ),
						__( 'Use every tool at your disposal to optimize your online store for conversion. All the advantages you need to make more profit!', 'astra' ),
						esc_attr( 'button button-primary' ),
						'href="' . ASTRA_PRO_UPGRADE_URL . '" target="_blank"',
						__( 'Upgrade Now', 'astra' )
					),
					'priority'                   => 5,
					'show_if'                    => is_admin() ? true : false,
					'display-with-other-notices' => false,
				);

				Astra_Notices::add_notice(
					$astra_sites_notice_args
				);
			}
		}

Changelog

Changelog
Version Description
3.9.4 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.