Astra_Edd::header_cart_icon_markup()
Header Cart Extra Icons markup
Description
Return
(void;)
Source
File: inc/compatibility/edd/class-astra-edd.php
public function header_cart_icon_markup() { if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && ! defined( 'ASTRA_EXT_VER' ) ) { return; } $icon = astra_get_option( 'edd-header-cart-icon' ); $cart_total_display = astra_get_option( 'edd-header-cart-total-display' ); $cart_count_display = apply_filters( 'astra_edd_header_cart_count', true ); $cart_title_display = astra_get_option( 'edd-header-cart-title-display' ); $cart_title = apply_filters( 'astra_header_cart_title', __( 'Cart', 'astra' ) ); $cart_title_markup = '<span class="ast-edd-header-cart-title">' . esc_html( $cart_title ) . '</span>'; $cart_total_markup = '<span class="ast-edd-header-cart-total">' . esc_html( edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ) ) . '</span>'; // Cart Title & Cart Cart total markup. $cart_info_markup = sprintf( '<span class="ast-edd-header-cart-info-wrap"> %1$s %2$s %3$s </span>', ( $cart_title_display ) ? $cart_title_markup : '', ( $cart_total_display && $cart_title_display ) ? '/' : '', ( $cart_total_display ) ? $cart_total_markup : '' ); $cart_items = count( edd_get_cart_contents() ); $cart_contents_count = $cart_items; $cart_icon = sprintf( '<span class="astra-icon ast-icon-shopping-%1$s %2$s" %3$s >%4$s</span>', ( $icon ) ? $icon : '', ( $cart_count_display ) ? '' : 'no-cart-total', ( $cart_count_display ) ? 'data-cart-total="' . $cart_contents_count . '"' : '', ( $icon ) ? ( ( false !== Astra_Icons::is_svg_icons() ) ? Astra_Icons::get_icons( $icon ) : '' ) : '' ); // Theme's default icon with cart title and cart total. if ( 'default' == $icon || ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && ! Astra_Ext_Extension::is_active( 'edd' ) ) ) { // Cart Total or Cart Title enable then only add markup. if ( $cart_title_display || $cart_total_display ) { echo $cart_info_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } else { // Remove Default cart icon added by theme. add_filter( 'astra_edd_default_header_cart_icon', '__return_false' ); /* translators: 1: Cart Title Markup, 2: Cart Icon Markup */ printf( '<div class="ast-addon-cart-wrap"> %1$s %2$s </div>', ( $cart_title_display || $cart_total_display ) ? $cart_info_markup : '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ( $cart_icon ) ? $cart_icon : '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ); } }
Expand full source code Collapse full source code View on Trac