'bottom left',
),
$atts
);
$output = '';
$astra_edd_instance = Astra_Edd::get_instance();
if ( method_exists( $astra_edd_instance, 'edd_mini_cart_markup' ) ) {
$output = '
';
$output .= $astra_edd_instance->edd_mini_cart_markup();
$output .= '
';
}
return $output;
}
/**
* Body Class
*
* @param array $classes Default argument array.
*
* @return array;
*/
public function body_class( $classes ) {
$is_edd_archive_page = astra_is_edd_archive_page();
if ( $is_edd_archive_page ) {
$shop_style = astra_get_option( 'edd-archive-style' );
if ( 'edd-archive-page-list-style' == $shop_style ) {
$classes[] = 'ast-' . $shop_style;
}
} elseif ( edd_is_checkout() ) {
if ( astra_get_option( 'edd-distraction-free-checkout' ) ) {
$classes[] = 'ast-edd-distraction-free-checkout';
}
}
return $classes;
}
/**
* Post Class
*
* @param array $classes Default argument array.
*
* @return array;
*/
public function post_class( $classes ) {
$is_edd_archive_page = astra_is_edd_archive_page();
if ( $is_edd_archive_page ) {
// Single product normal & hover box shadow.
$classes[] = astra_get_option( 'edd-archive-product-align' );
$classes[] = 'box-shadow-' . astra_get_option( 'edd-archive-product-shadow' );
$classes[] = 'box-shadow-' . astra_get_option( 'edd-archive-product-shadow-hover' ) . '-hover';
}
return $classes;
}
/**
* Edd shortcode download class
*
* @param string $class edd shortcode list item class.
* @param int $id current post ID.
* @param array $edd_download_shortcode_item_atts Default shortcode argument array.
* @param int $edd_download_shortcode_item_i shortcode applied to items.
*
* @return string $class updated class to the shortcode list item;
*/
public function shortcode_download_class( $class, $id, $edd_download_shortcode_item_atts, $edd_download_shortcode_item_i ) {
if ( 'edd_download' === $class ) {
$classes = array();
// Single product normal & hover box shadow.
$classes[] = astra_get_option( 'edd-archive-product-align' );
$classes[] = 'box-shadow-' . astra_get_option( 'edd-archive-product-shadow' );
$classes[] = 'box-shadow-' . astra_get_option( 'edd-archive-product-shadow-hover' ) . '-hover';
$class = $class . ' ' . implode( ' ', $classes );
}
return $class;
}
/**
* Checkout page markup update using actions & filters only
*/
public function customization_checkout_page() {
if ( ! edd_is_checkout() ) {
return;
}
// Display coupon.
if ( ! astra_get_option( 'edd-checkout-coupon-display' ) ) {
remove_action( 'edd_before_purchase_form', 'edd_discount_field', -1 );
remove_action( 'edd_before_purchase_form', 'edd_agree_to_terms_js' );
}
// Distraction Free Checkout.
if ( astra_get_option( 'edd-distraction-free-checkout' ) ) {
// HFB Support for distration free checkout.
if ( true === astra_addon_builder_helper()->is_header_footer_builder_active ) {
remove_action( 'astra_header', array( Astra_Builder_Header::get_instance(), 'prepare_header_builder_markup' ) );
remove_action( 'astra_footer', array( Astra_Builder_Footer::get_instance(), 'footer_markup' ), 10 );
}
remove_action( 'astra_header', 'astra_header_markup' );
remove_action( 'astra_footer', 'astra_footer_markup' );
add_action( 'astra_header', array( $this, 'checkout_header_markup' ) );
add_action( 'astra_footer', array( $this, 'checkout_footer_markup' ) );
// Store Sidebar Layout.
add_filter( 'astra_page_layout', array( $this, 'checkout_sidebar_layout' ), 99 );
}
}
/**
* Header markup.
*/
public function checkout_header_markup() {
astra_addon_get_template( 'edd/templates/checkout-header.php' );
}
/**
* Footer markup.
*/
public function checkout_footer_markup() {
astra_addon_get_template( 'edd/templates/checkout-footer.php' );
}
/**
* Checkout sidebar layout.
*
* @param string $sidebar_layout Layout.
*
* @return string;
*/
public function checkout_sidebar_layout( $sidebar_layout ) {
return 'no-sidebar';
}
/**
* Add Styles
*/
public function add_styles() {
/*** Start Path Logic */
/* Define Variables */
$uri = ASTRA_ADDON_EXT_EDD_URI . 'assets/css/';
$path = ASTRA_ADDON_EXT_EDD_DIR . 'assets/css/';
$rtl = '';
if ( is_rtl() ) {
$rtl = '-rtl';
}
/* Directory and Extension */
$file_prefix = $rtl . '.min';
$dir_name = 'minified';
if ( SCRIPT_DEBUG ) {
$file_prefix = $rtl;
$dir_name = 'unminified';
}
$css_uri = $uri . $dir_name . '/';
$css_dir = $path . $dir_name . '/';
if ( defined( 'ASTRA_THEME_HTTP2' ) && ASTRA_THEME_HTTP2 ) {
$gen_path = $css_uri;
} else {
$gen_path = $css_dir;
}
/*** End Path Logic */
/* Add style.css */
Astra_Minify::add_css( $gen_path . 'style' . $file_prefix . '.css' );
// Shop page style.
$shop_page_style = astra_get_option( 'edd-archive-style' );
if ( 'edd-archive-page-list-style' == $shop_page_style ) {
$shop_page_style = Astra_Addon_Builder_Helper::apply_flex_based_css() ? $shop_page_style . '-grid' : $shop_page_style;
Astra_Minify::add_css( $gen_path . $shop_page_style . $file_prefix . '.css' );
}
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
ASTRA_Ext_Edd_Markup::get_instance();