ASTRA_Ext_WooCommerce_Markup::astra_mini_cart_featured_product()

Featured product CTA


Description


Return

(void)


Source

File: addons/woocommerce/classes/class-astra-ext-woocommerce-markup.php

		public function astra_mini_cart_featured_product() {
			$featured_products = wc_get_featured_product_ids();
			?>
				<script>
					document.dispatchEvent( new CustomEvent( "astra_on_slide_in_cart_empty",  { "detail": {} }) );
				</script>
			<?php
			$empty_cart_heading = apply_filters( 'astra_cart_empty_featured_product_heading', __( "Your Cart Is Empty Let's Fix That.", 'astra-addon' ) );
			echo '<div class="ast-empty-cart-content">';
			echo '<h2>' . esc_html( $empty_cart_heading ) . '</h2>';
			if ( $featured_products ) {
				echo do_shortcode( "[featured_products per_page='1' columns='1' orderby='rand' order='DESC']" );
			} else {
				echo do_shortcode( "[products per_page='1' columns='1' orderby='rand' order='DESC']" );
			}
			echo '</div>';
		}

Changelog

Changelog
Version Description
4.1.0 Introduced.

User Contributed Notes

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