Astra_Enqueue_Scripts::has_cart_widget_in_header()

Check if cart widget is present in header.


Description


Return

(bool)


Source

File: inc/core/class-astra-enqueue-scripts.php

		public static function has_cart_widget_in_header() {
			// Check if header footer builder is active.
			if ( ! Astra_Builder_Helper::$is_header_footer_builder_active ) {
				return false;
			}

			// Check if woo-cart component is loaded in header.
			if ( class_exists( 'Astra_Builder_Helper' ) && Astra_Builder_Helper::is_component_loaded( 'woo-cart', 'header' ) ) {
				return true;
			}

			// Check for legacy cart widget.
			if ( is_active_widget( false, false, 'woocommerce_widget_cart', true ) ) {
				return true;
			}

			return false;
		}

Changelog

Changelog
Version Description
4.11.18 Introduced.


User Contributed Notes

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