Astra_SureCart::astra_surecart_archive_page_banner_support()

SureCart Archive Banner Support.


Description

Making ‘Shop Page’ as archive of SureCart Products.


Source

File: inc/compatibility/class-astra-surecart.php

	public function astra_surecart_archive_page_banner_support() {
		if ( false === $this->astra_is_surecart_shop_page() ) {
			return;
		}

		$page_id = absint( astra_get_post_id() );

		$visibility = get_post_meta( $page_id, 'ast-banner-title-visibility', true );
		$visibility = apply_filters( 'astra_banner_title_area_visibility', $visibility );
		if ( 'disabled' === $visibility ) {
			$this->disable_page_loaded_banner_area();
			return;
		}

		$banner_layout = astra_get_option( 'ast-dynamic-archive-sc_product-layout', 'layout-1' );
		add_filter( 'astra_banner_elements_structure', array( $this, 'update_astra_banner_elements_structure' ) );
		add_filter( 'astra_banner_elements_post_type', array( $this, 'update_astra_banner_elements_post_type' ) );
		add_filter( 'astra_banner_elements_prefix', array( $this, 'update_astra_banner_elements_prefix' ) );
		add_filter( 'the_title', array( $this, 'update_the_title' ), 10, 2 );

		if ( 'layout-2' === $banner_layout ) {
			$astra_banner_hook = apply_filters( 'astra_banner_hook', 'astra_content_before' );
			add_action( $astra_banner_hook, array( $this, 'astra_surecart_hero_section' ), 20 );
		} else {
			add_filter( 'astra_single_layout_one_banner_visibility', '__return_false' );
			add_filter( 'astra_apply_hero_header_banner', '__return_false' );
			add_action( 'astra_primary_content_top', array( $this, 'astra_force_render_banner_layout_1' ) );
		}
	}

Changelog

Changelog
Version Description
4.4.0 Introduced.


User Contributed Notes

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