summaryrefslogtreecommitdiff
path: root/inc/compatibility
diff options
context:
space:
mode:
Diffstat (limited to 'inc/compatibility')
-rw-r--r--inc/compatibility/class-astra-amp.php1209
-rw-r--r--inc/compatibility/class-astra-bb-ultimate-addon.php428
-rw-r--r--inc/compatibility/class-astra-beaver-builder.php113
-rw-r--r--inc/compatibility/class-astra-beaver-themer.php410
-rw-r--r--inc/compatibility/class-astra-bne-flyout.php68
-rw-r--r--inc/compatibility/class-astra-contact-form-7.php74
-rw-r--r--inc/compatibility/class-astra-divi-builder.php68
-rw-r--r--inc/compatibility/class-astra-elementor-pro.php424
-rw-r--r--inc/compatibility/class-astra-elementor.php254
-rw-r--r--inc/compatibility/class-astra-gravity-forms.php74
-rw-r--r--inc/compatibility/class-astra-jetpack.php83
-rw-r--r--inc/compatibility/class-astra-site-origin.php68
-rw-r--r--inc/compatibility/class-astra-ubermeu.php87
-rw-r--r--inc/compatibility/class-astra-visual-composer.php141
-rw-r--r--inc/compatibility/class-astra-web-stories.php97
-rw-r--r--inc/compatibility/class-astra-yoast-seo.php40
-rw-r--r--inc/compatibility/edd/class-astra-edd.php1087
-rw-r--r--inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php67
-rw-r--r--inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php64
-rw-r--r--inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php84
-rw-r--r--inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php214
-rw-r--r--inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php57
-rw-r--r--inc/compatibility/edd/edd-common-functions.php324
-rw-r--r--inc/compatibility/index.php9
-rw-r--r--inc/compatibility/learndash/class-astra-learndash.php677
-rw-r--r--inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php50
-rw-r--r--inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php63
-rw-r--r--inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php62
-rw-r--r--inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php72
-rw-r--r--inc/compatibility/lifterlms/class-astra-lifterlms.php858
-rw-r--r--inc/compatibility/lifterlms/customizer/class-astra-liferlms-section-configs.php60
-rw-r--r--inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-container-configs.php66
-rw-r--r--inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-sidebar-configs.php80
-rw-r--r--inc/compatibility/lifterlms/customizer/sections/layout/class-astra-lifter-general-configs.php104
-rw-r--r--inc/compatibility/woocommerce/class-astra-woocommerce.php1819
-rw-r--r--inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php74
-rw-r--r--inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php64
-rw-r--r--inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php84
-rw-r--r--inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php57
-rw-r--r--inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php158
-rw-r--r--inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php80
-rw-r--r--inc/compatibility/woocommerce/woocommerce-common-functions.php299
42 files changed, 10271 insertions, 0 deletions
diff --git a/inc/compatibility/class-astra-amp.php b/inc/compatibility/class-astra-amp.php
new file mode 100644
index 0000000..f8c1468
--- /dev/null
+++ b/inc/compatibility/class-astra-amp.php
@@ -0,0 +1,1209 @@
+<?php
+/**
+ * AMP Compatibility.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2018, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Astra BB Ultimate Addon Compatibility
+ */
+if ( ! class_exists( 'Astra_AMP' ) ) :
+
+ /**
+ * Class Astra_AMP
+ */
+ class Astra_AMP {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_action( 'wp', array( $this, 'astra_amp_init' ) );
+ }
+
+ /**
+ * Init Astra Amp Compatibility.
+ * This adds required actions and filters only if AMP endpoinnt is detected.
+ *
+ * @since 1.7.0
+ * @return void
+ */
+ public function astra_amp_init() {
+
+ // bail if AMP endpoint is not detected.
+ if ( ! astra_is_amp_endpoint() ) {
+ return;
+ }
+
+ add_filter( 'astra_nav_toggle_data_attrs', array( $this, 'add_nav_toggle_attrs' ) );
+ add_filter( 'astra_search_slide_toggle_data_attrs', array( $this, 'add_search_slide_toggle_attrs' ) );
+ add_filter( 'astra_search_field_toggle_data_attrs', array( $this, 'add_search_field_toggle_attrs' ) );
+ add_action( 'wp_footer', array( $this, 'render_amp_states' ) );
+ add_filter( 'astra_attr_ast-main-header-bar-alignment', array( $this, 'nav_menu_wrapper' ) );
+ add_filter( 'astra_attr_ast-menu-toggle', array( $this, 'menu_toggle_button' ), 20, 3 );
+ add_filter( 'astra_theme_dynamic_css', array( $this, 'dynamic_css' ) );
+ add_filter( 'astra_toggle_button_markup', array( $this, 'toggle_button_markup' ), 20, 2 );
+ add_filter( 'astra_schema_body', array( $this, 'body_id' ) );
+ }
+
+ /**
+ * Add ID to body to toggleClasses on AMP actions.
+ *
+ * @since 1.7.0
+ * @param String $schema markup returned from theme.
+ * @return String
+ */
+ public function body_id( $schema ) {
+ return $schema . 'id="astra-body"';
+ }
+
+ /**
+ * Dynamic CSS used for AMP pages.
+ * This should be changed to main CSS in next versions, replacing JavaScript based interactions with pure CSS alternatives.
+ *
+ * @since 1.7.0
+ * @param String $compiled_css Dynamic CSS received to be enqueued on page.
+ *
+ * @return String Updated dynamic CSS with AMP specific changes.
+ */
+ public function dynamic_css( $compiled_css ) {
+
+
+ if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
+ $css = array(
+ '#ast-desktop-header' => array(
+ 'display' => 'none',
+ ),
+
+ '#ast-mobile-header' => array(
+ 'display' => 'block',
+ ),
+
+ '.ast-amp.ast-main-header-nav-open .ast-mobile-header-content' => array(
+ 'display' => 'block',
+ ),
+
+ '.ast-mobile-header-content .ast-main-header-bar-alignment.toggle-on .main-header-bar-navigation' => array(
+ 'display' => 'block',
+ ),
+
+ '.ast-amp .ast-mobile-header-content .main-navigation ul .menu-item .menu-link' => array(
+ 'padding' => '0 20px',
+ 'display' => 'inline-block',
+ 'width' => '100%',
+ 'border' => '0',
+ 'border-bottom-width' => '1px',
+ 'border-style' => 'solid',
+ 'border-color' => '#eaeaea',
+ ),
+
+ '.ast-amp .ast-mobile-header-content .toggled-on .main-header-bar-navigation' => array(
+ 'line-height' => '3',
+ 'display' => 'none',
+ ),
+ '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .sub-menu' => array(
+ 'line-height' => '3',
+ ),
+ '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children .sub-menu' => array(
+ 'display' => 'none',
+ ),
+ '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children .dropdown-open+ul.sub-menu' => array(
+ 'display' => 'block',
+ ),
+ '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle' => array(
+ 'display' => 'inline-block',
+ 'position' => 'absolute',
+ 'font-size' => 'inherit',
+ 'top' => '-1px',
+ 'right' => '20px',
+ 'cursor' => 'pointer',
+ 'webkit-font-smoothing' => 'antialiased',
+ 'moz-osx-font-smoothing' => 'grayscale',
+ 'padding' => '0 0.907em',
+ 'font-weight' => 'normal',
+ 'line-height' => 'inherit',
+ 'transition' => 'all 0.2s',
+ ),
+ '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .ast-submenu-expanded > .ast-menu-toggle::before' => array(
+ '-webkit-transform' => 'rotateX(180deg)',
+ 'transform' => 'rotateX(180deg)',
+ ),
+ '.ast-amp .ast-mobile-header-content .main-header-bar-navigation .main-header-menu' => array(
+ 'border-top-width' => '1px',
+ 'border-style' => 'solid',
+ 'border-color' => '#eaeaea',
+ ),
+ '.ast-amp .ast-below-header-bar, .ast-amp .main-header-bar, .ast-amp .ast-above-header-bar' => array(
+ 'display' => 'grid',
+ ),
+ );
+ if ( false === Astra_Icons::is_svg_icons() ) {
+ $css['.ast-amp .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before'] = array(
+ 'font-weight' => 'bold',
+ 'content' => '"\e900"',
+ 'font-family' => '"Astra"',
+ 'text-decoration' => 'inherit',
+ 'display' => 'inline-block',
+ );
+ }
+ } else {
+ $css = array(
+ '.ast-mobile-menu-buttons' => array(
+ 'text-align' => 'right',
+ '-js-display' => 'flex',
+ 'display' => '-webkit-box',
+ 'display' => '-webkit-flex',
+ 'display' => '-moz-box',
+ 'display' => '-ms-flexbox',
+ 'display' => 'flex',
+ '-webkit-box-pack' => 'end',
+ '-webkit-justify-content' => 'flex-end',
+ '-moz-box-pack' => 'end',
+ '-ms-flex-pack' => 'end',
+ 'justify-content' => 'flex-end',
+ '-webkit-align-self' => 'center',
+ '-ms-flex-item-align' => 'center',
+ 'align-self' => 'center',
+ ),
+ '.header-main-layout-1 .main-navigation' => array(
+ 'padding' => '0',
+ ),
+ );
+ }
+
+ $parse_css = $compiled_css . astra_parse_css( $css, '', astra_header_break_point() );
+
+ $css = array(
+
+ '.site-header .main-header-bar-wrap .site-branding' => array(
+ 'display' => '-webkit-box',
+ 'display' => '-webkit-flex',
+ 'display' => '-moz-box',
+ 'display' => '-ms-flexbox',
+ 'display' => 'flex',
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => '1',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => '1',
+ 'flex' => '1',
+ '-webkit-align-self' => 'center',
+ '-ms-flex-item-align' => 'center',
+ 'align-self' => 'center',
+ ),
+
+ '.ast-main-header-bar-alignment.toggle-on .main-header-bar-navigation' => array(
+ 'display' => 'block',
+ ),
+
+ '.main-navigation' => array(
+ 'display' => 'block',
+ 'width' => '100%',
+ ),
+
+ '.main-header-menu > .menu-item > .menu-link' => array(
+ 'padding' => '0 20px',
+ 'display' => 'inline-block',
+ 'width' => '100%',
+ 'border-bottom-width' => '1px',
+ 'border-style' => 'solid',
+ 'border-color' => '#eaeaea',
+ ),
+
+ '.ast-main-header-bar-alignment.toggle-on' => array(
+ 'display' => 'block',
+ 'width' => '100%',
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => 'auto',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => 'auto',
+ 'flex' => 'auto',
+ '-webkit-box-ordinal-group' => '5',
+ '-webkit-order' => '4',
+ '-moz-box-ordinal-group' => '5',
+ '-ms-flex-order' => '4',
+ 'order' => '4',
+ ),
+
+ '.main-header-menu .menu-item' => array(
+ 'width' => '100%',
+ 'text-align' => 'left',
+ 'border-top' => '0',
+ ),
+
+ '.main-header-bar-navigation' => array(
+ 'width' => '-webkit-calc( 100% + 40px)',
+ 'width' => 'calc( 100% + 40px)',
+ 'margin' => '0 -20px',
+ ),
+
+ '.main-header-bar .main-header-bar-navigation .main-header-menu' => array(
+ 'border-top-width' => '1px',
+ 'border-style' => 'solid',
+ 'border-color' => '#eaeaea',
+ ),
+
+ '.main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle' => array(
+ 'display' => 'inline-block',
+ 'position' => 'absolute',
+ 'font-size' => 'inherit',
+ 'top' => '-1px',
+ 'right' => '20px',
+ 'cursor' => 'pointer',
+ '-webkit-font-smoothing' => 'antialiased',
+ '-moz-osx-font-smoothing' => 'grayscale',
+ 'padding' => '0 0.907em',
+ 'font-weight' => 'normal',
+ 'line-height' => 'inherit',
+ '-webkit-transition' => 'all .2s',
+ 'transition' => 'all .2s',
+ ),
+ );
+
+ if ( false === Astra_Icons::is_svg_icons() ) {
+ $css['.main-header-bar-navigation .menu-item-has-children > .menu-link:after'] = array(
+ 'content' => 'none',
+ );
+ $css['.ast-button-wrap .menu-toggle.toggled .menu-toggle-icon:before'] = array(
+ 'content' => "\e5cd",
+ );
+ $css['.main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before'] = array(
+ 'font-weight' => 'bold',
+ 'content' => '"\e900"',
+ 'font-family' => 'Astra',
+ 'text-decoration' => 'inherit',
+ 'display' => 'inline-block',
+ );
+ }
+
+ $parse_css .= astra_parse_css( $css, '', astra_header_break_point() );
+
+ if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
+
+ $astra_break_point_navigation = array(
+ '.ast-amp .main-header-bar-navigation' => array(
+ 'margin' => '0',
+ ),
+ );
+
+ } else {
+ $astra_break_point_navigation = array(
+ '.ast-amp .main-header-bar-navigation' => array(
+ 'margin' => '0 -20px',
+ ),
+ '.ast-amp .ast-mobile-menu-buttons' => array(
+ 'text-align' => 'right',
+ '-js-display' => 'flex',
+ 'display' => '-webkit-box',
+ 'display' => '-webkit-flex',
+ 'display' => '-moz-box',
+ 'display' => '-ms-flexbox',
+ 'display' => 'flex',
+ '-webkit-box-pack' => 'end',
+ '-webkit-justify-content' => 'flex-end',
+ '-moz-box-pack' => 'end',
+ '-ms-flex-pack' => 'end',
+ 'justify-content' => 'flex-end',
+ '-webkit-align-self' => 'center',
+ '-ms-flex-item-align' => 'center',
+ 'align-self' => 'center',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .main-header-bar .ast-search-icon' => array(
+ 'margin-right' => '1em',
+ ),
+ '.ast-theme.ast-header-custom-item-inside .main-header-bar .main-header-bar-navigation .ast-search-icon' => array(
+ 'display' => 'none',
+ ),
+ '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-field, .ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon.ast-inline-search .search-field' => array(
+ 'width' => '100%',
+ 'padding-right' => '5.5em',
+ ),
+ '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-submit' => array(
+ 'display' => 'block',
+ 'position' => 'absolute',
+ 'height' => '100%',
+ 'top' => '0',
+ 'right' => '0',
+ 'padding' => '0 1em',
+ 'border-radius' => '0',
+ ),
+ '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-form' => array(
+ 'padding' => '0',
+ 'display' => 'block',
+ 'overflow' => 'hidden',
+ ),
+ '.ast-amp .ast-header-custom-item' => array(
+ 'background-color' => '#f9f9f9',
+ ),
+ '.ast-amp .ast-mobile-header-stack .site-description' => array(
+ 'text-align' => 'center',
+ ),
+ '.ast-amp .ast-mobile-header-stack.ast-logo-title-inline .site-description' => array(
+ 'text-align' => 'left',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .ast-primary-menu-disabled .ast-mobile-menu-buttons' => array(
+ 'display' => 'none',
+ ),
+ '.ast-amp .ast-hide-custom-menu-mobile .ast-masthead-custom-menu-items' => array(
+ 'display' => 'none',
+ ),
+ '.ast-amp .ast-mobile-header-inline .site-branding' => array(
+ 'text-align' => 'left',
+ 'padding-bottom' => '0',
+ ),
+ '.ast-amp .ast-mobile-header-inline.header-main-layout-3 .site-branding' => array(
+ 'text-align' => 'right',
+ ),
+ '.ast-amp ul li.ast-masthead-custom-menu-items a' => array(
+ 'padding' => '0',
+ 'width' => 'auto',
+ 'display' => 'initial',
+ ),
+ '.ast-amp li.ast-masthead-custom-menu-items' => array(
+ 'padding-left' => '20px',
+ 'padding-right' => '20px',
+ 'margin-bottom' => '1em',
+ 'margin-top' => '1em',
+ ),
+ '.ast-theme.ast-header-custom-item-inside .ast-search-menu-icon' => array(
+ 'position' => 'relative',
+ 'display' => 'block',
+ 'right' => 'auto',
+ 'visibility' => 'visible',
+ 'opacity' => '1',
+ '-webkit-transform' => 'none',
+ '-ms-transform' => 'none',
+ 'transform' => 'none',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .ast-mobile-menu-buttons' => array(
+ '-webkit-box-ordinal-group' => '3',
+ '-webkit-order' => '2',
+ '-moz-box-ordinal-group' => '3',
+ '-ms-flex-order' => '2',
+ 'order' => '2',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .main-header-bar-navigation' => array(
+ '-webkit-box-ordinal-group' => '4',
+ '-webkit-order' => '3',
+ '-moz-box-ordinal-group' => '4',
+ '-ms-flex-order' => '3',
+ 'order' => '3',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .ast-masthead-custom-menu-items' => array(
+ '-webkit-box-ordinal-group' => '2',
+ '-webkit-order' => '1',
+ '-moz-box-ordinal-group' => '2',
+ '-ms-flex-order' => '1',
+ 'order' => '1',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .header-main-layout-2 .ast-masthead-custom-menu-items' => array(
+ 'text-align' => 'center',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .site-branding, .ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .ast-mobile-menu-buttons' => array(
+ '-js-display' => 'flex',
+ 'display' => '-webkit-box',
+ 'display' => '-webkit-flex',
+ 'display' => '-moz-box',
+ 'display' => '-ms-flexbox',
+ 'display' => 'flex',
+ ),
+ '.ast-theme.ast-header-custom-item-outside.ast-header-custom-item-outside .header-main-layout-2 .ast-mobile-menu-buttons' => array(
+ 'padding-bottom' => '0',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .ast-site-identity' => array(
+ 'width' => '100%',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline.header-main-layout-3 .ast-site-identity' => array(
+ 'width' => 'auto',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline.header-main-layout-2 .site-branding' => array(
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => '1 1 auto',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => '1 1 auto',
+ 'flex' => '1 1 auto',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .site-branding' => array(
+ 'text-align' => 'left',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-inline .site-title' => array(
+ '-webkit-box-pack' => 'left',
+ '-webkit-justify-content' => 'left',
+ '-moz-box-pack' => 'left',
+ '-ms-flex-pack' => 'left',
+ 'justify-content' => 'left',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .header-main-layout-2 .ast-mobile-menu-buttons' => array(
+ 'padding-bottom' => '1em',
+ ),
+ '.ast-amp .ast-mobile-header-stack .main-header-container, .ast-amp .ast-mobile-header-inline .main-header-container' => array(
+ '-js-display' => 'flex',
+ 'display' => '-webkit-box',
+ 'display' => '-webkit-flex',
+ 'display' => '-moz-box',
+ 'display' => '-ms-flexbox',
+ 'display' => 'flex',
+ ),
+ '.ast-amp .header-main-layout-1 .site-branding' => array(
+ 'padding-right' => '1em',
+ ),
+ '.ast-amp .header-main-layout-1 .main-header-bar-navigation' => array(
+ 'text-align' => 'left',
+ ),
+ '.ast-amp .header-main-layout-1 .main-navigation' => array(
+ 'padding-left' => '0',
+ ),
+ '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items' => array(
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => '1 1 100%',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => '1 1 100%',
+ 'flex' => '1 1 100%',
+ ),
+ '.ast-amp .ast-mobile-header-stack .site-branding' => array(
+ 'padding-left' => '0',
+ 'padding-right' => '0',
+ 'padding-bottom' => '1em',
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => '1 1 100%',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => '1 1 100%',
+ 'flex' => '1 1 100%',
+ ),
+ '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items, .ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .site-title, .ast-amp .ast-mobile-header-stack .ast-site-identity' => array(
+ '-webkit-box-pack' => 'center',
+ '-webkit-justify-content' => 'center',
+ '-moz-box-pack' => 'center',
+ '-ms-flex-pack' => 'center',
+ 'justify-content' => 'center',
+ 'text-align' => 'center',
+ ),
+ '.ast-amp .ast-mobile-header-stack.ast-logo-title-inline .site-title' => array(
+ 'text-align' => 'left',
+ ),
+ '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array(
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => '1 1 100%',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => '1 1 100%',
+ 'flex' => '1 1 100%',
+ 'text-align' => 'center',
+ '-webkit-box-pack' => 'center',
+ '-webkit-justify-content' => 'center',
+ '-moz-box-pack' => 'center',
+ '-ms-flex-pack' => 'center',
+ 'justify-content' => 'center',
+ ),
+ '.ast-amp .ast-mobile-header-stack.header-main-layout-3 .main-header-container' => array(
+ 'flex-direction' => 'initial',
+ ),
+ '.ast-amp .header-main-layout-2 .ast-mobile-menu-buttons' => array(
+ '-js-display' => 'flex',
+ 'display' => '-webkit-box',
+ 'display' => '-webkit-flex',
+ 'display' => '-moz-box',
+ 'display' => '-ms-flexbox',
+ 'display' => 'flex',
+ '-webkit-box-pack' => 'center',
+ '-webkit-justify-content' => 'center',
+ '-moz-box-pack' => 'center',
+ '-ms-flex-pack' => 'center',
+ 'justify-content' => 'center',
+ ),
+ '.ast-amp .header-main-layout-2 .main-header-bar-navigation, .ast-amp .header-main-layout-2 .widget' => array(
+ 'text-align' => 'left',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .header-main-layout-3 .main-header-bar .ast-search-icon' => array(
+ 'margin-right' => 'auto',
+ 'margin-left' => '1em',
+ ),
+ '.ast-amp .header-main-layout-3 .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array(
+ 'right' => 'auto',
+ 'left' => '0',
+ ),
+ '.ast-amp .header-main-layout-3.ast-mobile-header-inline .ast-mobile-menu-buttons' => array(
+ '-webkit-box-pack' => 'start',
+ '-webkit-justify-content' => 'flex-start',
+ '-moz-box-pack' => 'start',
+ '-ms-flex-pack' => 'start',
+ 'justify-content' => 'flex-start',
+ ),
+ '.ast-amp .header-main-layout-3 li .ast-search-menu-icon' => array(
+ 'left' => '0',
+ ),
+ '.ast-amp .header-main-layout-3 .site-branding' => array(
+ 'padding-left' => '1em',
+ '-webkit-box-pack' => 'end',
+ '-webkit-justify-content' => 'flex-end',
+ '-moz-box-pack' => 'end',
+ '-ms-flex-pack' => 'end',
+ 'justify-content' => 'flex-end',
+ ),
+ '.ast-amp .header-main-layout-3 .main-navigation' => array(
+ 'padding-right' => '0',
+ ),
+ '.ast-amp .header-main-layout-1 .site-branding' => array(
+ 'padding-right' => '1em',
+ ),
+ '.ast-amp .header-main-layout-1 .main-header-bar-navigation' => array(
+ 'text-align' => 'left',
+ ),
+ '.ast-amp .header-main-layout-1 .main-navigation' => array(
+ 'padding-left' => '0',
+ ),
+ '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items' => array(
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => '1 1 100%',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => '1 1 100%',
+ 'flex' => '1 1 100%',
+ ),
+ '.ast-amp .ast-mobile-header-stack .site-branding' => array(
+ 'padding-left' => '0',
+ 'padding-right' => '0',
+ 'padding-bottom' => '1em',
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => '1 1 100%',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => '1 1 100%',
+ 'flex' => '1 1 100%',
+ ),
+ '.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items, .ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .site-title, .ast-amp .ast-mobile-header-stack .ast-site-identity' => array(
+ '-webkit-box-pack' => 'center',
+ '-webkit-justify-content' => 'center',
+ '-moz-box-pack' => 'center',
+ '-ms-flex-pack' => 'center',
+ 'justify-content' => 'center',
+ 'text-align' => 'center',
+ ),
+ '.ast-amp .ast-mobile-header-stack.ast-logo-title-inline .site-title' => array(
+ 'text-align' => 'left',
+ ),
+ '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array(
+ 'flex' => '1 1 100%',
+ 'text-align' => 'center',
+ '-webkit-box-pack' => 'center',
+ '-webkit-justify-content' => 'center',
+ '-moz-box-pack' => 'center',
+ '-ms-flex-pack' => 'center',
+ 'justify-content' => 'center',
+ ),
+ '.ast-amp .ast-mobile-header-stack.header-main-layout-3 .main-header-container' => array(
+ 'flex-direction' => 'initial',
+ ),
+ '.ast-amp .header-main-layout-2 .ast-mobile-menu-buttons' => array(
+ 'display' => '-webkit-box',
+ 'display' => '-webkit-flex',
+ 'display' => '-moz-box',
+ 'display' => '-ms-flexbox',
+ 'display' => 'flex',
+ '-webkit-box-pack' => 'center',
+ '-webkit-justify-content' => 'center',
+ '-moz-box-pack' => 'center',
+ '-ms-flex-pack' => 'center',
+ 'justify-content' => 'center',
+ ),
+ '.ast-amp .header-main-layout-2 .main-header-bar-navigation, .ast-amp .header-main-layout-2 .widget' => array(
+ 'text-align' => 'left',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .header-main-layout-3 .main-header-bar .ast-search-icon' => array(
+ 'margin-right' => 'auto',
+ 'margin-left' => '1em',
+ ),
+ '.ast-amp .header-main-layout-3 .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array(
+ 'right' => 'auto',
+ 'left' => '0',
+ ),
+ '.ast-amp .header-main-layout-3.ast-mobile-header-inline .ast-mobile-menu-buttons' => array(
+ '-webkit-box-pack' => 'start',
+ '-webkit-justify-content' => 'flex-start',
+ '-moz-box-pack' => 'start',
+ '-ms-flex-pack' => 'start',
+ 'justify-content' => 'flex-start',
+ ),
+ '.ast-amp .header-main-layout-3 li .ast-search-menu-icon' => array(
+ 'left' => '0',
+ ),
+ '.ast-amp .header-main-layout-3 .site-branding' => array(
+ 'padding-left' => '1em',
+ '-webkit-box-pack' => 'end',
+ '-webkit-justify-content' => 'flex-end',
+ '-moz-box-pack' => 'end',
+ '-ms-flex-pack' => 'end',
+ 'justify-content' => 'flex-end',
+ ),
+ '.ast-amp .header-main-layout-3 .main-navigation' => array(
+ 'padding-right' => '0',
+ ),
+ '.ast-amp .ast-header-custom-item' => array(
+ 'border-top' => '1px solid #eaeaea',
+ ),
+ '.ast-amp .ast-header-custom-item .ast-masthead-custom-menu-items' => array(
+ 'padding-left' => '20px',
+ 'padding-right' => '20px',
+ 'margin-bottom' => '1em',
+ 'margin-top' => '1em',
+ ),
+ '.ast-amp .ast-header-custom-item .widget:last-child' => array(
+ 'margin-bottom' => '1em',
+ ),
+ '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item .menu-link' => array(
+ 'display' => 'block',
+ ),
+ '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item' => array(
+ 'padding-left' => '0',
+ 'padding-right' => '0',
+ 'margin-top' => '0',
+ 'margin-bottom' => '0',
+ ),
+ '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item .ast-custom-button-link' => array(
+ 'display' => 'none',
+ ),
+ '.ast-header-custom-item-inside.ast-amp .button-custom-menu-item .menu-link' => array(
+ 'display' => 'block',
+ ),
+ '.ast-amp .woocommerce-custom-menu-item .ast-cart-menu-wrap' => array(
+ 'width' => '2em',
+ 'height' => '2em',
+ 'font-size' => '1.4em',
+ 'line-height' => '2',
+ 'vertical-align' => 'middle',
+ 'text-align' => 'right',
+ ),
+ '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-3 .ast-site-header-cart' => array(
+ 'padding' => '0 0 1em 1em',
+ ),
+ '.ast-theme.ast-woocommerce-cart-menu.ast-header-custom-item-outside .ast-site-header-cart' => array(
+ 'padding' => '0',
+ ),
+ '.ast-amp .ast-masthead-custom-menu-items.woocommerce-custom-menu-item' => array(
+ 'margin-bottom' => '0',
+ 'margin-top' => '0',
+ ),
+ '.ast-amp .ast-masthead-custom-menu-items.woocommerce-custom-menu-item .ast-site-header-cart' => array(
+ 'padding' => '0',
+ ),
+ '.ast-amp .ast-masthead-custom-menu-items.woocommerce-custom-menu-item .ast-site-header-cart a' => array(
+ 'border' => 'none',
+ 'display' => 'inline-block',
+ ),
+ '.ast-theme.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-form' => array(
+ 'visibility' => 'visible',
+ 'opacity' => '1',
+ 'position' => 'relative',
+ 'right' => 'auto',
+ 'top' => 'auto',
+ 'transform' => 'none',
+ ),
+ '.ast-theme.ast-header-custom-item-outside .ast-mobile-header-stack .main-header-bar .ast-search-icon' => array(
+ 'margin' => '0',
+ ),
+ '.ast-amp .ast-mobile-header-stack .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array(
+ 'right' => '-1em',
+ ),
+ '.ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array(
+ '-webkit-box-pack' => 'center',
+ '-webkit-justify-content' => 'center',
+ '-moz-box-pack' => 'center',
+ '-ms-flex-pack' => 'center',
+ 'justify-content' => 'center',
+ 'text-align' => 'center',
+ 'padding-bottom' => '0',
+ ),
+ '.ast-safari-browser-less-than-11.ast-woocommerce-cart-menu.ast-header-break-point .header-main-layout-2 .main-header-container' => array(
+ 'display' => 'flex',
+ ),
+ );
+
+ // Tablet CSS.
+ $astra_medium_break_point_navigation = array(
+ '.ast-amp .footer-sml-layout-2 .ast-small-footer-section-2' => array(
+ 'margin-top' => '1em',
+ ),
+ );
+
+ $parse_css .= astra_parse_css( $astra_medium_break_point_navigation, astra_get_tablet_breakpoint() );
+
+ // Mobile CSS.
+ $astra_small_break_point_navigation = array(
+ '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart' => array(
+ 'padding-right' => '0',
+ 'padding-left' => '0',
+ ),
+ '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .main-header-bar, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .main-header-bar' => array(
+ 'text-align' => 'center',
+ ),
+ '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-site-header-cart, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .ast-site-header-cart' => array(
+ 'display' => 'inline-block',
+ ),
+ '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-mobile-menu-buttons, .ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .ast-mobile-menu-buttons' => array(
+ 'display' => 'inline-block',
+ ),
+ '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-2.ast-mobile-header-inline .site-branding' => array(
+ 'flex' => 'auto',
+ ),
+ '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .site-branding' => array(
+ 'flex' => '0 0 100%',
+ ),
+ '.ast-theme.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .main-header-container' => array(
+ 'display' => '-webkit-box',
+ 'display' => '-webkit-flex',
+ 'display' => '-moz-box',
+ 'display' => '-ms-flexbox',
+ 'display' => 'flex',
+ '-webkit-box-pack' => 'center',
+ '-webkit-justify-content' => 'center',
+ '-moz-box-pack' => 'center',
+ '-ms-flex-pack' => 'center',
+ 'justify-content' => 'center',
+ ),
+ '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array(
+ 'width' => '100%',
+ ),
+ '.ast-amp .ast-mobile-header-stack .site-branding, .ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array(
+ '-webkit-box-pack' => 'center',
+ '-webkit-justify-content' => 'center',
+ '-moz-box-pack' => 'center',
+ '-ms-flex-pack' => 'center',
+ 'justify-content' => 'center',
+ ),
+ '.ast-amp .ast-mobile-header-stack .main-header-bar-wrap .site-branding' => array(
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => '1 1 auto',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => '1 1 auto',
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => '1 1 auto',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => '1 1 auto',
+ 'flex' => '1 1 auto',
+ ),
+ '.ast-amp .ast-mobile-header-stack .ast-mobile-menu-buttons' => array(
+ 'padding-top' => '0.8em',
+ ),
+ '.ast-amp .ast-mobile-header-stack.header-main-layout-2 .ast-mobile-menu-buttons' => array(
+ 'padding-top' => '0.8em',
+ ),
+ '.ast-amp .ast-mobile-header-stack.header-main-layout-1 .site-branding' => array(
+ 'padding-bottom' => '0',
+ ),
+ '.ast-header-custom-item-outside.ast-amp .ast-mobile-header-stack .ast-masthead-custom-menu-items' => array(
+ 'padding' => '0.8em 1em 0 1em',
+ 'text-align' => 'center',
+ 'width' => '100%',
+ ),
+ '.ast-header-custom-item-outside.ast-amp .ast-mobile-header-stack.header-main-layout-3 .ast-mobile-menu-buttons, .ast-header-custom-item-outside.ast-amp .ast-mobile-header-stack.header-main-layout-3 .ast-masthead-custom-menu-items' => array(
+ 'padding-top' => '0.8em',
+ ),
+ // Tablet CSS.
+ '.ast-amp .footer-sml-layout-2 .ast-small-footer-section-2' => array(
+ 'margin-top' => '1em',
+ ),
+ );
+
+ $parse_css .= astra_parse_css( $astra_small_break_point_navigation, astra_get_mobile_breakpoint() );
+ }
+
+ $parse_css .= astra_parse_css( $astra_break_point_navigation, '', astra_header_break_point() );
+
+ // Move all header-break-point css from class based css to media query based CSS.
+ $astra_break_point_navigation = array(
+
+ '.ast-amp .entry-content .alignwide' => array(
+ 'margin-left' => 'auto',
+ 'margin-right' => 'auto',
+ ),
+ '.ast-amp .main-navigation' => array(
+ 'padding-left' => '0',
+ ),
+ '.ast-amp .main-navigation ul .menu-item .menu-link, .ast-amp .main-navigation ul .button-custom-menu-item a' => array(
+ 'padding' => '0 20px',
+ 'display' => 'inline-block',
+ 'width' => '100%',
+ 'border-bottom-width' => '1px',
+ 'border-style' => 'solid',
+ 'border-color' => '#eaeaea',
+ ),
+ '.ast-amp .main-navigation .sub-menu .menu-item .menu-link' => array(
+ 'padding-left' => '30px',
+ ),
+ '.ast-amp .main-navigation .sub-menu .menu-item .menu-item .menu-link' => array(
+ 'padding-left' => '40px',
+ ),
+ '.ast-amp .main-navigation .sub-menu .menu-item .menu-item .menu-item .menu-link' => array(),
+ '.ast-amp .main-navigation .sub-menu .menu-item .menu-item .menu-item .menu-item .menu-link' => array(
+ 'padding-left' => '60px',
+ ),
+ '.ast-amp .main-header-menu' => array(
+ 'background-color' => '#f9f9f9',
+ ),
+ '.ast-amp .main-header-menu ul' => array(
+ 'background-color' => '#f9f9f9',
+ 'position' => 'static',
+ 'opacity' => '1',
+ 'visibility' => 'visible',
+ 'border' => '0',
+ 'width' => 'auto',
+ ),
+ '.ast-amp .main-header-menu ul li.ast-left-align-sub-menu:hover > ul, .ast-amp .main-header-menu ul li.ast-left-align-sub-menu.focus > ul' => array(
+ 'left' => '0',
+ ),
+ '.ast-amp .main-header-menu li.ast-sub-menu-goes-outside:hover > ul, .ast-amp .main-header-menu li.ast-sub-menu-goes-outside.focus > ul' => array(
+ 'left' => '0',
+ ),
+ '.ast-amp .submenu-with-border .sub-menu' => array(
+ 'border' => '0',
+ ),
+ '.ast-amp .user-select' => array(
+ 'clear' => 'both',
+ ),
+ '.ast-amp .ast-mobile-menu-buttons' => array(
+ 'display' => 'block',
+ '-webkit-align-self' => 'center',
+ '-ms-flex-item-align' => 'center',
+ 'align-self' => 'center',
+ ),
+ '.ast-amp .main-header-bar-navigation' => array(
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => 'auto',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => 'auto',
+ 'flex' => 'auto',
+ 'width' => '-webkit-calc( 100% + 40px)',
+ 'width' => 'calc(100% + 40px )',
+ ),
+ '.ast-amp .ast-main-header-bar-alignment' => array(
+ 'display' => 'block',
+ 'width' => '100%',
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => 'auto',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => 'auto',
+ 'flex' => 'auto',
+ '-webkit-box-ordinal-group' => '5',
+ '-webkit-order' => '4',
+ '-moz-box-ordinal-group' => '5',
+ '-ms-flex-order' => '4',
+ 'order' => '4',
+ ),
+ '.ast-amp .ast-mobile-menu-buttons' => array(
+ 'text-align' => 'right',
+ 'display' => '-webkit-box',
+ 'display' => '-webkit-flex',
+ 'display' => '-moz-box',
+ 'display' => '-ms-flexbox',
+ 'display' => 'flex',
+ '-webkit-box-pack' => 'end',
+ '-webkit-justify-content' => 'flex-end',
+ '-moz-box-pack' => 'end',
+ '-ms-flex-pack' => 'end',
+ 'justify-content' => 'flex-end',
+ ),
+ '.ast-amp .site-header .main-header-bar-wrap .site-branding' => array(
+ '-js-display' => 'flex',
+ 'display' => '-webkit-box',
+ 'display' => '-webkit-flex',
+ 'display' => '-moz-box',
+ 'display' => '-ms-flexbox',
+ 'display' => 'flex',
+ '-webkit-box-flex' => '1',
+ '-webkit-flex' => '1',
+ '-moz-box-flex' => '1',
+ '-ms-flex' => '1',
+ 'flex' => '1',
+ '-webkit-align-self' => 'center',
+ '-ms-flex-item-align' => 'center',
+ 'align-self' => 'center',
+ ),
+ '.ast-amp .ast-site-identity' => array(
+ 'width' => '100%',
+ ),
+ '.ast-amp .main-header-bar-navigation .menu-item-has-children > .menu-link .sub-arrow:after' => array(
+ 'display' => 'none',
+ ),
+ '.ast-amp .main-header-bar' => array(
+ 'display' => 'block',
+ 'line-height' => '3',
+ ),
+ '.ast-main-header-bar-alignment .main-header-bar-navigation' => array(
+ 'line-height' => '3',
+ 'display' => 'none',
+ ),
+ '.ast-amp .main-header-bar .toggled-on .main-header-bar-navigation' => array(
+ 'line-height' => '3',
+ 'display' => 'none',
+ ),
+ '.ast-amp .main-header-bar .main-header-bar-navigation .sub-menu' => array(
+ 'line-height' => '3',
+ ),
+ '.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children .sub-menu' => array(
+ 'display' => 'none',
+ ),
+ '.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children .dropdown-open+ul.sub-menu' => array(
+ 'display' => 'block',
+ ),
+ '.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle' => array(
+ 'display' => 'inline-block',
+ 'position' => 'absolute',
+ 'font-size' => 'inherit',
+ 'top' => '-1px',
+ 'right' => '20px',
+ 'cursor' => 'pointer',
+ 'webkit-font-smoothing' => 'antialiased',
+ 'moz-osx-font-smoothing' => 'grayscale',
+ 'padding' => '0 0.907em',
+ 'font-weight' => 'normal',
+ 'line-height' => 'inherit',
+ 'transition' => 'all 0.2s',
+ ),
+ '.ast-amp .main-header-bar .main-header-bar-navigation .ast-submenu-expanded > .ast-menu-toggle::before' => array(
+ '-webkit-transform' => 'rotateX(180deg)',
+ 'transform' => 'rotateX(180deg)',
+ ),
+ '.ast-amp .main-header-bar .main-header-bar-navigation .main-header-menu' => array(
+ 'border-top-width' => '1px',
+ 'border-style' => 'solid',
+ 'border-color' => '#eaeaea',
+ ),
+ '.ast-amp .main-navigation' => array(
+ 'display' => 'block',
+ 'width' => '100%',
+ ),
+ '.ast-amp .main-navigation ul > li:first-child' => array(
+ 'border-top' => '0',
+ ),
+ '.ast-amp .main-navigation ul ul' => array(
+ 'left' => 'auto',
+ 'right' => 'auto',
+ ),
+ '.ast-amp .main-navigation li' => array(
+ 'width' => '100%',
+ ),
+ '.ast-amp .main-navigation .widget' => array(
+ 'margin-bottom' => '1em',
+ ),
+ '.ast-amp .main-navigation .widget li' => array(
+ 'width' => 'auto',
+ ),
+ '.ast-amp .main-navigation .widget:last-child' => array(
+ 'margin-bottom' => '0',
+ ),
+ '.ast-amp .main-header-menu ul ul' => array(
+ 'top' => '0',
+ ),
+ '.ast-amp .ast-has-mobile-header-logo .custom-logo-link, .ast-amp .ast-has-mobile-header-logo .astra-logo-svg' => array(
+ 'display' => 'none',
+ ),
+ '.ast-amp .ast-has-mobile-header-logo .custom-mobile-logo-link' => array(
+ 'display' => 'inline-block',
+ ),
+ '.ast-theme.ast-mobile-inherit-site-logo .ast-has-mobile-header-logo .custom-logo-link, .ast-theme.ast-mobile-inherit-site-logo .ast-has-mobile-header-logo .astra-logo-svg' => array(
+ 'display' => 'block',
+ ),
+ '.ast-amp .ast-header-widget-area .widget' => array(
+ 'margin' => '0.5em 0',
+ 'display' => 'block',
+ ),
+ '.ast-amp .main-header-bar' => array(
+ 'border' => '0',
+ 'border-bottom-color' => '#eaeaea',
+ 'border-bottom-style' => 'solid',
+ ),
+ '.ast-amp .nav-fallback-text' => array(
+ 'float' => 'none',
+ ),
+ '.ast-amp .main-header-menu .woocommerce-custom-menu-item .ast-cart-menu-wrap' => array(
+ 'height' => '3em',
+ 'line-height' => '3',
+ 'text-align' => 'left',
+ ),
+ '.ast-amp #ast-site-header-cart .widget_shopping_cart' => array(
+ 'display' => 'none',
+ ),
+ '.ast-theme.ast-woocommerce-cart-menu .ast-site-header-cart' => array(
+ 'order' => 'initial',
+ 'line-height' => '3',
+ 'padding' => '0 1em 1em 0',
+ ),
+ '.ast-amp .ast-edd-site-header-cart .widget_edd_cart_widget, .ast-amp .ast-edd-site-header-cart .ast-edd-header-cart-info-wrap' => array(
+ 'display' => 'none',
+ ),
+ '.ast-amp div.ast-masthead-custom-menu-items.edd-custom-menu-item' => array(
+ 'padding' => '0',
+ ),
+ '.ast-amp .main-header-bar .ast-search-menu-icon.slide-search .search-form' => array(
+ 'right' => '0',
+ ),
+ '.ast-amp .main-header-menu .sub-menu' => array(
+ 'box-shadow' => 'none',
+ ),
+ '.ast-amp .submenu-with-border .sub-menu a' => array(
+ 'border-width' => '1px',
+ ),
+ '.ast-amp .submenu-with-border .sub-menu > li:last-child > a' => array(
+ 'border-width' => '1px',
+ ),
+ );
+
+ if ( false === Astra_Icons::is_svg_icons() ) {
+ $astra_break_point_navigation['.ast-amp .main-navigation ul.children li a:before, .ast-amp .main-navigation ul.sub-menu li a:before'] = array(
+ 'content' => '"\e900"',
+ 'font-family' => '"Astra"',
+ 'font-size' => '0.65em',
+ 'text-decoration' => 'inherit',
+ 'display' => 'inline-block',
+ 'transform' => 'translate(0, -2px) rotateZ(270deg)',
+ 'margin-right' => '5px',
+ );
+ $astra_break_point_navigation['.ast-amp .main-header-bar .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle::before'] = array(
+ 'font-weight' => 'bold',
+ 'content' => '"\e900"',
+ 'font-family' => '"Astra"',
+ 'text-decoration' => 'inherit',
+ 'display' => 'inline-block',
+ );
+ } else {
+ $astra_break_point_navigation['[data-section="section-header-mobile-trigger"] .ast-button-wrap .ast-mobile-menu-buttons-minimal'] = array(
+ 'background' => 'transparent',
+ 'border' => 'none',
+ );
+ }
+
+ $parse_css .= astra_parse_css( $astra_break_point_navigation, '', astra_header_break_point() );
+
+ return $parse_css;
+ }
+
+ /**
+ * Add AMP attributes to the nav menu wrapper.
+ *
+ * @since 1.7.0
+ * @param Array $attr HTML attributes to be added to the nav menu wrapper.
+ *
+ * @return Array updated HTML attributes.
+ */
+ public function nav_menu_wrapper( $attr ) {
+ $attr['[class]'] = '( astraAmpMenuExpanded ? \'ast-main-header-bar-alignment toggle-on\' : \'ast-main-header-bar-alignment\' )';
+ $attr['aria-expanded'] = 'false';
+ $attr['[aria-expanded]'] = '(astraAmpMenuExpanded ? \'true\' : \'false\')';
+
+ return $attr;
+ }
+
+ /**
+ * Set AMP State for eeach sub menu toggle.
+ *
+ * @since 1.7.0
+ * @param String $item_output HTML markup for the menu item.
+ * @param WP_Post $item Post object for the navigation menu.
+ *
+ * @return String HTML MArkup for the menu including the AML State.
+ */
+ public function toggle_button_markup( $item_output, $item ) {
+ $item_output .= '<amp-state id="astraNavMenuItemExpanded' . esc_attr( $item->ID ) . '"><script type="application/json">false</script></amp-state>';
+
+ return $item_output;
+ }
+
+ /**
+ * Add AMP attribites to the toggle button to add `.ast-submenu-expanded` class to parent li.
+ *
+ * @since 1.7.0
+ * @param array $attr Optional. Extra attributes to merge with defaults.
+ * @param string $context The context, to build filter name.
+ * @param array $args Optional. Custom data to pass to filter.
+ *
+ * @return Array updated HTML attributes.
+ */
+ public function menu_toggle_button( $attr, $context, $args ) {
+ $attr['[class]'] = '( astraNavMenuItemExpanded' . $args->ID . ' ? \' ast-menu-toggle dropdown-open\' : \'ast-menu-toggle\')';
+ $attr['on'] = 'tap:AMP.setState( { astraNavMenuItemExpanded' . $args->ID . ': ! astraNavMenuItemExpanded' . $args->ID . ' } )';
+
+ return $attr;
+ }
+
+ /**
+ * Add amp states to the dom.
+ */
+ public function render_amp_states() {
+ echo '<amp-state id="astraAmpMenuExpanded">';
+ echo '<script type="application/json">false</script>';
+ echo '</amp-state>';
+ }
+
+ /**
+ * Add search slide data attributes.
+ *
+ * @param string $input the data attrs already existing in the nav.
+ *
+ * @return string
+ */
+ public function add_search_slide_toggle_attrs( $input ) {
+ $input .= ' on="tap:AMP.setState( { astraAmpSlideSearchMenuExpanded: ! astraAmpSlideSearchMenuExpanded } )" ';
+ $input .= ' [class]="( astraAmpSlideSearchMenuExpanded ? \'ast-search-menu-icon slide-search ast-dropdown-active\' : \'ast-search-menu-icon slide-search\' )" ';
+ $input .= ' aria-expanded="false" [aria-expanded]="astraAmpSlideSearchMenuExpanded ? \'true\' : \'false\'" ';
+
+ return $input;
+ }
+
+ /**
+ * Add search slide data attributes.
+ *
+ * @param string $input the data attrs already existing in the nav.
+ *
+ * @return string
+ */
+ public function add_search_field_toggle_attrs( $input ) {
+ $input .= ' on="tap:AMP.setState( { astraAmpSlideSearchMenuExpanded: astraAmpSlideSearchMenuExpanded } )" ';
+
+ return $input;
+ }
+
+ /**
+ * Add the nav toggle data attributes.
+ *
+ * @param string $input the data attrs already existing in nav toggle.
+ *
+ * @return string
+ */
+ public function add_nav_toggle_attrs( $input ) {
+ $input .= ' on="tap:AMP.setState( { astraAmpMenuExpanded: ! astraAmpMenuExpanded } ),astra-body.toggleClass(class=ast-main-header-nav-open)" ';
+ $input .= ' [class]="\'menu-toggle main-header-menu-toggle ast-mobile-menu-buttons-minimal\' + ( astraAmpMenuExpanded ? \' toggled\' : \'\' )" ';
+ $input .= ' aria-expanded="false" ';
+ $input .= ' [aria-expanded]="astraAmpMenuExpanded ? \'true\' : \'false\'" ';
+
+ return $input;
+ }
+
+ }
+endif;
+
+/**
+* Kicking this off by calling 'get_instance()' method
+*/
+Astra_AMP::get_instance();
diff --git a/inc/compatibility/class-astra-bb-ultimate-addon.php b/inc/compatibility/class-astra-bb-ultimate-addon.php
new file mode 100644
index 0000000..c77b165
--- /dev/null
+++ b/inc/compatibility/class-astra-bb-ultimate-addon.php
@@ -0,0 +1,428 @@
+<?php
+/**
+ * Filters to override defaults in UABB
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.0.0
+ */
+
+// If plugin - 'BB Ultimate Addon' not exist then return.
+if ( ! class_exists( 'BB_Ultimate_Addon' ) ) {
+ return;
+}
+
+/**
+ * Astra BB Ultimate Addon Compatibility
+ */
+if ( ! class_exists( 'Astra_BB_Ultimate_Addon' ) ) :
+
+ /**
+ * Astra BB Ultimate Addon Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_BB_Ultimate_Addon {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+
+ add_filter( 'uabb_global_support', array( $this, 'remove_uabb_global_setting' ) );
+ add_filter( 'uabb_theme_theme_color', array( $this, 'theme_color' ) );
+ add_filter( 'uabb_theme_text_color', array( $this, 'text_color' ) );
+ add_filter( 'uabb_theme_link_color', array( $this, 'link_color' ) );
+ add_filter( 'uabb_theme_link_hover_color', array( $this, 'link_hover_color' ) );
+ add_filter( 'uabb_theme_button_font_family', array( $this, 'button_font_family' ) );
+ add_filter( 'uabb_theme_button_font_size', array( $this, 'button_font_size' ) );
+ add_filter( 'uabb_theme_button_line_height', array( $this, 'button_line_height' ) );
+ add_filter( 'uabb_theme_button_letter_spacing', array( $this, 'button_letter_spacing' ) );
+ add_filter( 'uabb_theme_button_text_transform', array( $this, 'button_text_transform' ) );
+ add_filter( 'uabb_theme_button_text_color', array( $this, 'button_text_color' ) );
+ add_filter( 'uabb_theme_button_text_hover_color', array( $this, 'button_text_hover_color' ) );
+ add_filter( 'uabb_theme_button_bg_color', array( $this, 'button_bg_color' ) );
+ add_filter( 'uabb_theme_button_bg_hover_color', array( $this, 'button_bg_hover_color' ) );
+ add_filter( 'uabb_theme_button_border_radius', array( $this, 'button_border_radius' ) );
+ add_filter( 'uabb_theme_button_padding', array( $this, 'button_padding' ) );
+ add_filter( 'uabb_theme_button_border_width', array( $this, 'button_border_width' ) );
+ add_filter( 'uabb_theme_border_color', array( $this, 'button_border_color' ) );
+ add_filter( 'uabb_theme_border_hover_color', array( $this, 'button_border_hover_color' ) );
+ add_filter( 'uabb_theme_button_vertical_padding', array( $this, 'button_vertical_padding' ) );
+ add_filter( 'uabb_theme_button_horizontal_padding', array( $this, 'button_horizontal_padding' ) );
+
+ /**
+ * Default button type UABB compatibility.
+ */
+ add_filter( 'uabb_theme_default_button_font_size', array( $this, 'default_type_button_font_size' ) );
+ add_filter( 'uabb_theme_default_button_line_height', array( $this, 'default_type_button_line_height' ) );
+ add_filter( 'uabb_theme_default_button_letter_spacing', array( $this, 'default_type_button_letter_spacing' ) );
+ add_filter( 'uabb_theme_default_button_text_transform', array( $this, 'default_type_button_text_transform' ) );
+ add_filter( 'uabb_theme_default_button_text_color', array( $this, 'default_type_button_text_color' ) );
+ add_filter( 'uabb_theme_default_button_text_hover_color', array( $this, 'default_type_button_text_hover_color' ) );
+ add_filter( 'uabb_theme_default_button_bg_color', array( $this, 'default_type_button_bg_color' ) );
+ add_filter( 'uabb_theme_default_button_bg_hover_color', array( $this, 'default_type_button_bg_hover_color' ) );
+ add_filter( 'uabb_theme_default_button_padding', array( $this, 'default_type_button_padding' ) );
+ }
+
+ /**
+ * Remove UABB Global Setting Option
+ */
+ public function remove_uabb_global_setting() {
+ return false;
+ }
+
+ /**
+ * Theme Color
+ */
+ public function theme_color() {
+ return astra_get_option( 'theme-color' );
+ }
+
+
+ /**
+ * Text Color
+ */
+ public function text_color() {
+ return astra_get_option( 'text-color' );
+ }
+
+
+ /**
+ * Link Color
+ */
+ public function link_color() {
+ return astra_get_option( 'link-color' );
+ }
+
+
+ /**
+ * Link Hover Color
+ */
+ public function link_hover_color() {
+ return astra_get_option( 'link-h-color' );
+ }
+
+ /**
+ * Button Font Family
+ */
+ public function button_font_family() {
+ $font_family = str_replace( "'", '', astra_get_option( 'font-family-button' ) );
+ $font_family = explode( ',', $font_family );
+ return array(
+ 'family' => $font_family[0],
+ 'weight' => astra_get_option( 'font-weight-button' ),
+ );
+ }
+
+ /**
+ * Button Font Size
+ */
+ public function button_font_size() {
+ return '';
+ }
+
+ /**
+ * Button Line Height
+ */
+ public function button_line_height() {
+ return '';
+ }
+
+ /**
+ * Default type : Button Font Size
+ *
+ * @since 2.2.0
+ */
+ public function default_type_button_font_size() {
+ $font_size_arr = array();
+ $body_font_size = astra_get_option( 'font-size-body' );
+ $theme_btn_font_size = astra_get_option( 'font-size-button' );
+
+ $font_size_arr['desktop'] = astra_responsive_font( $theme_btn_font_size, 'desktop' );
+ $font_size_arr['tablet'] = astra_responsive_font( $theme_btn_font_size, 'tablet' );
+ $font_size_arr['mobile'] = astra_responsive_font( $theme_btn_font_size, 'mobile' );
+
+ if ( empty( $font_size_arr['desktop'] ) ) {
+ $font_size_arr['desktop'] = astra_responsive_font( $body_font_size, 'desktop' );
+ }
+ if ( empty( $font_size_arr['tablet'] ) ) {
+ $font_size_arr['tablet'] = astra_responsive_font( $body_font_size, 'tablet' );
+ }
+ if ( empty( $font_size_arr['mobile'] ) ) {
+ $font_size_arr['mobile'] = astra_responsive_font( $body_font_size, 'mobile' );
+ }
+
+ return $font_size_arr;
+ }
+
+ /**
+ * Default type : Button Line Height
+ *
+ * @since 2.2.0
+ */
+ public function default_type_button_line_height() {
+ $theme_btn_body_line_height = astra_get_option( 'body-line-height', 1.85714285714286 );
+ $theme_btn_line_height = astra_get_option( 'theme-btn-line-height', $theme_btn_body_line_height );
+ return $theme_btn_line_height;
+ }
+
+ /**
+ * Button Letter Spacing
+ */
+ public function button_letter_spacing() {
+ return '';
+ }
+
+ /**
+ * Default type : Button Letter Spacing
+ *
+ * @since 2.2.0
+ */
+ public function default_type_button_letter_spacing() {
+ $theme_btn_letter_spacing = astra_get_option( 'theme-btn-letter-spacing' );
+ return $theme_btn_letter_spacing;
+ }
+
+ /**
+ * Button Text Transform
+ */
+ public function button_text_transform() {
+ return '';
+ }
+
+ /**
+ * Default type : Button Text Transform
+ *
+ * @since 2.2.0
+ */
+ public function default_type_button_text_transform() {
+ $theme_btn_text_transform = astra_get_option( 'text-transform-button' );
+ return $theme_btn_text_transform;
+ }
+
+ /**
+ * Button Text Color
+ */
+ public function button_text_color() {
+ $theme_color = astra_get_option( 'theme-color' );
+ $link_color = astra_get_option( 'link-color', $theme_color );
+ $color = astra_get_option( 'button-color' );
+ if ( empty( $color ) ) {
+ $color = astra_get_foreground_color( $link_color );
+ }
+ return $color;
+ }
+
+ /**
+ * Default type : Button Text Color
+ *
+ * @since 2.2.0
+ */
+ public function default_type_button_text_color() {
+ $theme_color = astra_get_option( 'theme-color' );
+ $btn_text_color = astra_get_option( 'button-color' );
+ if ( empty( $btn_text_color ) ) {
+ $btn_text_color = astra_get_foreground_color( $theme_color );
+ }
+
+ return $btn_text_color;
+ }
+
+ /**
+ * Button Text Hover Color
+ */
+ public function button_text_hover_color() {
+ $link_hover_color = astra_get_option( 'link-h-color' );
+ $btn_text_hover_color = astra_get_option( 'button-h-color' );
+ if ( empty( $btn_text_hover_color ) ) {
+ $btn_text_hover_color = astra_get_foreground_color( $link_hover_color );
+ }
+
+ return $btn_text_hover_color;
+ }
+
+ /**
+ * Default type : Button Text Hover Color
+ *
+ * @since 2.2.0
+ */
+ public function default_type_button_text_hover_color() {
+ $link_hover_color = astra_get_option( 'link-h-color' );
+ $btn_text_hover_color = astra_get_option( 'button-h-color' );
+ if ( empty( $btn_text_hover_color ) ) {
+ $btn_text_hover_color = astra_get_foreground_color( $link_hover_color );
+ }
+
+ return $btn_text_hover_color;
+ }
+
+ /**
+ * Button Background Color
+ */
+ public function button_bg_color() {
+ return astra_get_option( 'button-bg-color' );
+ }
+
+ /**
+ * Default type : Button Background Color
+ *
+ * @since 2.2.0
+ */
+ public function default_type_button_bg_color() {
+ $theme_color = astra_get_option( 'theme-color' );
+ $btn_bg_color = astra_get_option( 'button-bg-color', $theme_color );
+ return $btn_bg_color;
+ }
+
+ /**
+ * Button Background Color
+ */
+ public function button_bg_hover_color() {
+ return astra_get_option( 'button-bg-h-color' );
+ }
+
+ /**
+ * Default type : Button Background Color
+ *
+ * @since 2.2.0
+ */
+ public function default_type_button_bg_hover_color() {
+ $link_hover_color = astra_get_option( 'link-h-color' );
+ $btn_bg_hover_color = astra_get_option( 'button-bg-h-color', $link_hover_color );
+ return $btn_bg_hover_color;
+ }
+
+ /**
+ * Button Border Radius
+ */
+ public function button_border_radius() {
+ return astra_get_option( 'button-radius' );
+ }
+
+
+ /**
+ * Button Padding
+ */
+ public function button_padding() {
+ $padding = '';
+ $v_padding = astra_get_option( 'button-v-padding' );
+ $h_padding = astra_get_option( 'button-h-padding' );
+ if ( '' != $v_padding && '' != $h_padding ) {
+ $padding = $v_padding . 'px ' . $h_padding . 'px';
+ }
+ return $padding;
+ }
+
+ /**
+ * Default type : Button Padding
+ *
+ * @since 2.2.0
+ */
+ public function default_type_button_padding() {
+
+ $padding = astra_get_option( 'theme-button-padding' );
+
+ return $padding;
+ }
+
+ /**
+ * Button Border Width
+ */
+ public function button_border_width() {
+
+ $btn_width = array();
+ $get_btn_width = astra_get_option( 'theme-button-border-group-border-size' );
+
+ if ( ! empty( $get_btn_width ) ) {
+ $btn_width = $get_btn_width;
+ }
+
+ return $btn_width;
+ }
+
+ /**
+ * Button Border Color
+ */
+ public function button_border_color() {
+
+ $theme_color = astra_get_option( 'theme-color' );
+ $btn_bg_color = astra_get_option( 'button-bg-color', $theme_color );
+ $get_btn_border_color = astra_get_option( 'theme-button-border-group-border-color', $btn_bg_color );
+
+ return $get_btn_border_color;
+ }
+
+ /**
+ * Button Border Hover Color
+ */
+ public function button_border_hover_color() {
+
+ $link_hover_color = astra_get_option( 'link-h-color' );
+ $btn_bg_hover_color = astra_get_option( 'button-bg-h-color', $link_hover_color );
+ $get_btn_border_h_color = astra_get_option( 'theme-button-border-group-border-h-color', $btn_bg_hover_color );
+
+ return $get_btn_border_h_color;
+ }
+
+ /**
+ * Button Vertical Padding.
+ *
+ * @deprecated 2.2.0
+ */
+ public function button_vertical_padding() {
+
+ $padding = '';
+ $v_padding = astra_get_option( 'button-v-padding' );
+
+ if ( '' != $v_padding ) {
+ $padding = $v_padding;
+ }
+
+ return $padding;
+ }
+
+ /**
+ * Button Horizontal Padding.
+ *
+ * @deprecated 2.2.0
+ */
+ public function button_horizontal_padding() {
+
+ $padding = '';
+ $h_padding = astra_get_option( 'button-h-padding' );
+
+ if ( '' != $h_padding ) {
+ $padding = $h_padding;
+ }
+
+ return $padding;
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_BB_Ultimate_Addon::get_instance();
diff --git a/inc/compatibility/class-astra-beaver-builder.php b/inc/compatibility/class-astra-beaver-builder.php
new file mode 100644
index 0000000..c372683
--- /dev/null
+++ b/inc/compatibility/class-astra-beaver-builder.php
@@ -0,0 +1,113 @@
+<?php
+/**
+ * Beaver Builder Compatibility File.
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Builder Builder' not exist then return.
+if ( ! class_exists( 'FLBuilderModel' ) ) {
+ return;
+}
+
+/**
+ * Astra Beaver Builder Compatibility
+ */
+if ( ! class_exists( 'Astra_Beaver_Builder' ) ) :
+
+ /**
+ * Astra Beaver Builder Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_Beaver_Builder {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_action( 'wp', array( $this, 'beaver_builder_default_setting' ), 20 );
+ add_action( 'do_meta_boxes', array( $this, 'beaver_builder_default_setting' ), 20 );
+ add_filter( 'astra_theme_assets', array( $this, 'add_styles' ) );
+ }
+
+ /**
+ * Builder Template Content layout set as Full Width / Stretched
+ *
+ * @since 1.0.13
+ * @return void
+ */
+ public function beaver_builder_default_setting() {
+
+ if ( false === astra_enable_page_builder_compatibility() || 'post' == get_post_type() ) {
+ return;
+ }
+
+ global $post;
+ $id = astra_get_post_id();
+
+ $do_render = apply_filters( 'fl_builder_do_render_content', true, FLBuilderModel::get_post_id() );
+
+ $page_builder_flag = get_post_meta( $id, '_astra_content_layout_flag', true );
+ if ( isset( $post ) && empty( $page_builder_flag ) && ( is_admin() || is_singular() ) ) {
+
+ if ( empty( $post->post_content ) && $do_render && FLBuilderModel::is_builder_enabled() ) {
+
+ update_post_meta( $id, '_astra_content_layout_flag', 'disabled' );
+ update_post_meta( $id, 'site-post-title', 'disabled' );
+ update_post_meta( $id, 'ast-title-bar-display', 'disabled' );
+ update_post_meta( $id, 'ast-featured-img', 'disabled' );
+
+ $content_layout = get_post_meta( $id, 'site-content-layout', true );
+ if ( empty( $content_layout ) || 'default' == $content_layout ) {
+ update_post_meta( $id, 'site-content-layout', 'page-builder' );
+ }
+
+ $sidebar_layout = get_post_meta( $id, 'site-sidebar-layout', true );
+ if ( empty( $sidebar_layout ) || 'default' == $sidebar_layout ) {
+ update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' );
+ }
+ }
+ }
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @param array $assets list of theme assets (JS & CSS).
+ * @return array List of updated assets.
+ * @since 3.5.0
+ */
+ public function add_styles( $assets ) {
+
+ if ( ! empty( $assets['css'] ) ) {
+ $assets['css'] = array( 'astra-bb-builder' => 'compatibility/page-builder/bb-plugin' ) + $assets['css'];
+ }
+ return $assets;
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Beaver_Builder::get_instance();
diff --git a/inc/compatibility/class-astra-beaver-themer.php b/inc/compatibility/class-astra-beaver-themer.php
new file mode 100644
index 0000000..7be43a9
--- /dev/null
+++ b/inc/compatibility/class-astra-beaver-themer.php
@@ -0,0 +1,410 @@
+<?php
+/**
+ * Beaver Themer Compatibility File.
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Beaver Themer' not exist then return.
+if ( ! class_exists( 'FLThemeBuilderLoader' ) || ! class_exists( 'FLThemeBuilderLayoutData' ) ) {
+ return;
+}
+
+/**
+ * Astra Beaver Themer Compatibility
+ */
+if ( ! class_exists( 'Astra_Beaver_Themer' ) ) :
+
+ /**
+ * Astra Beaver Themer Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_Beaver_Themer {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_action( 'after_setup_theme', array( $this, 'header_footer_support' ) );
+ add_action( 'wp', array( $this, 'theme_header_footer_render' ) );
+ add_filter( 'fl_theme_builder_part_hooks', array( $this, 'register_part_hooks' ) );
+ add_filter( 'post_class', array( $this, 'render_post_class' ), 99 );
+ add_action( 'fl_theme_builder_before_render_content', array( $this, 'builder_before_render_content' ), 10, 1 );
+ add_action( 'fl_theme_builder_after_render_content', array( $this, 'builder_after_render_content' ), 10, 1 );
+ }
+
+ /**
+ * Builder Template Content layout set as Full Width / Stretched
+ *
+ * @param string $layout Content Layout.
+ * @return string
+ * @since 1.0.2
+ */
+ public function builder_template_content_layout( $layout ) {
+
+ $ids = FLThemeBuilderLayoutData::get_current_page_content_ids();
+ $post_type = get_post_type();
+
+ if ( 'fl-theme-layout' == $post_type ) {
+ remove_action( 'astra_entry_after', 'astra_single_post_navigation_markup' );
+ }
+
+ if ( empty( $ids ) && 'fl-theme-layout' != $post_type ) {
+ return $layout;
+ }
+
+ return 'page-builder';
+ }
+
+ /**
+ * Remove theme post's default classes
+ *
+ * @param array $classes Post Classes.
+ * @return array
+ * @since 1.0.2
+ */
+ public function render_post_class( $classes ) {
+
+ $post_class = array( 'fl-post-grid-post', 'fl-post-gallery-post', 'fl-post-feed-post' );
+ $result = array_intersect( $classes, $post_class );
+
+ if ( count( $result ) > 0 ) {
+ $classes = array_diff(
+ $classes,
+ array(
+ // Astra common grid.
+ 'ast-col-xs-1',
+ 'ast-col-xs-2',
+ 'ast-col-xs-3',
+ 'ast-col-xs-4',
+ 'ast-col-xs-5',
+ 'ast-col-xs-6',
+ 'ast-col-xs-7',
+ 'ast-col-xs-8',
+ 'ast-col-xs-9',
+ 'ast-col-xs-10',
+ 'ast-col-xs-11',
+ 'ast-col-xs-12',
+ 'ast-col-sm-1',
+ 'ast-col-sm-2',
+ 'ast-col-sm-3',
+ 'ast-col-sm-4',
+ 'ast-col-sm-5',
+ 'ast-col-sm-6',
+ 'ast-col-sm-7',
+ 'ast-col-sm-8',
+ 'ast-col-sm-9',
+ 'ast-col-sm-10',
+ 'ast-col-sm-11',
+ 'ast-col-sm-12',
+ 'ast-col-md-1',
+ 'ast-col-md-2',
+ 'ast-col-md-3',
+ 'ast-col-md-4',
+ 'ast-col-md-5',
+ 'ast-col-md-6',
+ 'ast-col-md-7',
+ 'ast-col-md-8',
+ 'ast-col-md-9',
+ 'ast-col-md-10',
+ 'ast-col-md-11',
+ 'ast-col-md-12',
+ 'ast-col-lg-1',
+ 'ast-col-lg-2',
+ 'ast-col-lg-3',
+ 'ast-col-lg-4',
+ 'ast-col-lg-5',
+ 'ast-col-lg-6',
+ 'ast-col-lg-7',
+ 'ast-col-lg-8',
+ 'ast-col-lg-9',
+ 'ast-col-lg-10',
+ 'ast-col-lg-11',
+ 'ast-col-lg-12',
+ 'ast-col-xl-1',
+ 'ast-col-xl-2',
+ 'ast-col-xl-3',
+ 'ast-col-xl-4',
+ 'ast-col-xl-5',
+ 'ast-col-xl-6',
+ 'ast-col-xl-7',
+ 'ast-col-xl-8',
+ 'ast-col-xl-9',
+ 'ast-col-xl-10',
+ 'ast-col-xl-11',
+ 'ast-col-xl-12',
+
+ // Astra Blog / Single Post.
+ 'ast-article-post',
+ 'ast-article-single',
+ 'ast-separate-posts',
+ 'remove-featured-img-padding',
+ 'ast-featured-post',
+
+ // Astra Woocommerce.
+ 'ast-product-gallery-layout-vertical',
+ 'ast-product-gallery-layout-horizontal',
+ 'ast-product-gallery-with-no-image',
+
+ 'ast-product-tabs-layout-vertical',
+ 'ast-product-tabs-layout-horizontal',
+
+ 'ast-qv-disabled',
+ 'ast-qv-on-image',
+ 'ast-qv-on-image-click',
+ 'ast-qv-after-summary',
+
+ 'astra-woo-hover-swap',
+
+ 'box-shadow-0',
+ 'box-shadow-0-hover',
+ 'box-shadow-1',
+ 'box-shadow-1-hover',
+ 'box-shadow-2',
+ 'box-shadow-2-hover',
+ 'box-shadow-3',
+ 'box-shadow-3-hover',
+ 'box-shadow-4',
+ 'box-shadow-4-hover',
+ 'box-shadow-5',
+ 'box-shadow-5-hover',
+ )
+ );
+
+ add_filter( 'astra_post_link_enabled', '__return_false' );
+ }
+
+ return $classes;
+ }
+
+ /**
+ * Function to add Theme Support
+ *
+ * @since 1.0.0
+ */
+ public function header_footer_support() {
+
+ add_theme_support( 'fl-theme-builder-headers' );
+ add_theme_support( 'fl-theme-builder-footers' );
+ add_theme_support( 'fl-theme-builder-parts' );
+ }
+
+ /**
+ * Function to update Atra header/footer with Beaver template
+ *
+ * @since 1.0.0
+ */
+ public function theme_header_footer_render() {
+
+ // Get the header ID.
+ $header_ids = FLThemeBuilderLayoutData::get_current_page_header_ids();
+
+ // If we have a header, remove the theme header and hook in Theme Builder's.
+ if ( ! empty( $header_ids ) ) {
+ remove_action( 'astra_header', 'astra_header_markup' );
+ add_action( 'astra_header', 'FLThemeBuilderLayoutRenderer::render_header' );
+ }
+
+ // Get the footer ID.
+ $footer_ids = FLThemeBuilderLayoutData::get_current_page_footer_ids();
+
+ // If we have a footer, remove the theme footer and hook in Theme Builder's.
+ if ( ! empty( $footer_ids ) ) {
+ remove_action( 'astra_footer', 'astra_footer_markup' );
+ add_action( 'astra_footer', 'FLThemeBuilderLayoutRenderer::render_footer' );
+ }
+
+ // BB Themer Support.
+ $template_ids = FLThemeBuilderLayoutData::get_current_page_content_ids();
+
+ if ( ! empty( $template_ids ) ) {
+
+ $template_id = $template_ids[0];
+ $template_type = get_post_meta( $template_id, '_fl_theme_layout_type', true );
+
+ if ( 'archive' === $template_type || 'singular' === $template_type || '404' === $template_type ) {
+
+ $sidebar = get_post_meta( $template_id, 'site-sidebar-layout', true );
+
+ if ( 'default' !== $sidebar ) {
+ add_filter(
+ 'astra_page_layout',
+ function( $page_layout ) use ( $sidebar ) { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found
+
+ return $sidebar;
+ }
+ );
+ }
+
+ $content_layout = get_post_meta( $template_id, 'site-content-layout', true );
+ if ( 'default' !== $content_layout ) {
+ add_filter(
+ 'astra_get_content_layout',
+ function( $layout ) use ( $content_layout ) {// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found
+
+ return $content_layout;
+ }
+ );
+ }
+
+ $main_header_display = get_post_meta( $template_id, 'ast-main-header-display', true );
+ if ( 'disabled' === $main_header_display ) {
+
+ if ( 'archive' === $template_type ) {
+ remove_action( 'astra_masthead', 'astra_masthead_primary_template' );
+ } else {
+ add_filter(
+ 'ast_main_header_display',
+ function( $display_header ) {// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found
+
+ return 'disabled';
+ }
+ );
+ }
+ }
+
+ $footer_layout = get_post_meta( $template_id, 'footer-sml-layout', true );
+ if ( 'disabled' === $footer_layout ) {
+
+ add_filter(
+ 'ast_footer_sml_layout',
+ function( $is_footer ) {// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found
+
+ return 'disabled';
+ }
+ );
+ }
+
+ // Override! Footer Widgets.
+ $footer_widgets = get_post_meta( $template_id, 'footer-adv-display', true );
+ if ( 'disabled' === $footer_widgets ) {
+ add_filter( 'astra_advanced_footer_disable', '__return_true' );
+ }
+ }
+ }
+ }
+
+ /**
+ * Function to Astra theme parts
+ *
+ * @since 1.0.0
+ */
+ public function register_part_hooks() {
+
+ return array(
+ array(
+ 'label' => 'Page',
+ 'hooks' => array(
+ 'astra_body_top' => __( 'Before Page', 'astra' ),
+ 'astra_body_bottom' => __( 'After Page', 'astra' ),
+ ),
+ ),
+ array(
+ 'label' => 'Header',
+ 'hooks' => array(
+ 'astra_header_before' => __( 'Before Header', 'astra' ),
+ 'astra_header_after' => __( 'After Header', 'astra' ),
+ ),
+ ),
+ array(
+ 'label' => 'Content',
+ 'hooks' => array(
+ 'astra_primary_content_top' => __( 'Before Content', 'astra' ),
+ 'astra_primary_content_bottom' => __( 'After Content', 'astra' ),
+ ),
+ ),
+ array(
+ 'label' => 'Footer',
+ 'hooks' => array(
+ 'astra_footer_before' => __( 'Before Footer', 'astra' ),
+ 'astra_footer_after' => __( 'After Footer', 'astra' ),
+ ),
+ ),
+ array(
+ 'label' => 'Sidebar',
+ 'hooks' => array(
+ 'astra_sidebars_before' => __( 'Before Sidebar', 'astra' ),
+ 'astra_sidebars_after' => __( 'After Sidebar', 'astra' ),
+ ),
+ ),
+ array(
+ 'label' => 'Posts',
+ 'hooks' => array(
+ 'loop_start' => __( 'Loop Start', 'astra' ),
+ 'astra_entry_top' => __( 'Before Post', 'astra' ),
+ 'astra_entry_content_before' => __( 'Before Post Content', 'astra' ),
+ 'astra_entry_content_after' => __( 'After Post Content', 'astra' ),
+ 'astra_entry_bottom' => __( 'After Post', 'astra' ),
+ 'astra_comments_before' => __( 'Before Comments', 'astra' ),
+ 'astra_comments_after' => __( 'After Comments', 'astra' ),
+ 'loop_end' => __( 'Loop End', 'astra' ),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * Function to theme before render content
+ *
+ * @param int $post_id Post ID.
+ * @since 1.0.28
+ */
+ public function builder_before_render_content( $post_id ) {
+
+ ?>
+ <?php if ( 'left-sidebar' === astra_page_layout() ) : ?>
+
+ <?php get_sidebar(); ?>
+
+ <?php endif ?>
+
+ <div id="primary" <?php astra_primary_class(); ?>>
+ <?php
+ }
+
+ /**
+ * Function to theme after render content
+ *
+ * @param int $post_id Post ID.
+ * @since 1.0.28
+ */
+ public function builder_after_render_content( $post_id ) {
+
+ ?>
+ </div><!-- #primary -->
+
+ <?php if ( 'right-sidebar' === astra_page_layout() ) : ?>
+
+ <?php get_sidebar(); ?>
+
+ <?php endif ?>
+
+ <?php
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Beaver_Themer::get_instance();
diff --git a/inc/compatibility/class-astra-bne-flyout.php b/inc/compatibility/class-astra-bne-flyout.php
new file mode 100644
index 0000000..9e40504
--- /dev/null
+++ b/inc/compatibility/class-astra-bne-flyout.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * BNE Flyout Compatibility File.
+ *
+ * @package Astra
+ */
+
+// If plugin - 'BNE Flyout' not exist then return.
+if ( ! defined( 'BNE_FLYOUT_VERSION' ) ) {
+ return;
+}
+
+/**
+ * Astra BNE Flyout Compatibility
+ */
+if ( ! class_exists( 'Astra_BNE_Flyout' ) ) :
+
+ /**
+ * Astra BNE Flyout Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_BNE_Flyout {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_filter( 'astra_theme_assets', array( $this, 'add_styles' ) );
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @param array $assets list of theme assets (JS & CSS).
+ * @return array List of updated assets.
+ * @since 1.0.0
+ */
+ public function add_styles( $assets ) {
+ $assets['css']['astra-bne-flyout'] = 'compatibility/bne-flyout';
+ return $assets;
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_BNE_Flyout::get_instance();
diff --git a/inc/compatibility/class-astra-contact-form-7.php b/inc/compatibility/class-astra-contact-form-7.php
new file mode 100644
index 0000000..9191235
--- /dev/null
+++ b/inc/compatibility/class-astra-contact-form-7.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Contact Form 7 Compatibility File.
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Contact Form 7' not exist then return.
+if ( ! class_exists( 'WPCF7' ) ) {
+ return;
+}
+
+/**
+ * Astra Contact Form 7 Compatibility
+ */
+if ( ! class_exists( 'Astra_Contact_Form_7' ) ) :
+
+ /**
+ * Astra Contact Form 7 Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_Contact_Form_7 {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_action( 'wpcf7_enqueue_styles', array( $this, 'add_styles' ) );
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @since 1.0.0
+ */
+ public function add_styles() {
+ $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
+ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
+
+ if ( is_rtl() ) {
+ $file_prefix .= '-rtl';
+ }
+
+ $css_file = ASTRA_THEME_URI . 'assets/css/' . $dir_name . '/compatibility/contact-form-7-main' . $file_prefix . '.css';
+
+ wp_enqueue_style( 'astra-contact-form-7', $css_file, array(), ASTRA_THEME_VERSION, 'all' );
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Contact_Form_7::get_instance();
diff --git a/inc/compatibility/class-astra-divi-builder.php b/inc/compatibility/class-astra-divi-builder.php
new file mode 100644
index 0000000..5f0192d
--- /dev/null
+++ b/inc/compatibility/class-astra-divi-builder.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Divi Builder File.
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Divi Builder' not exist then return.
+if ( ! class_exists( 'ET_Builder_Plugin' ) ) {
+ return;
+}
+
+/**
+ * Astra Divi Builder
+ */
+if ( ! class_exists( 'Astra_Divi_Builder' ) ) :
+
+ /**
+ * Astra Divi Builder
+ *
+ * @since 1.4.0
+ */
+ class Astra_Divi_Builder {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_filter( 'astra_theme_assets', array( $this, 'add_styles' ) );
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @param array $assets list of theme assets (JS & CSS).
+ * @return array List of updated assets.
+ * @since 1.4.0
+ */
+ public function add_styles( $assets ) {
+ $assets['css']['astra-divi-builder'] = 'compatibility/divi-builder';
+ return $assets;
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Divi_Builder::get_instance();
diff --git a/inc/compatibility/class-astra-elementor-pro.php b/inc/compatibility/class-astra-elementor-pro.php
new file mode 100644
index 0000000..9233446
--- /dev/null
+++ b/inc/compatibility/class-astra-elementor-pro.php
@@ -0,0 +1,424 @@
+<?php
+/**
+ * Elementor Compatibility File.
+ *
+ * @package Astra
+ */
+
+namespace Elementor; // phpcs:ignore PHPCompatibility.Keywords.NewKeywords.t_namespaceFound
+
+// If plugin - 'Elementor' not exist then return.
+if ( ! class_exists( '\Elementor\Plugin' ) || ! class_exists( 'ElementorPro\Modules\ThemeBuilder\Module' ) ) {
+ return;
+}
+
+namespace ElementorPro\Modules\ThemeBuilder\ThemeSupport; // phpcs:ignore PHPCompatibility.Keywords.NewKeywords.t_namespaceFound, PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
+
+// @codingStandardsIgnoreStart PHPCompatibility.Keywords.NewKeywords.t_useFound
+use Elementor\TemplateLibrary\Source_Local;
+use ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager;
+use ElementorPro\Modules\ThemeBuilder\Module;
+// @codingStandardsIgnoreEnd PHPCompatibility.Keywords.NewKeywords.t_useFound
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Astra Elementor Compatibility
+ */
+if ( ! class_exists( 'Astra_Elementor_Pro' ) ) :
+
+ /**
+ * Astra Elementor Compatibility
+ *
+ * @since 1.2.7
+ */
+ class Astra_Elementor_Pro {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ *
+ * @since 1.2.7
+ * @return object Class object.
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ *
+ * @since 1.2.7
+ */
+ public function __construct() {
+ // Add locations.
+ add_action( 'elementor/theme/register_locations', array( $this, 'register_locations' ) );
+
+ // Override theme templates.
+ add_action( 'astra_header', array( $this, 'do_header' ), 0 );
+ add_action( 'astra_footer', array( $this, 'do_footer' ), 0 );
+ add_action( 'astra_template_parts_content_top', array( $this, 'do_template_parts' ), 0 );
+
+ add_action( 'astra_entry_content_404_page', array( $this, 'do_template_part_404' ), 0 );
+
+ add_filter( 'post_class', array( $this, 'render_post_class' ), 99 );
+ // Override post meta.
+ add_action( 'wp', array( $this, 'override_meta' ), 0 );
+ }
+
+ /**
+ * Register Locations
+ *
+ * @since 1.2.7
+ * @param object $manager Location manager.
+ * @return void
+ */
+ public function register_locations( $manager ) {
+ $manager->register_all_core_location();
+ }
+
+ /**
+ * Template Parts Support
+ *
+ * @since 1.2.7
+ * @return void
+ */
+ public function do_template_parts() {
+ // Is Archive?
+ $did_location = Module::instance()->get_locations_manager()->do_location( 'archive' );
+ if ( $did_location ) {
+ // Search and default.
+ remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_search' ) );// phpcs:ignore PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
+ remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_default' ) );// phpcs:ignore PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
+
+ // Remove pagination.
+ remove_action( 'astra_pagination', 'astra_number_pagination' );
+ remove_action( 'astra_entry_after', 'astra_single_post_navigation_markup' );
+
+ // Content.
+ remove_action( 'astra_entry_content_single', 'astra_entry_content_single_template' );
+ }
+
+ // IS Single?
+ $did_location = Module::instance()->get_locations_manager()->do_location( 'single' );
+ if ( $did_location ) {
+
+ // @codingStandardsIgnoreStart PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
+ remove_action( 'astra_page_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_page' ) );
+ remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_post' ) );
+ remove_action( 'astra_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_comments' ), 15 );
+ remove_action( 'astra_page_template_parts_content', array( \Astra_Loop::get_instance(), 'template_parts_comments' ), 15 );
+ // @codingStandardsIgnoreEnd PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
+ }
+ }
+
+ /**
+ * Override 404 page
+ *
+ * @since 1.2.7
+ * @return void
+ */
+ public function do_template_part_404() {
+ if ( is_404() ) {
+
+ // Is Single?
+ $did_location = Module::instance()->get_locations_manager()->do_location( 'single' );
+ if ( $did_location ) {
+ remove_action( 'astra_entry_content_404_page', 'astra_entry_content_404_page_template' );
+ }
+ }
+ }
+
+ /**
+ * Override sidebar, title etc with post meta
+ *
+ * @since 1.2.7
+ * @return void
+ */
+ public function override_meta() {
+
+ // don't override meta for `elementor_library` post type.
+ if ( 'elementor_library' == get_post_type() ) {
+ return;
+ }
+
+ // Override post meta for single pages.
+ $documents_single = Module::instance()->get_conditions_manager()->get_documents_for_location( 'single' );
+ if ( $documents_single ) {
+ foreach ( $documents_single as $document ) {
+ $this->override_with_post_meta( $document->get_post()->ID );
+ }
+ }
+
+ // Override post meta for archive pages.
+ $documents_archive = Module::instance()->get_conditions_manager()->get_documents_for_location( 'archive' );
+ if ( $documents_archive ) {
+ foreach ( $documents_archive as $document ) {
+ $this->override_with_post_meta( $document->get_post()->ID );
+ }
+ }
+ }
+
+ /**
+ * Override sidebar, title etc with post meta
+ *
+ * @since 1.2.7
+ * @param integer $post_id Post ID.
+ * @return void
+ */
+ public function override_with_post_meta( $post_id = 0 ) {
+ // Override! Page Title.
+ $title = get_post_meta( $post_id, 'site-post-title', true );
+ if ( 'disabled' === $title ) {
+
+ // Archive page.
+ add_filter( 'astra_the_title_enabled', '__return_false', 99 );
+
+ // Single page.
+ add_filter( 'astra_the_title_enabled', '__return_false' );
+ remove_action( 'astra_archive_header', 'astra_archive_page_info' );
+ }
+
+ // Override! Sidebar.
+ $sidebar = get_post_meta( $post_id, 'site-sidebar-layout', true );
+ if ( '' === $sidebar ) {
+ $sidebar = 'default';
+ }
+
+ // @codingStandardsIgnoreStart PHPCompatibility.FunctionDeclarations.NewClosure.Found
+
+ if ( 'default' !== $sidebar ) {
+ add_filter(
+ 'astra_page_layout',
+ function( $page_layout ) use ( $sidebar ) {
+ return $sidebar;
+ }
+ );
+ }
+
+ // Override! Content Layout.
+ $content_layout = get_post_meta( $post_id, 'site-content-layout', true );
+ if ( '' === $content_layout ) {
+ $content_layout = 'default';
+ }
+
+ if ( 'default' !== $content_layout ) {
+ add_filter(
+ 'astra_get_content_layout',
+ function( $layout ) use ( $content_layout ) {
+ return $content_layout;
+ }
+ );
+ }
+
+ // Override! Footer Bar.
+ $footer_layout = get_post_meta( $post_id, 'footer-sml-layout', true );
+ if ( '' === $footer_layout ) {
+ $footer_layout = 'default';
+ }
+
+ if ( 'disabled' === $footer_layout ) {
+ add_filter(
+ 'ast_footer_sml_layout',
+ function( $is_footer ) {
+ return 'disabled';
+ }
+ );
+ }
+
+ // Override! Footer Widgets.
+ $footer_widgets = get_post_meta( $post_id, 'footer-adv-display', true );
+ if ( '' === $footer_widgets ) {
+ $footer_widgets = 'default';
+ }
+
+ if ( 'disabled' === $footer_widgets ) {
+ add_filter(
+ 'astra_advanced_footer_disable',
+ function() {
+ return true;
+ }
+ );
+ }
+
+ // Override! Header.
+ $main_header_display = get_post_meta( $post_id, 'ast-main-header-display', true );
+ if ( '' === $main_header_display ) {
+ $main_header_display = 'default';
+ }
+
+ if ( 'disabled' === $main_header_display ) {
+ remove_action( 'astra_masthead', 'astra_masthead_primary_template' );
+ add_filter(
+ 'ast_main_header_display',
+ function( $display_header ) {
+ return 'disabled';
+ }
+ );
+ }
+ // @codingStandardsIgnoreEnd PHPCompatibility.FunctionDeclarations.NewClosure.Found
+ }
+
+ /**
+ * Header Support
+ *
+ * @since 1.2.7
+ * @return void
+ */
+ public function do_header() {
+ $did_location = Module::instance()->get_locations_manager()->do_location( 'header' );
+ if ( $did_location ) {
+ remove_action( 'astra_header', 'astra_header_markup' );
+ }
+ }
+
+ /**
+ * Footer Support
+ *
+ * @since 1.2.7
+ * @return void
+ */
+ public function do_footer() {
+ $did_location = Module::instance()->get_locations_manager()->do_location( 'footer' );
+ if ( $did_location ) {
+ remove_action( 'astra_footer', 'astra_footer_markup' );
+ }
+ }
+
+ /**
+ * Remove theme post's default classes when Elementor's template builder is activated.
+ *
+ * @param array $classes Post Classes.
+ * @return array
+ * @since 1.4.9
+ */
+ public function render_post_class( $classes ) {
+ $post_class = array( 'elementor-post elementor-grid-item', 'elementor-portfolio-item' );
+ $result = array_intersect( $classes, $post_class );
+
+ if ( count( $result ) > 0 ) {
+ $classes = array_diff(
+ $classes,
+ array(
+ // Astra common grid.
+ 'ast-col-xs-1',
+ 'ast-col-xs-2',
+ 'ast-col-xs-3',
+ 'ast-col-xs-4',
+ 'ast-col-xs-5',
+ 'ast-col-xs-6',
+ 'ast-col-xs-7',
+ 'ast-col-xs-8',
+ 'ast-col-xs-9',
+ 'ast-col-xs-10',
+ 'ast-col-xs-11',
+ 'ast-col-xs-12',
+ 'ast-col-sm-1',
+ 'ast-col-sm-2',
+ 'ast-col-sm-3',
+ 'ast-col-sm-4',
+ 'ast-col-sm-5',
+ 'ast-col-sm-6',
+ 'ast-col-sm-7',
+ 'ast-col-sm-8',
+ 'ast-col-sm-9',
+ 'ast-col-sm-10',
+ 'ast-col-sm-11',
+ 'ast-col-sm-12',
+ 'ast-col-md-1',
+ 'ast-col-md-2',
+ 'ast-col-md-3',
+ 'ast-col-md-4',
+ 'ast-col-md-5',
+ 'ast-col-md-6',
+ 'ast-col-md-7',
+ 'ast-col-md-8',
+ 'ast-col-md-9',
+ 'ast-col-md-10',
+ 'ast-col-md-11',
+ 'ast-col-md-12',
+ 'ast-col-lg-1',
+ 'ast-col-lg-2',
+ 'ast-col-lg-3',
+ 'ast-col-lg-4',
+ 'ast-col-lg-5',
+ 'ast-col-lg-6',
+ 'ast-col-lg-7',
+ 'ast-col-lg-8',
+ 'ast-col-lg-9',
+ 'ast-col-lg-10',
+ 'ast-col-lg-11',
+ 'ast-col-lg-12',
+ 'ast-col-xl-1',
+ 'ast-col-xl-2',
+ 'ast-col-xl-3',
+ 'ast-col-xl-4',
+ 'ast-col-xl-5',
+ 'ast-col-xl-6',
+ 'ast-col-xl-7',
+ 'ast-col-xl-8',
+ 'ast-col-xl-9',
+ 'ast-col-xl-10',
+ 'ast-col-xl-11',
+ 'ast-col-xl-12',
+
+ // Astra Blog / Single Post.
+ 'ast-article-post',
+ 'ast-article-single',
+ 'ast-separate-posts',
+ 'remove-featured-img-padding',
+ 'ast-featured-post',
+
+ // Astra Woocommerce.
+ 'ast-product-gallery-layout-vertical',
+ 'ast-product-gallery-layout-horizontal',
+ 'ast-product-gallery-with-no-image',
+
+ 'ast-product-tabs-layout-vertical',
+ 'ast-product-tabs-layout-horizontal',
+
+ 'ast-qv-disabled',
+ 'ast-qv-on-image',
+ 'ast-qv-on-image-click',
+ 'ast-qv-after-summary',
+
+ 'astra-woo-hover-swap',
+
+ 'box-shadow-0',
+ 'box-shadow-0-hover',
+ 'box-shadow-1',
+ 'box-shadow-1-hover',
+ 'box-shadow-2',
+ 'box-shadow-2-hover',
+ 'box-shadow-3',
+ 'box-shadow-3-hover',
+ 'box-shadow-4',
+ 'box-shadow-4-hover',
+ 'box-shadow-5',
+ 'box-shadow-5-hover',
+ )
+ );
+ }
+
+ return $classes;
+ }
+
+ }
+
+ /**
+ * Kicking this off by calling 'get_instance()' method
+ */
+ Astra_Elementor_Pro::get_instance();
+
+endif;
diff --git a/inc/compatibility/class-astra-elementor.php b/inc/compatibility/class-astra-elementor.php
new file mode 100644
index 0000000..9008865
--- /dev/null
+++ b/inc/compatibility/class-astra-elementor.php
@@ -0,0 +1,254 @@
+<?php
+/**
+ * Elementor Compatibility File.
+ *
+ * @package Astra
+ */
+
+namespace Elementor;// phpcs:ignore PHPCompatibility.Keywords.NewKeywords.t_namespaceFound
+
+// If plugin - 'Elementor' not exist then return.
+if ( ! class_exists( '\Elementor\Plugin' ) ) {
+ return;
+}
+
+/**
+ * Astra Elementor Compatibility
+ */
+if ( ! class_exists( 'Astra_Elementor' ) ) :
+
+ /**
+ * Astra Elementor Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_Elementor {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_action( 'wp', array( $this, 'elementor_default_setting' ), 20 );
+ add_action( 'elementor/preview/init', array( $this, 'elementor_default_setting' ) );
+ add_action( 'elementor/preview/enqueue_styles', array( $this, 'elementor_overlay_zindex' ) );
+
+ /**
+ * Compatibility for Elementor Headings after Elementor-v2.9.9.
+ *
+ * @since 2.4.5
+ */
+ add_filter( 'astra_dynamic_theme_css', array( $this, 'enqueue_elementor_compatibility_styles' ) );
+ }
+
+ /**
+ * Compatibility CSS for Elementor Headings after Elementor-v2.9.9
+ *
+ * In v2.9.9 Elementor has removed [ .elementor-widget-heading .elementor-heading-title { margin: 0 } ] this CSS.
+ * Again in v2.9.10 Elementor added this as .elementor-heading-title { margin: 0 } but still our [ .entry-content heading { margin-bottom: 20px } ] CSS overrding their fix.
+ *
+ * That's why adding this CSS fix to headings by setting bottom-margin to 0.
+ *
+ * @param string $dynamic_css Astra Dynamic CSS.
+ * @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
+ * @return string $dynamic_css Generated CSS.
+ *
+ * @since 2.4.5
+ */
+ public function enqueue_elementor_compatibility_styles( $dynamic_css, $dynamic_css_filtered = '' ) {
+
+ global $post;
+ $id = astra_get_post_id();
+
+ if ( $this->is_elementor_activated( $id ) ) {
+
+ $elementor_heading_margin_comp = array(
+ '.elementor-widget-heading .elementor-heading-title' => array(
+ 'margin' => '0',
+ ),
+ );
+
+ /* Parse CSS from array() */
+ $parse_css = astra_parse_css( $elementor_heading_margin_comp );
+
+ $elementor_base_css = array(
+ '.elementor-post.elementor-grid-item.hentry' => array(
+ 'margin-bottom' => '0',
+ ),
+ '.woocommerce div.product .elementor-element.elementor-products-grid .related.products ul.products li.product, .elementor-element .elementor-wc-products .woocommerce[class*=\'columns-\'] ul.products li.product' => array(
+ 'width' => 'auto',
+ 'margin' => '0',
+ 'float' => 'none',
+ ),
+ );
+ // Load base static CSS when Elmentor is activated.
+ $parse_css .= astra_parse_css( $elementor_base_css );
+
+ if ( is_rtl() ) {
+ $elementor_rtl_support_css = array(
+ '.ast-left-sidebar .elementor-section.elementor-section-stretched,.ast-right-sidebar .elementor-section.elementor-section-stretched' => array(
+ 'max-width' => '100%',
+ 'right' => '0 !important',
+ ),
+ );
+ } else {
+ $elementor_rtl_support_css = array(
+ '.ast-left-sidebar .elementor-section.elementor-section-stretched,.ast-right-sidebar .elementor-section.elementor-section-stretched' => array(
+ 'max-width' => '100%',
+ 'left' => '0 !important',
+ ),
+ );
+ }
+ $parse_css .= astra_parse_css( $elementor_rtl_support_css );
+
+
+ $dynamic_css .= $parse_css;
+ }
+
+ $elementor_archive_page_css = array(
+ '.elementor-template-full-width .ast-container' => array(
+ 'display' => 'block',
+ ),
+ );
+ $dynamic_css .= astra_parse_css( $elementor_archive_page_css );
+
+ return $dynamic_css;
+ }
+
+ /**
+ * Elementor Content layout set as Page Builder
+ *
+ * @return void
+ * @since 1.0.2
+ */
+ public function elementor_default_setting() {
+
+ if ( false === astra_enable_page_builder_compatibility() || 'post' == get_post_type() ) {
+ return;
+ }
+
+ // don't modify post meta settings if we are not on Elementor's edit page.
+ if ( ! $this->is_elementor_editor() ) {
+ return;
+ }
+
+ global $post;
+ $id = astra_get_post_id();
+
+ $page_builder_flag = get_post_meta( $id, '_astra_content_layout_flag', true );
+ if ( isset( $post ) && empty( $page_builder_flag ) && ( is_admin() || is_singular() ) ) {
+
+ if ( empty( $post->post_content ) && $this->is_elementor_activated( $id ) ) {
+
+ update_post_meta( $id, '_astra_content_layout_flag', 'disabled' );
+ update_post_meta( $id, 'site-post-title', 'disabled' );
+ update_post_meta( $id, 'ast-title-bar-display', 'disabled' );
+ update_post_meta( $id, 'ast-featured-img', 'disabled' );
+
+ $content_layout = get_post_meta( $id, 'site-content-layout', true );
+ if ( empty( $content_layout ) || 'default' == $content_layout ) {
+ update_post_meta( $id, 'site-content-layout', 'page-builder' );
+ }
+
+ $sidebar_layout = get_post_meta( $id, 'site-sidebar-layout', true );
+ if ( empty( $sidebar_layout ) || 'default' == $sidebar_layout ) {
+ update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' );
+ }
+
+ // In the preview mode, Apply the layouts using filters for Elementor Template Library.
+ add_filter(
+ 'astra_page_layout',
+ function() { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found
+ return 'no-sidebar';
+ }
+ );
+
+ add_filter(
+ 'astra_get_content_layout',
+ function () { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewClosure.Found
+ return 'page-builder';
+ }
+ );
+
+ add_filter( 'astra_the_post_title_enabled', '__return_false' );
+ add_filter( 'astra_featured_image_enabled', '__return_false' );
+ }
+ }
+ }
+
+ /**
+ * Add z-index CSS for elementor's drag drop
+ *
+ * @return void
+ * @since 1.4.0
+ */
+ public function elementor_overlay_zindex() {
+
+ // return if we are not on Elementor's edit page.
+ if ( ! $this->is_elementor_editor() ) {
+ return;
+ }
+
+ ?>
+ <style type="text/css" id="ast-elementor-overlay-css">
+ .elementor-editor-active .elementor-element > .elementor-element-overlay {
+ z-index: 9999;
+ }
+ </style>
+
+ <?php
+ }
+
+ /**
+ * Check is elementor activated.
+ *
+ * @param int $id Post/Page Id.
+ * @return boolean
+ */
+ public function is_elementor_activated( $id ) {
+ if ( version_compare( ELEMENTOR_VERSION, '1.5.0', '<' ) ) {
+ return ( 'builder' === Plugin::$instance->db->get_edit_mode( $id ) );
+ } else {
+ return Plugin::$instance->db->is_built_with_elementor( $id );
+ }
+ }
+
+ /**
+ * Check if Elementor Editor is open.
+ *
+ * @since 1.2.7
+ *
+ * @return boolean True IF Elementor Editor is loaded, False If Elementor Editor is not loaded.
+ */
+ private function is_elementor_editor() {
+ if ( ( isset( $_REQUEST['action'] ) && 'elementor' == $_REQUEST['action'] ) || isset( $_REQUEST['elementor-preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
+ return true;
+ }
+
+ return false;
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Elementor::get_instance();
diff --git a/inc/compatibility/class-astra-gravity-forms.php b/inc/compatibility/class-astra-gravity-forms.php
new file mode 100644
index 0000000..e89c83e
--- /dev/null
+++ b/inc/compatibility/class-astra-gravity-forms.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Gravity Forms File.
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Gravity Forms' not exist then return.
+if ( ! class_exists( 'GFForms' ) ) {
+ return;
+}
+
+/**
+ * Astra Gravity Forms
+ */
+if ( ! class_exists( 'Astra_Gravity_Forms' ) ) :
+
+ /**
+ * Astra Gravity Forms
+ *
+ * @since 1.0.0
+ */
+ class Astra_Gravity_Forms {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_action( 'gform_enqueue_scripts', array( $this, 'add_styles' ) );
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @since 1.0.0
+ */
+ public function add_styles() {
+ $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
+ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
+
+ if ( is_rtl() ) {
+ $file_prefix .= '-rtl';
+ }
+
+ $css_file = ASTRA_THEME_URI . 'assets/css/' . $dir_name . '/compatibility/gravity-forms' . $file_prefix . '.css';
+
+ wp_enqueue_style( 'astra-gravity-forms', $css_file, array(), ASTRA_THEME_VERSION, 'all' );
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Gravity_Forms::get_instance();
diff --git a/inc/compatibility/class-astra-jetpack.php b/inc/compatibility/class-astra-jetpack.php
new file mode 100644
index 0000000..2bbcb6e
--- /dev/null
+++ b/inc/compatibility/class-astra-jetpack.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Jetpack Compatibility File.
+ *
+ * @link https://jetpack.me/
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Jetpack' not exist then return.
+if ( ! class_exists( 'Jetpack' ) ) {
+ return;
+}
+
+/**
+ * Astra Jetpack Compatibility
+ */
+if ( ! class_exists( 'Astra_Jetpack' ) ) :
+
+ /**
+ * Astra Jetpack Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_Jetpack {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_action( 'after_setup_theme', array( $this, 'jetpack_setup' ) );
+ }
+
+ /**
+ * Add theme support for Infinite Scroll.
+ * See: https://jetpack.me/support/infinite-scroll/
+ */
+ public function jetpack_setup() {
+ add_theme_support(
+ 'infinite-scroll',
+ array(
+ 'container' => 'main',
+ 'render' => array( $this, 'infinite_scroll_render' ),
+ 'footer' => 'page',
+ )
+ );
+ } // end function jetpack_setup
+
+ /**
+ * Custom render function for Infinite Scroll.
+ */
+ public function infinite_scroll_render() {
+ while ( have_posts() ) {
+ the_post();
+ get_template_part( 'template-parts/content', astra_get_post_format() );
+ }
+ } // end function infinite_scroll_render
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Jetpack::get_instance();
diff --git a/inc/compatibility/class-astra-site-origin.php b/inc/compatibility/class-astra-site-origin.php
new file mode 100644
index 0000000..1edca34
--- /dev/null
+++ b/inc/compatibility/class-astra-site-origin.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Site Origin Compatibility File.
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Site Origin' not exist then return.
+if ( ! class_exists( 'SiteOrigin_Panels_Settings' ) ) {
+ return;
+}
+
+/**
+ * Astra Site Origin Compatibility
+ */
+if ( ! class_exists( 'Astra_Site_Origin' ) ) :
+
+ /**
+ * Astra Site Origin Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_Site_Origin {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_filter( 'astra_theme_assets', array( $this, 'add_styles' ) );
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @param array $assets list of theme assets (JS & CSS).
+ * @return array List of updated assets.
+ * @since 1.0.0
+ */
+ public function add_styles( $assets ) {
+ $assets['css']['astra-site-origin'] = 'compatibility/site-origin';
+ return $assets;
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Site_Origin::get_instance();
diff --git a/inc/compatibility/class-astra-ubermeu.php b/inc/compatibility/class-astra-ubermeu.php
new file mode 100644
index 0000000..168c379
--- /dev/null
+++ b/inc/compatibility/class-astra-ubermeu.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Ubermenu Compatibility File.
+ *
+ * @link https://Ubermenu.me/
+ * @since 1.1.7
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Ubermenu' not exist then return.
+if ( ! class_exists( 'UberMenu' ) ) {
+ return;
+}
+
+/**
+ * Astra Ubermenu Compatibility
+ */
+if ( ! class_exists( 'Astra_Ubermeu' ) ) :
+
+ /**
+ * Astra Ubermenu Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_Ubermeu {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ *
+ * @since 1.1.7
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ *
+ * @since 1.1.7
+ */
+ public function __construct() {
+ add_filter( 'astra_enable_mobile_menu_buttons', array( $this, 'disable_primary_menu_toggle' ), 30 );
+ }
+
+ /**
+ * Disable the Mobile Menu toggles from Astra if Uber Menu is used.
+ *
+ * @since 1.1.7
+ * @param bool $status Status if the mobile menu toggels are enaled or disaled.
+ * @return bool False If ubermenu is configured on this location. Unchanged if it is not configured.
+ */
+ public function disable_primary_menu_toggle( $status ) {
+
+ // Don't overrde anythign if ubermenu's function is not present.
+ if ( ! function_exists( 'ubermenu_get_menu_instance_by_theme_location' ) ) {
+ return $status;
+ }
+
+ $ubermenu_auto_config = ubermenu_get_menu_instance_by_theme_location( 'primary' );
+
+ // If ubermenu's auto configuration is not used here, don't override the filter.
+ if ( '' === $ubermenu_auto_config || false === $ubermenu_auto_config ) {
+ return $status;
+ }
+
+ return false;
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Ubermeu::get_instance();
diff --git a/inc/compatibility/class-astra-visual-composer.php b/inc/compatibility/class-astra-visual-composer.php
new file mode 100644
index 0000000..8d863cb
--- /dev/null
+++ b/inc/compatibility/class-astra-visual-composer.php
@@ -0,0 +1,141 @@
+<?php
+/**
+ * Visual Composer Compatibility File.
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Visual Composer' not exist then return.
+if ( ! class_exists( 'Vc_Manager' ) ) {
+ return;
+}
+
+/**
+ * Astra Visual Composer Compatibility
+ */
+if ( ! class_exists( 'Astra_Visual_Composer' ) ) :
+
+ /**
+ * Astra Visual Composer Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_Visual_Composer {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_action( 'wp', array( $this, 'vc_default_setting' ), 20 );
+ add_action( 'do_meta_boxes', array( $this, 'vc_default_setting' ), 20 );
+ add_action( 'vc_frontend_editor_render', array( $this, 'vc_frontend_default_setting' ) );
+ add_filter( 'astra_theme_assets', array( $this, 'add_styles' ) );
+ }
+
+ /**
+ * VC Updated meta settings
+ *
+ * @since 1.0.13
+ * @param int $id Post id.
+ * @return void
+ */
+ public function vc_update_meta_setting( $id ) {
+
+ if ( false === astra_enable_page_builder_compatibility() || 'post' == get_post_type() ) {
+ return;
+ }
+
+ update_post_meta( $id, '_astra_content_layout_flag', 'disabled' );
+ update_post_meta( $id, 'site-post-title', 'disabled' );
+ update_post_meta( $id, 'ast-title-bar-display', 'disabled' );
+ update_post_meta( $id, 'ast-featured-img', 'disabled' );
+
+ $content_layout = get_post_meta( $id, 'site-content-layout', true );
+ if ( empty( $content_layout ) || 'default' == $content_layout ) {
+ update_post_meta( $id, 'site-content-layout', 'plain-container' );
+ }
+
+ $sidebar_layout = get_post_meta( $id, 'site-sidebar-layout', true );
+ if ( empty( $sidebar_layout ) || 'default' == $sidebar_layout ) {
+ update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' );
+ }
+ }
+
+ /**
+ * Set frontend default setting.
+ *
+ * @since 1.0.13
+ * @return void
+ */
+ public function vc_frontend_default_setting() {
+
+ global $post;
+ $id = astra_get_post_id();
+ $page_builder_flag = get_post_meta( $id, '_astra_content_layout_flag', true );
+
+ if ( empty( $page_builder_flag ) ) {
+ if ( $id > 0 && empty( $post->post_content ) ) {
+ $this->vc_update_meta_setting( $id );
+ }
+ }
+ }
+
+ /**
+ * Set default setting.
+ *
+ * @since 1.0.13
+ * @return void
+ */
+ public function vc_default_setting() {
+
+ global $post;
+ $id = astra_get_post_id();
+
+ $page_builder_flag = get_post_meta( $id, '_astra_content_layout_flag', true );
+
+ if ( isset( $post ) && empty( $page_builder_flag ) && ( is_admin() || is_singular() ) ) {
+ $vc_active = get_post_meta( $id, '_wpb_vc_js_status', true );
+ if ( 'true' == $vc_active || has_shortcode( $post->post_content, 'vc_row' ) ) {
+ $this->vc_update_meta_setting( $id );
+ }
+ }
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @param array $assets list of theme assets (JS & CSS).
+ * @return array List of updated assets.
+ * @since 3.5.0
+ */
+ public function add_styles( $assets ) {
+ if ( ! empty( $assets['css'] ) ) {
+ $assets['css'] = array( 'astra-vc-builder' => 'compatibility/page-builder/vc-plugin' ) + $assets['css'];
+ }
+ return $assets;
+ }
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Visual_Composer::get_instance();
diff --git a/inc/compatibility/class-astra-web-stories.php b/inc/compatibility/class-astra-web-stories.php
new file mode 100644
index 0000000..e0d4b59
--- /dev/null
+++ b/inc/compatibility/class-astra-web-stories.php
@@ -0,0 +1,97 @@
+<?php
+/**
+ * Web Stories Compatibility File.
+ *
+ * @link https://wp.stories.google/
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Google\Web_Stories' not exist then return.
+if ( ! defined( 'WEBSTORIES_VERSION' ) ) {
+ return;
+}
+
+/**
+ * Astra Web_Stories Compatibility
+ *
+ * @since 3.2.0
+ */
+class Astra_Web_Stories {
+
+ /**
+ * Constructor
+ *
+ * @since 3.2.0
+ * @return void
+ */
+ public function __construct() {
+ add_action( 'after_setup_theme', array( $this, 'web_stories_setup' ) );
+ add_action( 'astra_body_top', array( $this, 'web_stories_embed' ) );
+ add_filter( 'astra_dynamic_theme_css', array( $this, 'web_stories_css' ) );
+ }
+
+ /**
+ * Add theme support for Web Stories.
+ *
+ * @since 3.2.0
+ * @return void
+ */
+ public function web_stories_setup() {
+ add_theme_support( 'web-stories' );
+ }
+
+ /**
+ * Custom render function for Web Stories Embedding.
+ *
+ * @since 3.2.0
+ * @return void
+ */
+ public function web_stories_embed() {
+ if ( ! function_exists( '\Google\Web_Stories\render_theme_stories' ) ) {
+ return;
+ }
+
+ // Embed web stories above header with pre-configured customizer settings.
+ \Google\Web_Stories\render_theme_stories();
+ }
+
+ /**
+ * Add dynamic CSS for the webstories.
+ *
+ * @since 3.2.0
+ *
+ * @param string $dynamic_css Astra Dynamic CSS.
+ * @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
+ *
+ * @return String Generated dynamic CSS for Heading Colors.
+ */
+ public function web_stories_css( $dynamic_css, $dynamic_css_filtered = '' ) {
+ // Using function check instead of class as there can be changes in the web stories plugin later, see 1.7.1 release https://github.com/google/web-stories-wp/pull/7266/files.
+ if ( ! function_exists( '\Google\Web_Stories\render_theme_stories' ) ) {
+ return $dynamic_css;
+ }
+
+ $options = get_option( 'web_stories_customizer_settings' );
+
+ // bail if web stories are not enabled on the frontend.
+ if ( empty( $options['show_stories'] ) || true !== $options['show_stories'] ) {
+ return $dynamic_css;
+ }
+
+ $stories_css_array = array(
+ '.web-stories-list.web-stories-list--customizer.is-view-type-circles' => array(
+ 'border-bottom' => '1px solid #ccc',
+ 'padding' => '15px 0',
+ 'margin-bottom' => '0',
+ ),
+ );
+
+ $dynamic_css .= astra_parse_css( $stories_css_array );
+
+ return $dynamic_css;
+ }
+
+}
+
+new Astra_Web_Stories();
diff --git a/inc/compatibility/class-astra-yoast-seo.php b/inc/compatibility/class-astra-yoast-seo.php
new file mode 100644
index 0000000..1873f7f
--- /dev/null
+++ b/inc/compatibility/class-astra-yoast-seo.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Yoast SEO Compatibility File.
+ *
+ * @package Astra
+ */
+
+/**
+ * Astra Yoast SEO Compatibility
+ *
+ * @since 2.1.2
+ */
+class Astra_Yoast_SEO {
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_filter( 'wpseo_sitemap_exclude_post_type', array( $this, 'sitemap_exclude_post_type' ), 10, 2 );
+ }
+
+ /**
+ * Exclude One Content Type From Yoast SEO Sitemap
+ *
+ * @param string $value value.
+ * @param string $post_type Post Type.
+ * @since 2.1.2
+ */
+ public function sitemap_exclude_post_type( $value, $post_type ) {
+ if ( 'astra-advanced-hook' === $post_type ) {
+ return true;
+ }
+ }
+
+}
+
+/**
+ * Kicking this off by object
+ */
+new Astra_Yoast_SEO();
diff --git a/inc/compatibility/edd/class-astra-edd.php b/inc/compatibility/edd/class-astra-edd.php
new file mode 100644
index 0000000..657f3f6
--- /dev/null
+++ b/inc/compatibility/edd/class-astra-edd.php
@@ -0,0 +1,1087 @@
+<?php
+/**
+ * Easy Digital Downloads Compatibility File.
+ *
+ * @link https://easydigitaldownloads.com/
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Easy_Digital_Downloads' not exist then return.
+if ( ! class_exists( 'Easy_Digital_Downloads' ) ) {
+ return;
+}
+
+/**
+ * Astra Easy Digital Downloads Compatibility
+ */
+if ( ! class_exists( 'Astra_Edd' ) ) :
+
+ /**
+ * Astra Easy Digital Downloads Compatibility
+ *
+ * @since 1.5.5
+ */
+ class Astra_Edd {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+
+ require_once ASTRA_THEME_DIR . 'inc/compatibility/edd/edd-common-functions.php';// phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+
+ add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
+ // Register Store Sidebars.
+ add_action( 'widgets_init', array( $this, 'store_widgets_init' ), 15 );
+ // Replace Edd Store Sidebars.
+ add_filter( 'astra_get_sidebar', array( $this, 'replace_store_sidebar' ) );
+ // Edd Sidebar Layout.
+ add_filter( 'astra_page_layout', array( $this, 'store_sidebar_layout' ) );
+ // Edd Content Layout.
+ add_filter( 'astra_get_content_layout', array( $this, 'store_content_layout' ) );
+
+ add_filter( 'body_class', array( $this, 'edd_products_item_class' ) );
+ add_filter( 'post_class', array( $this, 'edd_single_product_class' ) );
+ add_filter( 'post_class', array( $this, 'render_post_class' ), 99 );
+
+ add_action( 'customize_register', array( $this, 'customize_register' ), 2 );
+
+ add_filter( 'astra_theme_assets', array( $this, 'add_styles' ) );
+ add_filter( 'wp_enqueue_scripts', array( $this, 'add_inline_scripts' ) );
+ add_filter( 'astra_dynamic_theme_css', array( $this, 'add_inline_styles' ) );
+
+ add_action( 'wp', array( $this, 'edd_initialization' ) );
+ add_action( 'init', array( $this, 'edd_set_defaults_initialization' ) );
+
+ // Add Cart option in dropdown.
+ add_filter( 'astra_header_section_elements', array( $this, 'header_section_elements' ) );
+
+ // Add Cart icon in Menu.
+ add_filter( 'astra_get_dynamic_header_content', array( $this, 'astra_header_cart' ), 10, 3 );
+
+ add_filter( 'astra_single_post_navigation', array( $this, 'edd_single_post_navigation' ) );
+
+ // Header Cart Icon.
+ add_action( 'astra_edd_header_cart_icons_before', array( $this, 'header_cart_icon_markup' ) );
+ add_filter( 'astra_edd_cart_in_menu_class', array( $this, 'header_cart_icon_class' ), 99 );
+
+ }
+
+ /**
+ * Header Cart Extra Icons markup
+ *
+ * @return void;
+ */
+ 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
+ );
+ }
+ }
+
+ /**
+ * Header Cart Icon Class
+ *
+ * @param array $classes Default argument array.
+ *
+ * @return array;
+ */
+ public function header_cart_icon_class( $classes ) {
+
+ if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && ! defined( 'ASTRA_EXT_VER' ) ) {
+ return;
+ }
+
+ $header_cart_icon_style = astra_get_option( 'edd-header-cart-icon-style' );
+
+ $classes[] = 'ast-edd-menu-cart-' . $header_cart_icon_style;
+ $header_cart_icon_has_color = astra_get_option( 'edd-header-cart-icon-color' );
+ if ( ! empty( $header_cart_icon_has_color ) && ( 'none' !== $header_cart_icon_style ) ) {
+ $classes[] = 'ast-menu-cart-has-color';
+ }
+
+ return $classes;
+ }
+
+ /**
+ * Disable EDD style only for the first time
+ *
+ * @return void
+ */
+ public function edd_set_defaults_initialization() {
+
+ $astra_theme_options = get_option( 'astra-settings' );
+ $edd_settings = get_option( 'edd_settings' );
+
+ // Set flag to set the EDD style disable only once for the very first time.
+ if ( ! isset( $astra_theme_options['ast-edd-disable-styles'] ) ) {
+ $astra_theme_options['ast-edd-disable-styles'] = true;
+ $edd_settings['disable_styles'] = true;
+ update_option( 'astra-settings', $astra_theme_options );
+ update_option( 'edd_settings', $edd_settings );
+ }
+
+ }
+
+ /**
+ * Single Product Navigation
+ *
+ * @param array $args single products navigation arguments.
+ *
+ * @return array $args single products navigation arguments.
+ */
+ public function edd_single_post_navigation( $args ) {
+ $is_edd_single_product_page = astra_is_edd_single_product_page();
+ $disable_single_product_navigation = astra_get_option( 'disable-edd-single-product-nav' );
+ if ( $is_edd_single_product_page && ! $disable_single_product_navigation ) {
+ $next_post = get_next_post();
+ $prev_post = get_previous_post();
+
+ $next_text = false;
+ if ( $next_post ) {
+ $next_text = sprintf(
+ '%s <span class="ast-right-arrow">&rarr;</span>',
+ $next_post->post_title
+ );
+ }
+
+ $prev_text = false;
+ if ( $prev_post ) {
+ $prev_text = sprintf(
+ '<span class="ast-left-arrow">&larr;</span> %s',
+ $prev_post->post_title
+ );
+ }
+
+ $args['prev_text'] = $prev_text;
+ $args['next_text'] = $next_text;
+ } elseif ( $is_edd_single_product_page && $disable_single_product_navigation ) {
+ $args['prev_text'] = false;
+ $args['next_text'] = false;
+ }
+
+ return $args;
+ }
+
+ /**
+ * EDD Initialization
+ *
+ * @return void
+ */
+ public function edd_initialization() {
+ $is_edd_archive_page = astra_is_edd_archive_page();
+ $is_edd_single_product_page = astra_is_edd_single_product_page();
+
+ if ( $is_edd_archive_page ) {
+ add_action( 'astra_template_parts_content', array( $this, 'edd_content_loop' ) );
+ remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_default' ) );
+
+ // Add edd wrapper.
+ add_action( 'astra_template_parts_content_top', array( $this, 'astra_edd_templat_part_wrap_open' ), 25 );
+ add_action( 'astra_template_parts_content_bottom', array( $this, 'astra_edd_templat_part_wrap_close' ), 5 );
+
+ // Remove closing and ending div 'ast-row'.
+ remove_action( 'astra_template_parts_content_top', array( Astra_Loop::get_instance(), 'astra_templat_part_wrap_open' ), 25 );
+ remove_action( 'astra_template_parts_content_bottom', array( Astra_Loop::get_instance(), 'astra_templat_part_wrap_close' ), 5 );
+ }
+ if ( $is_edd_single_product_page ) {
+ remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_post' ) );
+
+ add_action( 'astra_template_parts_content', array( $this, 'edd_single_template' ) );
+
+ }
+ }
+
+
+ /**
+ * Add wrapper for edd archive pages
+ *
+ * @return void
+ */
+ public function astra_edd_templat_part_wrap_open() {
+ ?>
+ <div class="ast-edd-container">
+ <?php
+ }
+
+ /**
+ * Add end of wrapper for edd archive pages
+ */
+ public function astra_edd_templat_part_wrap_close() {
+ ?>
+ </div> <!-- .ast-edd-container -->
+ <?php
+ }
+
+ /**
+ * Edd Single Product template
+ */
+ public function edd_single_template() {
+
+ astra_entry_before();
+ ?>
+
+ <div <?php post_class(); ?>>
+
+ <?php astra_entry_top(); ?>
+
+ <?php astra_entry_content_single(); ?>
+
+ <?php astra_entry_bottom(); ?>
+
+ </div><!-- #post-## -->
+
+ <?php
+ astra_entry_after();
+ }
+
+ /**
+ * Add Cart icon markup
+ *
+ * @param Array $options header options array.
+ *
+ * @return Array header options array.
+ * @since 1.5.5
+ */
+ public function header_section_elements( $options ) {
+
+ $options['edd'] = __( 'Easy Digital Downloads', 'astra' );
+
+ return $options;
+ }
+
+ /**
+ * Add wrapper to the edd archive content template
+ *
+ * @return void
+ */
+ public function edd_content_loop() {
+ ?>
+ <div <?php post_class(); ?>>
+ <?php
+ /**
+ * Edd Archive Page Product Content Sorting
+ */
+ do_action( 'astra_edd_archive_product_content' );
+ ?>
+ </div>
+ <?php
+ }
+
+
+
+ /**
+ * Remove theme post's default classes when EDD archive.
+ *
+ * @param array $classes Post Classes.
+ * @return array
+ * @since 1.5.5
+ */
+ public function render_post_class( $classes ) {
+ $post_class = array( 'ast-edd-archive-article' );
+ $result = array_intersect( $classes, $post_class );
+
+ if ( count( $result ) > 0 ) {
+ $classes = array_diff(
+ $classes,
+ array(
+ // Astra common grid.
+ 'ast-col-sm-12',
+ 'ast-col-md-8',
+ 'ast-col-md-6',
+ 'ast-col-md-12',
+
+ // Astra Blog / Single Post.
+ 'ast-article-post',
+ 'ast-article-single',
+ 'ast-separate-posts',
+ 'remove-featured-img-padding',
+ 'ast-featured-post',
+ )
+ );
+ }
+ return $classes;
+ }
+
+ /**
+ * Add Cart icon markup
+ *
+ * @param String $output Markup.
+ * @param String $section Section name.
+ * @param String $section_type Section selected option.
+ * @return Markup String.
+ *
+ * @since 1.5.5
+ */
+ public function astra_header_cart( $output, $section, $section_type ) {
+
+ if ( 'edd' === $section_type && apply_filters( 'astra_edd_header_cart_icon', true ) ) {
+
+ $output = $this->edd_mini_cart_markup();
+ }
+
+ return $output;
+ }
+
+ /**
+ * Easy Digital DOwnloads mini cart markup markup
+ *
+ * @since 1.5.5
+ * @return html
+ */
+ public function edd_mini_cart_markup() {
+ $class = '';
+ if ( edd_is_checkout() ) {
+ $class = 'current-menu-item';
+ }
+
+ $cart_menu_classes = apply_filters( 'astra_edd_cart_in_menu_class', array( 'ast-menu-cart-with-border' ) );
+
+ ob_start();
+ if ( is_customize_preview() && ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ) {
+ Astra_Builder_UI_Controller::render_customizer_edit_button();
+ }
+ ?>
+ <div class="ast-edd-site-header-cart <?php echo esc_attr( implode( ' ', $cart_menu_classes ) ); ?>">
+ <div class="ast-edd-site-header-cart-wrap <?php echo esc_attr( $class ); ?>">
+ <?php $this->astra_get_edd_cart(); ?>
+ </div>
+ <?php if ( ! edd_is_checkout() ) { ?>
+ <div class="ast-edd-site-header-cart-widget">
+ <?php
+ the_widget( 'edd_cart_widget', 'title=' );
+ ?>
+ </div>
+ <?php } ?>
+ </div>
+ <?php
+ return ob_get_clean();
+ }
+
+ /**
+ * Cart Link
+ * Displayed a link to the cart including the number of items present and the cart total
+ *
+ * @return void
+ * @since 1.5.5
+ */
+ public function astra_get_edd_cart() {
+
+ $view_shopping_cart = apply_filters( 'astra_edd_view_shopping_cart_title', __( 'View your shopping cart', 'astra' ) );
+ $edd_cart_link = apply_filters( 'astra_edd_cart_link', edd_get_checkout_uri() );
+
+ if ( is_customize_preview() ) {
+ $edd_cart_link = '#';
+ }
+ ?>
+ <a class="ast-edd-cart-container" href="<?php echo esc_url( $edd_cart_link ); ?>" title="<?php echo esc_attr( $view_shopping_cart ); ?>">
+
+ <?php
+ do_action( 'astra_edd_header_cart_icons_before' );
+
+ if ( apply_filters( 'astra_edd_default_header_cart_icon', true ) ) {
+ ?>
+ <div class="ast-edd-cart-menu-wrap">
+ <span class="count">
+ <?php
+ if ( apply_filters( 'astra_edd_header_cart_total', true ) ) {
+ $cart_items = count( edd_get_cart_contents() );
+ echo esc_html( $cart_items );
+ }
+ ?>
+ </span>
+ </div>
+ <?php
+ }
+
+ do_action( 'astra_edd_header_cart_icons_after' );
+
+ ?>
+ </a>
+ <?php
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @param array $assets list of theme assets (JS & CSS).
+ * @return array List of updated assets.
+ * @since 1.5.5
+ */
+ public function add_styles( $assets ) {
+ $assets['css']['astra-edd'] = Astra_Builder_Helper::apply_flex_based_css() ? 'compatibility/edd-grid' : 'compatibility/edd';
+ return $assets;
+ }
+
+ /**
+ * Add inline style
+ *
+ * @since 1.5.5
+ */
+ public function add_inline_scripts() {
+
+ $is_site_rtl = is_rtl();
+
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ $max_tablet_edd_css = array(
+ '.tablet-columns-1 .ast-edd-archive-article' => array(
+ 'width' => '100%',
+ ),
+ '.tablet-columns-2 .ast-edd-archive-article' => array(
+ 'width' => '47.6%',
+ 'width' => 'calc(50% - 10px)',
+ ),
+ '.tablet-columns-3 .ast-edd-archive-article, .edd_downloads_list[class*="edd_download_columns_"] .edd_download' => array(
+ 'width' => '30.2%',
+ 'width' => 'calc(33.33% - 14px)',
+ ),
+ '.tablet-columns-4 .ast-edd-archive-article' => array(
+ 'width' => '21.5%',
+ 'width' => 'calc(25% - 15px)',
+ ),
+ '.tablet-columns-5 .ast-edd-archive-article' => array(
+ 'width' => '16.2%',
+ 'width' => 'calc(20% - 16px)',
+ ),
+ '.tablet-columns-6 .ast-edd-archive-article' => array(
+ 'width' => '12.7%',
+ 'width' => 'calc(16.66% - 16.66px)',
+ ),
+ );
+ } else {
+ $max_tablet_edd_css = array(
+ '.tablet-columns-1 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(1, 1fr)',
+ ),
+ '.tablet-columns-2 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(2, 1fr)',
+ ),
+ '.tablet-columns-3 .ast-edd-container, .edd_downloads_list[class*="edd_download_columns_"] .edd_download' => array(
+ 'grid-template-columns' => 'repeat(3, 1fr)',
+ ),
+ '.tablet-columns-4 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(4, 1fr)',
+ ),
+ '.tablet-columns-5 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(5, 1fr)',
+ ),
+ '.tablet-columns-6 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(6, 1fr)',
+ ),
+ );
+ }
+
+ /* Parse CSS from array() -> max-width: (tablet-breakpoint) px & min-width: (mobile-breakpoint + 1) px */
+ $edd_css_output = astra_parse_css( $max_tablet_edd_css, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() );
+
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ if ( $is_site_rtl ) {
+ $max_tablet_edd_lang_direction_css = array(
+ '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array(
+ 'margin-left' => '20px',
+ 'clear' => 'none',
+ ),
+ '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n)' => array(
+ 'margin-left' => '0',
+ 'clear' => 'left',
+ ),
+ '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n+1), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n+1), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n+1), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n+1), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n+1), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n+1)' => array(
+ 'clear' => 'right',
+ ),
+ );
+ } else {
+ $max_tablet_edd_lang_direction_css = array(
+ '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array(
+ 'margin-right' => '20px',
+ 'clear' => 'none',
+ ),
+ '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n)' => array(
+ 'margin-right' => '0',
+ 'clear' => 'right',
+ ),
+ '.tablet-columns-2 .ast-edd-archive-article:nth-child(2n+1), .tablet-columns-3 .ast-edd-archive-article:nth-child(3n+1), .tablet-columns-4 .ast-edd-archive-article:nth-child(4n+1), .tablet-columns-5 .ast-edd-archive-article:nth-child(5n+1), .tablet-columns-6 .ast-edd-archive-article:nth-child(6n+1), .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(3n+1)' => array(
+ 'clear' => 'left',
+ ),
+ );
+ }
+ /* Parse CSS from array() -> max-width: (tablet-breakpoint) px & min-width: (mobile-breakpoint + 1) px */
+ $edd_css_output .= astra_parse_css( $max_tablet_edd_lang_direction_css, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() );
+ }
+
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ $mobile_edd_css = array(
+ '.mobile-columns-1 .ast-edd-archive-article' => array(
+ 'width' => '100%',
+ ),
+ '.mobile-columns-3 .ast-edd-archive-article' => array(
+ 'width' => '28.2%',
+ 'width' => 'calc(33.33% - 14px)',
+ ),
+ '.mobile-columns-4 .ast-edd-archive-article' => array(
+ 'width' => '19%',
+ 'width' => 'calc(25% - 15px)',
+ ),
+ '.mobile-columns-5 .ast-edd-archive-article' => array(
+ 'width' => '13%',
+ 'width' => 'calc(20% - 16px)',
+ ),
+ '.mobile-columns-6 .ast-edd-archive-article' => array(
+ 'width' => '10.2%',
+ 'width' => 'calc(16.66% - 16.66px)',
+ ),
+ '.edd_downloads_list[class*="edd_download_columns_"] .edd_download, .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n+1), .mobile-columns-2 .ast-edd-archive-article' => array(
+ 'width' => '46.1%',
+ 'width' => 'calc(50% - 10px)',
+ ),
+ );
+ } else {
+ $mobile_edd_css = array(
+ '.mobile-columns-1 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(1, 1fr)',
+ ),
+ '.mobile-columns-3 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(3, 1fr)',
+ ),
+ '.mobile-columns-4 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(4, 1fr)',
+ ),
+ '.mobile-columns-5 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(5, 1fr)',
+ ),
+ '.mobile-columns-6 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(6, 1fr)',
+ ),
+ '.edd_downloads_list[class*="edd_download_columns_"] .edd_download, .edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n+1), .mobile-columns-2 .ast-edd-container' => array(
+ 'grid-template-columns' => 'repeat(2, 1fr)',
+ ),
+ );
+ }
+
+ /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */
+ $edd_css_output .= astra_parse_css( $mobile_edd_css, '', astra_get_mobile_breakpoint() );
+
+ if ( $is_site_rtl ) {
+ $mobile_edd_lang_direction_css = array(
+ '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array(
+ 'margin-left' => '20px',
+ 'clear' => 'none',
+ ),
+ '.mobile-columns-1 .ast-edd-archive-article:nth-child(n)' => array(
+ 'margin-left' => '0',
+ ),
+ '.edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n), .mobile-columns-2 .ast-edd-archive-article:nth-child(2n), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n)' => array(
+ 'margin-left' => '0',
+ 'clear' => 'left',
+ ),
+ '.mobile-columns-2 .ast-edd-archive-article:nth-child(2n+1), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n+1), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n+1), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n+1), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n+1)' => array(
+ 'clear' => 'right',
+ ),
+ );
+ } else {
+ $mobile_edd_lang_direction_css = array(
+ '[class*="columns-"] .ast-edd-archive-article:nth-child(n)' => array(
+ 'margin-right' => '20px',
+ 'clear' => 'none',
+ ),
+ '.mobile-columns-1 .ast-edd-archive-article:nth-child(n)' => array(
+ 'margin-right' => '0',
+ ),
+ '.edd_downloads_list[class*="edd_download_columns_"] .edd_download:nth-child(2n), .mobile-columns-2 .ast-edd-archive-article:nth-child(2n), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n)' => array(
+ 'margin-right' => '0',
+ 'clear' => 'right',
+ ),
+ '.mobile-columns-2 .ast-edd-archive-article:nth-child(2n+1), .mobile-columns-3 .ast-edd-archive-article:nth-child(3n+1), .mobile-columns-4 .ast-edd-archive-article:nth-child(4n+1), .mobile-columns-5 .ast-edd-archive-article:nth-child(5n+1), .mobile-columns-6 .ast-edd-archive-article:nth-child(6n+1)' => array(
+ 'clear' => 'left',
+ ),
+ );
+ }
+
+ /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */
+ $edd_css_output .= astra_parse_css( $mobile_edd_lang_direction_css, '', astra_get_mobile_breakpoint() );
+
+ wp_add_inline_style( 'astra-edd', apply_filters( 'astra_theme_edd_dynamic_css', $edd_css_output ) );
+
+ // Inline js for EDD Cart updates.
+ wp_add_inline_script(
+ 'edd-ajax',
+ "jQuery( document ).ready( function($) {
+ /**
+ * Astra - Easy Digital Downloads Cart Quantity & Total Amount
+ */
+ var cartQuantity = jQuery('.ast-edd-site-header-cart-wrap .count'),
+ iconQuantity = jQuery('.ast-edd-site-header-cart-wrap .astra-icon'),
+ cartTotalAmount = jQuery('.ast-edd-site-header-cart-wrap .ast-edd-header-cart-total');
+
+ jQuery('body').on('edd_cart_item_added', function( event, response ) {
+ cartQuantity.html( response.cart_quantity );
+ iconQuantity.attr('data-cart-total', response.cart_quantity );
+ cartTotalAmount.html( response.total );
+ });
+
+ jQuery('body').on('edd_cart_item_removed', function( event, response ) {
+ cartQuantity.html( response.cart_quantity );
+ iconQuantity.attr('data-cart-total', response.cart_quantity );
+ cartTotalAmount.html( response.total );
+ });
+ });"
+ );
+ }
+
+ /**
+ * Dynamic CSS
+ *
+ * @param string $dynamic_css Astra Dynamic CSS.
+ * @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
+ * @since 1.5.5
+ * @return string $dynamic_css
+ */
+ public function add_inline_styles( $dynamic_css, $dynamic_css_filtered = '' ) {
+
+ /**
+ * - Variable Declaration
+ */
+
+ $site_content_width = astra_get_option( 'site-content-width', 1200 );
+ $edd_archive_width = astra_get_option( 'edd-archive-width' );
+ $edd_archive_max_width = astra_get_option( 'edd-archive-max-width' );
+ $css_output = '';
+
+ $theme_color = astra_get_option( 'theme-color' );
+ $link_color = astra_get_option( 'link-color', $theme_color );
+ $text_color = astra_get_option( 'text-color' );
+ $link_h_color = astra_get_option( 'link-h-color' );
+
+ $btn_color = astra_get_option( 'button-color' );
+ if ( empty( $btn_color ) ) {
+ $btn_color = astra_get_foreground_color( $theme_color );
+ }
+
+ $btn_h_color = astra_get_option( 'button-h-color' );
+ if ( empty( $btn_h_color ) ) {
+ $btn_h_color = astra_get_foreground_color( $link_h_color );
+ }
+ $btn_bg_h_color = astra_get_option( 'button-bg-h-color', $link_h_color );
+
+ $btn_border_radius = astra_get_option( 'button-radius' );
+
+ $cart_h_color = astra_get_foreground_color( $link_h_color );
+
+ $css_output = array(
+ // Loading effect color.
+ 'a.edd-add-to-cart.white .edd-loading, .edd-discount-loader.edd-loading, .edd-loading-ajax.edd-loading' => array(
+ 'border-left-color' => esc_attr( $cart_h_color ),
+ ),
+ );
+
+ if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
+
+ $compat_css_desktop = array(
+ /**
+ * Cart in menu
+ */
+ '.ast-edd-site-header-cart a' => array(
+ 'color' => esc_attr( $text_color ),
+ ),
+
+ '.ast-edd-site-header-cart a:focus, .ast-edd-site-header-cart a:hover, .ast-edd-site-header-cart .current-menu-item a' => array(
+ 'color' => esc_attr( $text_color ),
+ ),
+
+ '.ast-edd-cart-menu-wrap .count, .ast-edd-cart-menu-wrap .count:after' => array(
+ 'border-color' => esc_attr( $link_color ),
+ 'color' => esc_attr( $link_color ),
+ ),
+
+ '.ast-edd-cart-menu-wrap:hover .count' => array(
+ 'color' => esc_attr( $cart_h_color ),
+ 'background-color' => esc_attr( $link_color ),
+ ),
+ '.ast-edd-site-header-cart .widget_edd_cart_widget .cart-total' => array(
+ 'color' => esc_attr( $link_color ),
+ ),
+
+ '.ast-edd-site-header-cart .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a' => array(
+ 'color' => $btn_h_color,
+ 'border-color' => $btn_bg_h_color,
+ 'background-color' => $btn_bg_h_color,
+ 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ),
+ ),
+ '.site-header .ast-edd-site-header-cart .ast-edd-site-header-cart-widget .edd_checkout a, .site-header .ast-edd-site-header-cart .ast-edd-site-header-cart-widget .edd_checkout a:hover' => array(
+ 'color' => $btn_color,
+ ),
+ '.below-header-user-select .ast-edd-site-header-cart .widget, .ast-above-header-section .ast-edd-site-header-cart .widget a, .below-header-user-select .ast-edd-site-header-cart .widget_edd_cart_widget a' => array(
+ 'color' => $text_color,
+ ),
+ '.below-header-user-select .ast-edd-site-header-cart .widget_edd_cart_widget a:hover, .ast-above-header-section .ast-edd-site-header-cart .widget_edd_cart_widget a:hover, .below-header-user-select .ast-edd-site-header-cart .widget_edd_cart_widget a.remove:hover, .ast-above-header-section .ast-edd-site-header-cart .widget_edd_cart_widget a.remove:hover' => array(
+ 'color' => esc_attr( $link_color ),
+ ),
+ '.widget_edd_cart_widget a.edd-remove-from-cart:hover:after' => array(
+ 'color' => esc_attr( $link_color ),
+ 'border-color' => esc_attr( $link_color ),
+ 'background-color' => esc_attr( '#ffffff' ),
+ ),
+ );
+
+ $css_output = array_merge( $css_output, $compat_css_desktop );
+ }
+
+ /* Parse CSS from array() */
+ $css_output = astra_parse_css( $css_output );
+
+ /* Easy Digital DOwnloads Shop Archive width */
+ if ( 'custom' === $edd_archive_width ) :
+ // Easy Digital DOwnloads shop archive custom width.
+ $site_width = array(
+ '.ast-edd-archive-page .site-content > .ast-container' => array(
+ 'max-width' => astra_get_css_value( $edd_archive_max_width, 'px' ),
+ ),
+ );
+ $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) );
+
+ else :
+ // Easy Digital DOwnloads shop archive default width.
+ $site_width = array(
+ '.ast-edd-archive-page .site-content > .ast-container' => array(
+ 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ),
+ ),
+ );
+
+ /* Parse CSS from array()*/
+ $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) );
+ endif;
+
+ $dynamic_css .= apply_filters( 'astra_theme_edd_dynamic_css', $css_output );
+
+ return $dynamic_css;
+ }
+
+ /**
+ * Theme Defaults.
+ *
+ * @param array $defaults Array of options value.
+ * @return array
+ */
+ public function theme_defaults( $defaults ) {
+
+ // Container.
+ $defaults['edd-content-layout'] = 'plain-container';
+
+ // // Sidebar.
+ $defaults['edd-sidebar-layout'] = 'no-sidebar';
+ $defaults['edd-single-product-sidebar-layout'] = 'default';
+
+ // Edd Archive.
+ $defaults['edd-archive-grids'] = array(
+ 'desktop' => 4,
+ 'tablet' => 3,
+ 'mobile' => 2,
+ );
+
+ $defaults['edd-archive-product-structure'] = array(
+ 'image',
+ 'category',
+ 'title',
+ 'price',
+ 'add_cart',
+ );
+
+ $defaults['edd-archive-add-to-cart-button-text'] = __( 'Add To Cart', 'astra' );
+ $defaults['edd-archive-variable-button'] = 'button';
+ $defaults['edd-archive-variable-button-text'] = __( 'View Details', 'astra' );
+
+ $defaults['edd-archive-width'] = 'default';
+ $defaults['edd-archive-max-width'] = 1200;
+ $defaults['disable-edd-single-product-nav'] = false;
+
+ return $defaults;
+ }
+
+
+ /**
+ * Add products item class to the body
+ *
+ * @param Array $classes product classes.
+ *
+ * @return array.
+ */
+ public function edd_products_item_class( $classes = '' ) {
+
+ $is_edd_archive_page = astra_is_edd_archive_page();
+
+ if ( $is_edd_archive_page ) {
+ $shop_grid = astra_get_option( 'edd-archive-grids' );
+ $classes[] = 'columns-' . $shop_grid['desktop'];
+ $classes[] = 'tablet-columns-' . $shop_grid['tablet'];
+ $classes[] = 'mobile-columns-' . $shop_grid['mobile'];
+
+ $classes[] = 'ast-edd-archive-page';
+ }
+
+ return $classes;
+ }
+
+ /**
+ * Add class on single product page
+ *
+ * @param Array $classes product classes.
+ *
+ * @return array.
+ */
+ public function edd_single_product_class( $classes ) {
+
+ $is_edd_archive_page = astra_is_edd_archive_page();
+
+ if ( $is_edd_archive_page ) {
+ $classes[] = 'ast-edd-archive-article';
+ }
+
+ return $classes;
+ }
+
+ /**
+ * Store widgets init.
+ */
+ public function store_widgets_init() {
+ register_sidebar(
+ apply_filters(
+ 'astra_edd_sidebar_init',
+ array(
+ 'name' => esc_html__( 'Easy Digital Downloads Sidebar', 'astra' ),
+ 'id' => 'astra-edd-sidebar',
+ 'description' => __( 'This sidebar will be used on Product archive, Cart, Checkout and My Account pages.', 'astra' ),
+ 'before_widget' => '<div id="%1$s" class="widget %2$s">',
+ 'after_widget' => '</div>',
+ 'before_title' => '<h2 class="widget-title">',
+ 'after_title' => '</h2>',
+ )
+ )
+ );
+ register_sidebar(
+ apply_filters(
+ 'astra_edd_single_product_sidebar_init',
+ array(
+ 'name' => esc_html__( 'EDD Single Product Sidebar', 'astra' ),
+ 'id' => 'astra-edd-single-product-sidebar',
+ 'description' => __( 'This sidebar will be used on EDD Single Product page.', 'astra' ),
+ 'before_widget' => '<div id="%1$s" class="widget %2$s">',
+ 'after_widget' => '</div>',
+ 'before_title' => '<h2 class="widget-title">',
+ 'after_title' => '</h2>',
+ )
+ )
+ );
+ }
+
+ /**
+ * Assign shop sidebar for store page.
+ *
+ * @param String $sidebar Sidebar.
+ *
+ * @return String $sidebar Sidebar.
+ */
+ public function replace_store_sidebar( $sidebar ) {
+
+ $is_edd_page = astra_is_edd_page();
+ $is_edd_single_product_page = astra_is_edd_single_product_page();
+
+ if ( $is_edd_page && ! $is_edd_single_product_page ) {
+ $sidebar = 'astra-edd-sidebar';
+ } elseif ( $is_edd_single_product_page ) {
+ $sidebar = 'astra-edd-single-product-sidebar';
+ }
+
+ return $sidebar;
+ }
+
+ /**
+ * Easy Digital Downloads Container
+ *
+ * @param String $sidebar_layout Layout type.
+ *
+ * @return String $sidebar_layout Layout type.
+ */
+ public function store_sidebar_layout( $sidebar_layout ) {
+
+ $is_edd_page = astra_is_edd_page();
+ $is_edd_single_product_page = astra_is_edd_single_product_page();
+ $is_edd_archive_page = astra_is_edd_archive_page();
+
+ if ( $is_edd_page ) {
+
+ $edd_sidebar = astra_get_option( 'edd-sidebar-layout' );
+
+ if ( 'default' !== $edd_sidebar ) {
+
+ $sidebar_layout = $edd_sidebar;
+ }
+
+ if ( $is_edd_single_product_page ) {
+ $edd_single_product_sidebar = astra_get_option( 'edd-single-product-sidebar-layout' );
+
+ if ( 'default' !== $edd_single_product_sidebar ) {
+ $sidebar_layout = $edd_single_product_sidebar;
+ } else {
+ $sidebar_layout = astra_get_option( 'site-sidebar-layout' );
+ }
+
+ $page_id = get_the_ID();
+ $edd_sidebar_layout = get_post_meta( $page_id, 'site-sidebar-layout', true );
+ } elseif ( $is_edd_archive_page ) {
+ $edd_sidebar_layout = astra_get_option( 'edd-sidebar-layout' );
+ } else {
+ $edd_sidebar_layout = astra_get_option_meta( 'site-sidebar-layout', '', true );
+ }
+
+ if ( 'default' !== $edd_sidebar_layout && ! empty( $edd_sidebar_layout ) ) {
+ $sidebar_layout = $edd_sidebar_layout;
+ }
+ }
+
+ return $sidebar_layout;
+ }
+ /**
+ * Easy Digital Downloads Container
+ *
+ * @param String $layout Layout type.
+ *
+ * @return String $layout Layout type.
+ */
+ public function store_content_layout( $layout ) {
+
+ $is_edd_page = astra_is_edd_page();
+ $is_edd_single_page = astra_is_edd_single_page();
+ $is_edd_archive_page = astra_is_edd_archive_page();
+
+ if ( $is_edd_page ) {
+
+ $edd_layout = astra_get_option( 'edd-content-layout' );
+
+ if ( 'default' !== $edd_layout ) {
+
+ $layout = $edd_layout;
+ }
+
+ if ( $is_edd_single_page ) {
+ $page_id = get_the_ID();
+ $edd_page_layout = get_post_meta( $page_id, 'site-content-layout', true );
+ } elseif ( $is_edd_archive_page ) {
+ $edd_page_layout = astra_get_option( 'edd-content-layout' );
+ } else {
+ $edd_page_layout = astra_get_option_meta( 'site-content-layout', '', true );
+ }
+
+ if ( 'default' !== $edd_page_layout && ! empty( $edd_page_layout ) ) {
+ $layout = $edd_page_layout;
+ }
+ }
+
+ return $layout;
+ }
+
+ /**
+ * Register Customizer sections and panel for Easy Digital Downloads.
+ *
+ * @since 1.5.5
+ * @param WP_Customize_Manager $wp_customize Theme Customizer object.
+ */
+ public function customize_register( $wp_customize ) {
+
+ // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ /**
+ * Register Sections & Panels
+ */
+ require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php';
+
+ /**
+ * Sections
+ */
+ require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php';
+ require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php';
+ require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php';
+ require ASTRA_THEME_DIR . 'inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php';
+ // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+
+ }
+
+ }
+
+endif;
+
+if ( apply_filters( 'astra_enable_edd_integration', true ) ) {
+ Astra_Edd::get_instance();
+}
diff --git a/inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php b/inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php
new file mode 100644
index 0000000..afdfa36
--- /dev/null
+++ b/inc/compatibility/edd/customizer/class-astra-customizer-register-edd-section.php
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Register customizer panels & sections for Easy Digital Downloads.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.5.5
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+if ( ! class_exists( 'Astra_Customizer_Register_Edd_Section' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Customizer_Register_Edd_Section extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Panels and Sections for Customizer.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.5.5
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $configs = array(
+ /**
+ * WooCommerce
+ */
+ array(
+ 'name' => 'section-edd-group',
+ 'type' => 'section',
+ 'title' => __( 'Easy Digital Downloads', 'astra' ),
+ 'priority' => 60,
+ ),
+
+ array(
+ 'name' => 'section-edd-archive',
+ 'title' => __( 'Product Archive', 'astra' ),
+ 'type' => 'section',
+ 'section' => 'section-edd-group',
+ 'priority' => 10,
+ ),
+
+ array(
+ 'name' => 'section-edd-single',
+ 'type' => 'section',
+ 'title' => __( 'Single Product', 'astra' ),
+ 'section' => 'section-edd-group',
+ 'priority' => 15,
+ ),
+ );
+
+ return array_merge( $configurations, $configs );
+ }
+ }
+}
+
+
+new Astra_Customizer_Register_Edd_Section();
diff --git a/inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php b/inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php
new file mode 100644
index 0000000..45c2cb3
--- /dev/null
+++ b/inc/compatibility/edd/customizer/sections/class-astra-edd-container-configs.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Easy Digital Downloads Container Options for Astra theme.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since Astra 1.5.5
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Edd_Container_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Edd_Container_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra-Easy Digital Downloads Shop Container Settings.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.5.5
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Shop Page
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[edd-content-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'default' => astra_get_option( 'edd-content-layout' ),
+ 'section' => 'section-container-layout',
+ 'priority' => 85,
+ 'title' => __( 'Easy Digital Downloads Layout', 'astra' ),
+ 'divider' => array( 'ast_class' => 'ast-top-divider' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'boxed-container' => __( 'Boxed', 'astra' ),
+ 'content-boxed-container' => __( 'Content Boxed', 'astra' ),
+ 'plain-container' => __( 'Full Width / Contained', 'astra' ),
+ 'page-builder' => __( 'Full Width / Stretched', 'astra' ),
+ ),
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Edd_Container_Configs();
+
diff --git a/inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php b/inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php
new file mode 100644
index 0000000..eb36e7f
--- /dev/null
+++ b/inc/compatibility/edd/customizer/sections/class-astra-edd-sidebar-configs.php
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Easy Digital Downloads Sidebar Options for our theme.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since Astra 1.5.5
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Edd_Sidebar_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Edd_Sidebar_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra Easy Digital Downloads Sidebar Configurations.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.5.5
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Shop Page
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[edd-sidebar-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'section' => 'section-sidebars',
+ 'default' => astra_get_option( 'edd-sidebar-layout' ),
+ 'priority' => 5,
+ 'title' => __( 'Easy Digital Downloads', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'no-sidebar' => __( 'No Sidebar', 'astra' ),
+ 'left-sidebar' => __( 'Left Sidebar', 'astra' ),
+ 'right-sidebar' => __( 'Right Sidebar', 'astra' ),
+ ),
+ ),
+
+ /**
+ * Option: Single Product
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[edd-single-product-sidebar-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'default' => astra_get_option( 'edd-single-product-sidebar-layout' ),
+ 'section' => 'section-sidebars',
+ 'priority' => 5,
+ 'title' => __( 'EDD Single Product', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'no-sidebar' => __( 'No Sidebar', 'astra' ),
+ 'left-sidebar' => __( 'Left Sidebar', 'astra' ),
+ 'right-sidebar' => __( 'Right Sidebar', 'astra' ),
+ ),
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Edd_Sidebar_Configs();
+
+
+
diff --git a/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php b/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php
new file mode 100644
index 0000000..bd770a9
--- /dev/null
+++ b/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-archive-layout-configs.php
@@ -0,0 +1,214 @@
+<?php
+/**
+ * Easy Digital Downloads Options for Astra Theme.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.5.5
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Edd_Archive_Layout_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Edd_Archive_Layout_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra-Easy Digital Downloads Shop Layout Customizer Configurations.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.5.5
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Shop Columns
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-grids]',
+ 'type' => 'control',
+ 'control' => 'ast-responsive-slider',
+ 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
+ 'section' => 'section-edd-archive',
+ 'default' => astra_get_option(
+ 'edd-archive-grids',
+ array(
+ 'desktop' => 4,
+ 'tablet' => 3,
+ 'mobile' => 2,
+ )
+ ),
+ 'priority' => 10,
+ 'title' => __( 'Archive Columns', 'astra' ),
+ 'input_attrs' => array(
+ 'step' => 1,
+ 'min' => 1,
+ 'max' => 6,
+ ),
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+ 'transport' => 'postMessage',
+ ),
+
+ /**
+ * Option: EDD Archive Post Meta
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]',
+ 'type' => 'control',
+ 'control' => 'ast-sortable',
+ 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ),
+ 'section' => 'section-edd-archive',
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+ 'default' => astra_get_option( 'edd-archive-product-structure' ),
+ 'priority' => 30,
+ 'title' => __( 'Product Structure', 'astra' ),
+ 'description' => __( 'The Image option cannot be sortable if the Product Style is selected to the List Style ', 'astra' ),
+ 'choices' => array(
+ 'image' => __( 'Image', 'astra' ),
+ 'category' => __( 'Category', 'astra' ),
+ 'title' => __( 'Title', 'astra' ),
+ 'price' => __( 'Price', 'astra' ),
+ 'short_desc' => __( 'Short Description', 'astra' ),
+ 'add_cart' => __( 'Add To Cart', 'astra' ),
+ ),
+ ),
+
+ /**
+ * Option: Add to Cart button text
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-add-to-cart-button-text]',
+ 'type' => 'control',
+ 'control' => 'text',
+ 'section' => 'section-edd-archive',
+ 'default' => astra_get_option( 'edd-archive-add-to-cart-button-text' ),
+ 'priority' => 31,
+ 'title' => __( 'Cart Button Text', 'astra' ),
+ 'context' => array(
+ Astra_Builder_Helper::$general_tab_config,
+ array(
+ 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]',
+ 'operator' => 'contains',
+ 'value' => 'add_cart',
+ ),
+ ),
+ ),
+
+ /**
+ * Option: Variable product button
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-variable-button]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'section' => 'section-edd-archive',
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ),
+ 'default' => astra_get_option( 'edd-archive-variable-button' ),
+ 'context' => array(
+ Astra_Builder_Helper::$general_tab_config,
+ array(
+ 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-product-structure]',
+ 'operator' => 'contains',
+ 'value' => 'add_cart',
+ ),
+ ),
+ 'priority' => 31,
+ 'title' => __( 'Variable Product Button', 'astra' ),
+ 'choices' => array(
+ 'button' => __( 'Button', 'astra' ),
+ 'options' => __( 'Options', 'astra' ),
+ ),
+ ),
+
+ /**
+ * Option: Variable product button text
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-variable-button-text]',
+ 'type' => 'control',
+ 'control' => 'text',
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+ 'section' => 'section-edd-archive',
+ 'default' => astra_get_option( 'edd-archive-variable-button-text' ),
+ 'context' => array(
+ Astra_Builder_Helper::$general_tab_config,
+ array(
+ 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-variable-button]',
+ 'operator' => '==',
+ 'value' => 'button',
+ ),
+ ),
+ 'priority' => 31,
+ 'title' => __( 'Variable Product Button Text', 'astra' ),
+ ),
+
+ /**
+ * Option: Archive Content Width
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-width]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'section' => 'section-edd-archive',
+ 'default' => astra_get_option( 'edd-archive-width' ),
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+ 'priority' => 220,
+ 'title' => __( 'Archive Content Width', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'custom' => __( 'Custom', 'astra' ),
+ ),
+ 'transport' => 'postMessage',
+ ),
+
+ /**
+ * Option: Enter Width
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[edd-archive-max-width]',
+ 'type' => 'control',
+ 'control' => 'ast-slider',
+ 'section' => 'section-edd-archive',
+ 'default' => astra_get_option( 'edd-archive-max-width' ),
+ 'priority' => 225,
+ 'context' => array(
+ Astra_Builder_Helper::$general_tab_config,
+ array(
+ 'setting' => ASTRA_THEME_SETTINGS . '[edd-archive-width]',
+ 'operator' => '===',
+ 'value' => 'custom',
+ ),
+ ),
+
+ 'title' => __( 'Custom Width', 'astra' ),
+ 'transport' => 'postMessage',
+ 'suffix' => 'px',
+ 'input_attrs' => array(
+ 'min' => 768,
+ 'step' => 1,
+ 'max' => 1920,
+ ),
+ ),
+ );
+
+ $configurations = array_merge( $configurations, $_configs );
+
+ return $configurations;
+
+ }
+ }
+}
+
+new Astra_Edd_Archive_Layout_Configs();
+
diff --git a/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php b/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php
new file mode 100644
index 0000000..64e163b
--- /dev/null
+++ b/inc/compatibility/edd/customizer/sections/layout/class-astra-edd-single-product-layout-configs.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Easy Digital Downloads Options for Astra Theme.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.5.5
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Edd_Single_Product_Layout_Configs' ) ) {
+
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Edd_Single_Product_Layout_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra-Easy Digital Downloads Shop Cart Layout Customizer Configurations.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.5.5
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Cart upsells
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[disable-edd-single-product-nav]',
+ 'section' => 'section-edd-single',
+ 'type' => 'control',
+ 'control' => 'ast-toggle-control',
+ 'default' => astra_get_option( 'disable-edd-single-product-nav' ),
+ 'title' => __( 'Disable Product Navigation', 'astra' ),
+ 'priority' => 10,
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+ }
+ }
+}
+
+new Astra_Edd_Single_Product_Layout_Configs();
diff --git a/inc/compatibility/edd/edd-common-functions.php b/inc/compatibility/edd/edd-common-functions.php
new file mode 100644
index 0000000..7bcbca6
--- /dev/null
+++ b/inc/compatibility/edd/edd-common-functions.php
@@ -0,0 +1,324 @@
+<?php
+/**
+ * Custom functions that used for Easy Digital Downloads compatibility.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.5.5
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Current Page is EDD page
+ */
+if ( ! function_exists( 'astra_is_edd_page' ) ) :
+
+ /**
+ * Check current page is an EDD page
+ *
+ * @since 1.5.5
+ * @return bool true | false
+ */
+ function astra_is_edd_page() {
+ if (
+ is_singular( 'download' ) ||
+ is_post_type_archive( 'download' ) ||
+ is_tax( 'download_category' ) ||
+ is_tax( 'download_tag' ) ||
+ edd_is_checkout() ||
+ edd_is_success_page() ||
+ edd_is_failed_transaction_page() ||
+ edd_is_purchase_history_page()
+ ) {
+ return true;
+ }
+ return false;
+ }
+
+endif;
+
+/**
+ * Current Page is EDD single page
+ */
+if ( ! function_exists( 'astra_is_edd_single_page' ) ) :
+
+ /**
+ * Check current page is an EDD single page
+ *
+ * @since 1.5.5
+ * @return bool true | false
+ */
+ function astra_is_edd_single_page() {
+ if (
+ is_singular( 'download' ) ||
+ edd_is_checkout() ||
+ edd_is_success_page() ||
+ edd_is_failed_transaction_page() ||
+ edd_is_purchase_history_page()
+ ) {
+ return true;
+ }
+ return false;
+ }
+
+endif;
+
+/**
+ * Current Page is EDD archive page
+ */
+if ( ! function_exists( 'astra_is_edd_archive_page' ) ) :
+
+ /**
+ * Check current page is an EDD archive page
+ *
+ * @since 1.5.5
+ * @return bool true | false
+ */
+ function astra_is_edd_archive_page() {
+ if (
+ is_post_type_archive( 'download' ) ||
+ is_tax( 'download_category' ) ||
+ is_tax( 'download_tag' )
+ ) {
+ return true;
+ }
+ return false;
+ }
+
+endif;
+
+
+/**
+ * Current Page is EDD single Product page
+ */
+if ( ! function_exists( 'astra_is_edd_single_product_page' ) ) :
+
+ /**
+ * Check current page is an EDD single product page
+ *
+ * @since 1.5.5
+ * @return bool true | false
+ */
+ function astra_is_edd_single_product_page() {
+ if ( is_singular( 'download' ) ) {
+ return true;
+ }
+ return false;
+ }
+
+endif;
+
+if ( ! function_exists( 'astra_edd_archive_product_structure' ) ) {
+
+ /**
+ * Show the product title in the product loop. By default this is an H2.
+ */
+ function astra_edd_archive_product_structure() {
+ $edd_structure = apply_filters( 'astra_edd_archive_product_structure', astra_get_option( 'edd-archive-product-structure' ) );
+
+ if ( is_array( $edd_structure ) && ! empty( $edd_structure ) ) {
+
+ do_action( 'astra_edd_archive_before_block_wrap' );
+ echo '<div class="ast-edd-archive-block-wrap">';
+ do_action( 'astra_edd_archive_block_wrap_top' );
+
+ foreach ( $edd_structure as $value ) {
+
+ switch ( $value ) {
+ case 'title':
+ /**
+ * Add Product Title on edd page for all products.
+ */
+ do_action( 'astra_edd_archive_title_before' );
+ do_action( 'astra_edd_archive_title' );
+ do_action( 'astra_edd_archive_title_after' );
+ break;
+ case 'image':
+ /**
+ * Add Product Title on edd page for all products.
+ */
+ do_action( 'astra_edd_archive_image_before' );
+ do_action( 'astra_edd_archive_image' );
+ do_action( 'astra_edd_archive_image_after' );
+ break;
+ case 'price':
+ /**
+ * Add Product Price on edd page for all products.
+ */
+ do_action( 'astra_edd_archive_price_before' );
+ do_action( 'astra_edd_archive_price' );
+ do_action( 'astra_edd_archive_price_after' );
+ break;
+ case 'short_desc':
+ /**
+ * Add Product short description on edd page for all products.
+ */
+ do_action( 'astra_edd_archive_short_description_before' );
+ do_action( 'astra_edd_archive_short_description' );
+ do_action( 'astra_edd_archive_short_description_after' );
+ break;
+ case 'add_cart':
+ /**
+ * Add to cart on edd page for all products.
+ */
+ do_action( 'astra_edd_archive_add_to_cart_before' );
+ do_action( 'astra_edd_archive_add_to_cart' );
+ do_action( 'astra_edd_archive_add_to_cart_after' );
+
+ break;
+ case 'category':
+ /**
+ * Add and/or Remove Categories from edd archive page.
+ */
+ do_action( 'astra_edd_archive_category_before' );
+ do_action( 'astra_edd_archive_category' );
+ do_action( 'astra_edd_archive_category_after' );
+ break;
+ default:
+ break;
+ }
+ }
+
+ do_action( 'astra_edd_archive_block_wrap_bottom' );
+ echo '</div>';
+ do_action( 'astra_edd_archive_after_block_wrap' );
+ }
+ }
+
+ add_action( 'astra_edd_archive_product_content', 'astra_edd_archive_product_structure' );
+}
+
+/**
+ * Returns list of Easy Digital Downloads Terms
+ */
+if ( ! function_exists( 'astra_edd_terms_list' ) ) {
+ /**
+ * Show EDD product terms
+ *
+ * @param string $taxonomy_name Taxonomy name.
+ * @return void
+ */
+ function astra_edd_terms_list( $taxonomy_name ) {
+ $terms = get_terms( $taxonomy_name );
+ ?>
+ <div class="ast-edd-download-categories">
+ <?php foreach ( $terms as $term ) : ?>
+ <a href="<?php echo esc_url( get_term_link( $term, $taxonomy_name ) ); ?>" title="<?php echo esc_attr( $term->name ); ?>"> <?php echo esc_html( $term->name ); ?> </a>
+ <?php endforeach; ?>
+ </div>
+ <?php
+ }
+}
+
+if ( ! function_exists( 'astra_edd_archive_product_title' ) ) {
+ /**
+ * Show EDD archive product title
+ *
+ * @return void
+ */
+ function astra_edd_archive_product_title() {
+ edd_get_template_part( 'shortcode', 'content-title' );
+ }
+
+ add_action( 'astra_edd_archive_title', 'astra_edd_archive_product_title' );
+}
+
+if ( ! function_exists( 'astra_edd_archive_product_image' ) ) {
+ /**
+ * Show EDD archive product image
+ *
+ * @return void
+ */
+ function astra_edd_archive_product_image() {
+ edd_get_template_part( 'shortcode', 'content-image' );
+ }
+
+ add_action( 'astra_edd_archive_image', 'astra_edd_archive_product_image' );
+}
+
+if ( ! function_exists( 'astra_edd_archive_product_price' ) ) {
+ /**
+ * Show EDD archive product price
+ *
+ * @return void
+ */
+ function astra_edd_archive_product_price() {
+ edd_get_template_part( 'shortcode', 'content-price' );
+ }
+
+ add_action( 'astra_edd_archive_price', 'astra_edd_archive_product_price' );
+}
+
+if ( ! function_exists( 'astra_edd_archive_product_short_description' ) ) {
+ /**
+ * Show EDD archive product description
+ *
+ * @return void
+ */
+ function astra_edd_archive_product_short_description() {
+ edd_get_template_part( 'shortcode', 'content-excerpt' );
+ }
+
+ add_action( 'astra_edd_archive_short_description', 'astra_edd_archive_product_short_description' );
+}
+
+if ( ! function_exists( 'astra_edd_archive_product_add_to_cart' ) ) {
+ /**
+ * Show EDD archive product add to cart
+ *
+ * @return void
+ */
+ function astra_edd_archive_product_add_to_cart() {
+ echo astra_edd_cart_button_markup(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+ }
+
+ add_action( 'astra_edd_archive_add_to_cart', 'astra_edd_archive_product_add_to_cart' );
+}
+
+
+if ( ! function_exists( 'astra_edd_archive_product_category' ) ) {
+ /**
+ * Show EDD archive product category
+ *
+ * @return void
+ */
+ function astra_edd_archive_product_category() {
+ echo astra_edd_terms_list( 'download_category' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+ }
+
+ add_action( 'astra_edd_archive_category', 'astra_edd_archive_product_category' );
+}
+
+
+/**
+ * EDD archive page Cart button markup
+ *
+ * @return array $output Add to cart button markup
+ */
+function astra_edd_cart_button_markup() {
+ $variable_button = astra_get_option( 'edd-archive-variable-button' );
+ $add_to_cart_text = astra_get_option( 'edd-archive-add-to-cart-button-text' );
+ $variable_button_text = astra_get_option( 'edd-archive-variable-button-text' );
+ $output = edd_get_purchase_link();
+ if ( edd_has_variable_prices( get_the_ID() ) && 'button' == $variable_button ) {
+ $output = '<div class="ast-edd-variable-details-button-wrap">';
+ $output .= '<a class="button ast-edd-variable-btn" href="' . esc_url( get_permalink() ) . '">' . esc_html( $variable_button_text ) . '</a>';
+ $output .= '</div>';
+ } else {
+ if ( ! empty( $add_to_cart_text ) ) {
+ $output = edd_get_purchase_link(
+ array(
+ 'price' => false,
+ 'text' => esc_html( $add_to_cart_text ),
+ )
+ );
+ }
+ }
+
+ return $output;
+}
diff --git a/inc/compatibility/index.php b/inc/compatibility/index.php
new file mode 100644
index 0000000..8b96815
--- /dev/null
+++ b/inc/compatibility/index.php
@@ -0,0 +1,9 @@
+<?php
+/**
+ * Index file
+ *
+ * @package Astra
+ * @since Astra 1.0.0
+ */
+
+/* Silence is golden, and we agree. */
diff --git a/inc/compatibility/learndash/class-astra-learndash.php b/inc/compatibility/learndash/class-astra-learndash.php
new file mode 100644
index 0000000..b3bec94
--- /dev/null
+++ b/inc/compatibility/learndash/class-astra-learndash.php
@@ -0,0 +1,677 @@
+<?php
+/**
+ * LearnDash Compatibility File.
+ *
+ * @package Astra
+ * @since 1.3.0
+ */
+
+// If plugin - 'LearnDash' not exist then return.
+if ( ! class_exists( 'SFWD_LMS' ) ) {
+ return;
+}
+
+/**
+ * Astra LearnDash Compatibility
+ */
+if ( ! class_exists( 'Astra_LearnDash' ) ) :
+
+ /**
+ * Astra LearnDash Compatibility
+ *
+ * @since 1.3.0
+ */
+ class Astra_LearnDash {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+
+ add_filter( 'astra_theme_assets', array( $this, 'add_styles' ) );
+ add_filter( 'astra_dynamic_theme_css', array( $this, 'add_dynamic_styles' ) );
+
+ add_action( 'customize_register', array( $this, 'customize_register' ), 2 );
+ add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
+
+ // Sidebar Layout.
+ add_filter( 'astra_page_layout', array( $this, 'sidebar_layout' ) );
+ // Content Layout.
+ add_filter( 'astra_get_content_layout', array( $this, 'content_layout' ) );
+ }
+
+ /**
+ * Enqueue styles
+ *
+ * @param String $dynamic_css Astra Dynamic CSS.
+ * @param String $dynamic_css_filtered Astra Dynamic CSS Filters.
+ * @since 1.3.0
+ * @return String Dynamic CSS.
+ */
+ public function add_dynamic_styles( $dynamic_css, $dynamic_css_filtered = '' ) {
+
+ $active_ld_theme = '';
+
+ if ( is_callable( 'LearnDash_Theme_Register::get_active_theme_key' ) ) {
+ $active_ld_theme = LearnDash_Theme_Register::get_active_theme_key();
+ }
+
+ if ( 'ld30' === $active_ld_theme ) {
+ return $dynamic_css;
+ }
+
+ $dynamic_css .= self::ld_static_css();
+ /**
+ * - Variable Declaration
+ */
+ $is_site_rtl = is_rtl();
+ $link_color = astra_get_option( 'link-color' );
+ $theme_color = astra_get_option( 'theme-color' );
+ $text_color = astra_get_option( 'text-color' );
+ $link_h_color = astra_get_option( 'link-h-color' );
+
+ $body_font_family = astra_body_font_family();
+
+ $link_forground_color = astra_get_foreground_color( $link_color );
+ $theme_forground_color = astra_get_foreground_color( $theme_color );
+ $btn_color = astra_get_option( 'button-color' );
+ if ( empty( $btn_color ) ) {
+ $btn_color = $link_forground_color;
+ }
+
+ $btn_h_color = astra_get_option( 'button-h-color' );
+ if ( empty( $btn_h_color ) ) {
+ $btn_h_color = astra_get_foreground_color( $link_h_color );
+ }
+ $btn_bg_color = astra_get_option( 'button-bg-color', '', $theme_color );
+ $btn_bg_h_color = astra_get_option( 'button-bg-h-color', '', $link_h_color );
+
+ $btn_border_radius = astra_get_option( 'button-radius' );
+
+ $archive_post_title_font_size = astra_get_option( 'font-size-page-title' );
+
+ $css_output = array(
+ 'body #learndash_lessons a, body #learndash_quizzes a, body .expand_collapse a, body .learndash_topic_dots a, body .learndash_topic_dots a > span, body #learndash_lesson_topics_list span a, body #learndash_profile a, body #learndash_profile a span' => array(
+ 'font-family' => astra_get_font_family( $body_font_family ),
+ ),
+ 'body #ld_course_list .btn, body a.btn-blue, body a.btn-blue:visited, body a#quiz_continue_link, body .btn-join, body .learndash_checkout_buttons input.btn-join[type="button"], body #btn-join, body .learndash_checkout_buttons input.btn-join[type="submit"], body .wpProQuiz_content .wpProQuiz_button2' => array(
+ 'color' => $btn_color,
+ 'border-color' => $btn_bg_color,
+ 'background-color' => $btn_bg_color,
+ 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ),
+ ),
+ 'body #ld_course_list .btn:hover, body #ld_course_list .btn:focus, body a.btn-blue:hover, body a.btn-blue:focus, body a#quiz_continue_link:hover, body a#quiz_continue_link:focus, body .btn-join:hover, body .learndash_checkout_buttons input.btn-join[type="button"]:hover, body .btn-join:focus, body .learndash_checkout_buttons input.btn-join[type="button"]:focus, .wpProQuiz_content .wpProQuiz_button2:hover, .wpProQuiz_content .wpProQuiz_button2:focus, body #btn-join:hover, body .learndash_checkout_buttons input.btn-join[type="submit"]:hover, body #btn-join:focus, body .learndash_checkout_buttons input.btn-join[type="submit"]:focus' => array(
+ 'color' => $btn_h_color,
+ 'border-color' => $btn_bg_h_color,
+ 'background-color' => $btn_bg_h_color,
+ ),
+ 'body dd.course_progress div.course_progress_blue, body .wpProQuiz_content .wpProQuiz_time_limit .wpProQuiz_progress' => array(
+ 'background-color' => $theme_color,
+ ),
+ 'body #learndash_lessons a, body #learndash_quizzes a, body .expand_collapse a, body .learndash_topic_dots a, body .learndash_topic_dots a > span, body #learndash_lesson_topics_list span a, body #learndash_profile a, #learndash_profile .profile_edit_profile a, body #learndash_profile .expand_collapse a, body #learndash_profile a span, #lessons_list .list-count, #quiz_list .list-count' => array(
+ 'color' => $link_color,
+ ),
+ '.learndash .notcompleted:before, #learndash_profile .notcompleted:before, .learndash_topic_dots ul .topic-notcompleted span:before, .learndash_navigation_lesson_topics_list .topic-notcompleted span:before, .learndash_navigation_lesson_topics_list ul .topic-notcompleted span:before, .learndash .topic-notcompleted span:before' => array(
+ 'color' => astra_hex_to_rgba( $text_color, .5 ),
+ ),
+ 'body .thumbnail.course .ld_course_grid_price, body .thumbnail.course .ld_course_grid_price.ribbon-enrolled, body #learndash_lessons #lesson_heading, body #learndash_profile .learndash_profile_heading, body #learndash_quizzes #quiz_heading, body #learndash_lesson_topics_list div > strong, body .learndash-pager span a, body #learndash_profile .learndash_profile_quiz_heading' => array(
+ 'background-color' => $theme_color,
+ 'color' => $theme_forground_color,
+ ),
+ '.learndash .completed:before, #learndash_profile .completed:before, .learndash_topic_dots ul .topic-completed span:before, .learndash_navigation_lesson_topics_list .topic-completed span:before, .learndash_navigation_lesson_topics_list ul .topic-completed span:before, .learndash .topic-completed span:before, body .list_arrow.lesson_completed:before' => array(
+ 'color' => $theme_color,
+ ),
+ 'body .thumbnail.course .ld_course_grid_price:before' => array(
+ 'border-top-color' => astra_hex_to_rgba( $theme_color, .75 ),
+ 'border-right-color' => astra_hex_to_rgba( $theme_color, .75 ),
+ ),
+ 'body .wpProQuiz_loadQuiz, body .wpProQuiz_lock' => array(
+ 'border-color' => astra_hex_to_rgba( $link_color, .5 ),
+ 'background-color' => astra_hex_to_rgba( $link_color, .1 ),
+ ),
+ '#ld_course_list .entry-title' => array(
+ 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'desktop' ),
+ ),
+ );
+
+ if ( ! astra_get_option( 'learndash-lesson-serial-number' ) ) {
+ $css_output['body #course_list .list-count, body #lessons_list .list-count, body #quiz_list .list-count'] = array(
+ 'display' => 'none',
+ );
+ $css_output['body #course_list > div h4 > a, body #lessons_list > div h4 > a, body #quiz_list > div h4 > a, body #learndash_course_content .learndash_topic_dots ul > li a'] = array(
+ 'padding-left' => '.75em',
+ 'margin-left' => 'auto',
+ );
+ }
+ if ( ! astra_get_option( 'learndash-differentiate-rows' ) ) {
+ $css_output['body #course_list > div:nth-of-type(odd), body #lessons_list > div:nth-of-type(odd), body #quiz_list > div:nth-of-type(odd), body #learndash_lesson_topics_list .learndash_topic_dots ul > li.nth-of-type-odd'] = array(
+ 'background' => 'none',
+ );
+ }
+
+ /* Parse CSS from array() */
+ $css_output = astra_parse_css( $css_output );
+
+ $tablet_typography = array(
+ '#ld_course_list .entry-title' => array(
+ 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'tablet', 30 ),
+ ),
+ );
+ /* Parse CSS from array()*/
+ $css_output .= astra_parse_css( $tablet_typography, '', astra_get_tablet_breakpoint() );
+
+ if ( $is_site_rtl ) {
+ $mobile_min_width_css = array(
+ 'body #learndash_profile .profile_edit_profile' => array(
+ 'position' => 'absolute',
+ 'top' => '15px',
+ 'left' => '15px',
+ ),
+ );
+ } else {
+ $mobile_min_width_css = array(
+ 'body #learndash_profile .profile_edit_profile' => array(
+ 'position' => 'absolute',
+ 'top' => '15px',
+ 'right' => '15px',
+ ),
+ );
+ }
+
+ /* Parse CSS from array() -> min-width: (mobile-breakpoint + 1) px */
+ $css_output .= astra_parse_css( $mobile_min_width_css, astra_get_mobile_breakpoint( '', 1 ) );
+
+ $mobile_typography = array(
+ '#ld_course_list .entry-title' => array(
+ 'font-size' => astra_responsive_font( $archive_post_title_font_size, 'mobile', 30 ),
+ ),
+ '#learndash_next_prev_link a' => array(
+ 'width' => '100%',
+ ),
+ '#learndash_next_prev_link a.prev-link' => array(
+ 'margin-bottom' => '1em',
+ ),
+ '#ld_course_info_mycourses_list .ld-course-info-my-courses .ld-entry-title' => array(
+ 'margin' => '0 0 20px',
+ ),
+ );
+
+ /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */
+ $css_output .= astra_parse_css( $mobile_typography, '', astra_get_mobile_breakpoint() );
+
+ if ( $is_site_rtl ) {
+ $mobile_typography_lang_direction_css = array(
+ '#ld_course_info_mycourses_list .ld-course-info-my-courses img' => array(
+ 'display' => 'block',
+ 'margin-right' => 'initial',
+ 'max-width' => '100%',
+ 'margin' => '10px 0',
+ ),
+ );
+ } else {
+ $mobile_typography_lang_direction_css = array(
+ '#ld_course_info_mycourses_list .ld-course-info-my-courses img' => array(
+ 'display' => 'block',
+ 'margin-left' => 'initial',
+ 'max-width' => '100%',
+ 'margin' => '10px 0',
+ ),
+ );
+ }
+
+ /* Parse CSS from array() -> max-width: (mobile-breakpoint) px */
+ $css_output .= astra_parse_css( $mobile_typography_lang_direction_css, '', astra_get_mobile_breakpoint() );
+
+ $dynamic_css .= apply_filters( 'astra_theme_learndash_dynamic_css', $css_output );
+
+ return $dynamic_css;
+ }
+
+ /**
+ * Register Customizer sections and panel for learndash.
+ *
+ * @since 1.3.0
+ * @param WP_Customize_Manager $wp_customize Theme Customizer object.
+ */
+ public function customize_register( $wp_customize ) {
+
+ $active_ld_theme = '';
+
+ if ( is_callable( 'LearnDash_Theme_Register::get_active_theme_key' ) ) {
+ $active_ld_theme = LearnDash_Theme_Register::get_active_theme_key();
+ }
+
+ // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ /**
+ * Register Sections & Panels
+ */
+ require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php';
+
+ /**
+ * Sections
+ */
+ require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php';
+ require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php';
+
+ if ( 'ld30' !== $active_ld_theme ) {
+ require ASTRA_THEME_DIR . 'inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php';
+ }
+ // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ }
+
+ /**
+ * Theme Defaults.
+ *
+ * @since 1.3.0
+ * @param array $defaults Array of options value.
+ * @return array
+ */
+ public function theme_defaults( $defaults ) {
+
+ // General.
+ $defaults['learndash-lesson-serial-number'] = false;
+ $defaults['learndash-differentiate-rows'] = true;
+
+ // Container.
+ $defaults['learndash-content-layout'] = 'plain-container';
+
+ // Sidebar.
+ $defaults['learndash-sidebar-layout'] = 'default';
+
+ return $defaults;
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @since 1.3.0
+ * @param array $assets list of theme assets (JS & CSS).
+ * @return array List of updated assets.
+ */
+ public function add_styles( $assets ) {
+ $assets['css']['astra-learndash'] = 'compatibility/learndash';
+ return $assets;
+ }
+
+ /**
+ * LeanDash Sidebar
+ *
+ * @since 1.3.0
+ * @param string $layout Layout type.
+ * @return string $layout Layout type.
+ */
+ public function sidebar_layout( $layout ) {
+
+ if ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) || is_singular( 'sfwd-certificates' ) || is_singular( 'sfwd-assignment' ) ) {
+
+ $learndash_sidebar = astra_get_option( 'learndash-sidebar-layout' );
+ if ( 'default' !== $learndash_sidebar ) {
+ $layout = $learndash_sidebar;
+ }
+
+ $sidebar = astra_get_option_meta( 'site-sidebar-layout', '', true );
+
+ if ( 'default' !== $sidebar && ! empty( $sidebar ) ) {
+ $layout = $sidebar;
+ }
+ }
+
+ // When Learhdash shortoce is used on the Page.
+ // Applied only to the pages which uses the learndash shortcode.
+ global $learndash_shortcode_used;
+
+ if ( $learndash_shortcode_used && ! ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) || is_singular( 'sfwd-certificates' ) || is_singular( 'sfwd-assignment' ) ) ) {
+ // Page Meta Sidebar.
+ $layout = astra_get_option_meta( 'site-sidebar-layout', '', true );
+ if ( empty( $layout ) ) {
+ // Page Sidebar.
+ $layout = astra_get_option( 'single-page-sidebar-layout' );
+ // Default Site Sidebar.
+ if ( 'default' == $layout || empty( $layout ) ) {
+ // Get the global sidebar value.
+ // NOTE: Here not used `true` in the below function call.
+ $layout = astra_get_option( 'site-sidebar-layout' );
+ }
+ }
+ }
+ return $layout;
+ }
+
+ /**
+ * LeanDash Container
+ *
+ * @since 1.3.0
+ * @param string $layout Layout type.
+ * @return string $layout Layout type.
+ */
+ public function content_layout( $layout ) {
+
+ if ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) || is_singular( 'sfwd-certificates' ) || is_singular( 'sfwd-assignment' ) ) {
+
+ $learndash_layout = astra_get_option( 'learndash-content-layout' );
+
+ if ( 'default' !== $learndash_layout ) {
+ $layout = $learndash_layout;
+ }
+
+ $learndash_layout = astra_get_option_meta( 'site-content-layout', '', true );
+
+ if ( 'default' !== $learndash_layout && ! empty( $learndash_layout ) ) {
+ $layout = $learndash_layout;
+ }
+ }
+
+ return $layout;
+ }
+
+ /**
+ * LearnDash Static CSS.
+ *
+ * @since 3.3.0
+ * @return string
+ */
+ public static function ld_static_css() {
+ $ld_static_css = '
+ .learndash .completed:before,
+ .learndash .notcompleted:before,
+ #learndash_profile .completed:before,
+ #learndash_profile .notcompleted:before {
+ content: "\e903";
+ display: inline-block;
+ font-family: "Astra";
+ text-rendering: auto;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ float: left;
+ text-indent: 0;
+ font-size: 1.5em;
+ line-height: 1;
+ }
+
+ .learndash .completed:before,
+ #learndash_profile .completed:before {
+ content: "\e901";
+ font-weight: bold;
+ }
+
+ .learndash .completed:before,
+ .learndash .notcompleted:before {
+ position: absolute;
+ top: 8px;
+ right: .75em;
+ width: 1.75em;
+ text-align: center;
+ line-height: 1.2;
+ }
+
+ .learndash .topic-completed span,
+ .learndash .topic-notcompleted span {
+ background: none;
+ padding: 0;
+ }
+
+ .learndash .topic-completed span:before,
+ .learndash .topic-notcompleted span:before {
+ content: "\e903";
+ display: inline-block;
+ font-family: "Astra";
+ text-rendering: auto;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ font-size: 1.25em;
+ }
+
+ .learndash .topic-completed span:before {
+ content: "\e901";
+ font-weight: bold;
+ }
+
+ body .learndash .completed,
+ body .learndash .notcompleted,
+ body #learndash_profile .completed,
+ body #learndash_profile .notcompleted {
+ line-height: 1.7;
+ background: none;
+ }
+
+ body .learndash_profile_heading,
+ body #learndash_profile a,
+ body #learndash_profile div
+ {
+ ont-size: 1em;
+ font-weight: inherit;
+ }
+
+ body #lessons_list > div h4,
+ body #course_list > div h4,
+ body #quiz_list > div h4,
+ body #learndash_lesson_topics_list ul > li > span.topic_item {
+ font-size: 1em;
+ }
+
+ body #learndash_lessons #lesson_heading,
+ body #learndash_profile .learndash_profile_heading,
+ body #learndash_quizzes #quiz_heading,
+ body #learndash_lesson_topics_list div > strong {
+ padding: 10px .75em;
+ font-weight: 600;
+ text-transform: uppercase;
+ border-radius: 0;
+ }
+
+ body #learndash_lessons .right,
+ body #learndash_quizzes .right {
+ width: auto;
+ }
+
+ body .expand_collapse .expand_collapse,
+ body #learndash_profile .expand_collapse {
+ top: -1em;
+ }
+
+ body .expand_collapse .expand_collapse a,
+ body #learndash_profile .expand_collapse a {
+ font-size: .8em;
+ }
+
+ body .expand_collapse .list_arrow.collapse, body .expand_collapse .list_arrow.expand,
+ body #learndash_profile .list_arrow.collapse,
+ body #learndash_profile .list_arrow.expand {
+ vertical-align: top;
+ }
+
+ body .expand_collapse .list_arrow.collapse:before, body .expand_collapse .list_arrow.expand:before,
+ body #learndash_profile .list_arrow.collapse:before,
+ body #learndash_profile .list_arrow.expand:before {
+ content: "\e900";
+ transform: rotate(270deg);
+ font-weight: bold;
+ }
+
+ body .expand_collapse .list_arrow.expand:before,
+ body #learndash_profile .list_arrow.expand:before {
+ transform: rotate(0deg);
+ }
+ body #learndash_lessons #lesson_heading,
+ body #learndash_profile .learndash_profile_heading,
+ body #learndash_quizzes #quiz_heading,
+ body #learndash_lesson_topics_list div > strong {
+ padding: 10px .75em;
+ font-weight: 600;
+ text-transform: uppercase;
+ border-radius: 0;
+ }
+ body #learndash_lesson_topics_list ul > li > span.topic_item:hover {
+ background: none;
+ }
+
+ body #learndash_lesson_topics_list .learndash_topic_dots {
+ order: none;
+ box-shadow: none;
+ }
+
+ body #learndash_lesson_topics_list .learndash_topic_dots ul {
+ border: 1px solid #e2e2e2;
+ border-top: none;
+ overflow: hidden;
+ }
+
+ body #learndash_lesson_topics_list .learndash_topic_dots ul > li:last-child a {
+ border-bottom: none;
+ }
+
+ body #learndash_lesson_topics_list .learndash_topic_dots ul > li.nth-of-type-odd {
+ background: #fbfbfb;
+ }
+
+ body #learndash_lesson_topics_list .learndash_topic_dots .topic-completed,
+ body #learndash_lesson_topics_list .learndash_topic_dots .topic-notcompleted {
+ padding: 8px .75em;
+ border-bottom: 1px solid #ddd;
+ }
+
+ body #learndash_lesson_topics_list .learndash_topic_dots .topic-completed span,
+ body #learndash_lesson_topics_list .learndash_topic_dots .topic-notcompleted span {
+ margin: 0 auto;
+ display: inline;
+ }
+ body #learndash_lesson_topics_list ul > li > span.topic_item {
+ font-size: 1em;
+ }
+ .learndash .completed:before,
+ .learndash .notcompleted:before {
+ position: absolute;
+ top: 8px;
+ right: .75em;
+ width: 1.75em;
+ text-align: center;
+ line-height: 1.2;
+ }
+ .learndash .topic-completed span,
+ .learndash .topic-notcompleted span {
+ background: none;
+ padding: 0;
+ }
+ .learndash .topic-completed span:before,
+ .learndash .topic-notcompleted span:before {
+ content: "\e903";
+ display: inline-block;
+ font-family: "Astra";
+ text-rendering: auto;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ font-size: 1.25em;
+ }
+ .learndash .topic-completed span:before {
+ content: "\e901";
+ font-weight: bold;
+ }
+ .widget_ldcoursenavigation .learndash_topic_widget_list .topic-completed span:before,
+ .widget_ldcoursenavigation .learndash_topic_widget_list .topic-notcompleted span:before {
+ margin-left: 1px;
+ margin-right: 9px;
+ }
+ body .learndash_navigation_lesson_topics_list .topic-notcompleted span,
+ body .learndash_navigation_lesson_topics_list ul .topic-notcompleted span,
+ body .learndash_topic_dots .topic-notcompleted span,
+ body .learndash_topic_dots ul .topic-notcompleted span {
+ margin: 5px 0;
+ }
+
+ body .learndash_navigation_lesson_topics_list .topic-completed span,
+ body .learndash_navigation_lesson_topics_list .topic-notcompleted span,
+ body .learndash_navigation_lesson_topics_list ul .topic-completed span,
+ body .learndash_navigation_lesson_topics_list ul .topic-notcompleted span,
+ body .learndash_topic_dots .topic-completed span,
+ body .learndash_topic_dots .topic-notcompleted span,
+ body .learndash_topic_dots ul .topic-completed span,
+ body .learndash_topic_dots ul .topic-notcompleted span {
+ padding-left: 0;
+ background: none;
+ margin: 5px 0;
+ }
+
+ body .learndash_navigation_lesson_topics_list .topic-completed span:before,
+ body .learndash_navigation_lesson_topics_list .topic-notcompleted span:before,
+ body .learndash_navigation_lesson_topics_list ul .topic-completed span:before,
+ body .learndash_navigation_lesson_topics_list ul .topic-notcompleted span:before,
+ body .learndash_topic_dots .topic-completed span:before,
+ body .learndash_topic_dots .topic-notcompleted span:before,
+ body .learndash_topic_dots ul .topic-completed span:before,
+ body .learndash_topic_dots ul .topic-notcompleted span:before {
+ content: "\e903";
+ display: inline-block;
+ font-family: "Astra";
+ text-rendering: auto;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ font-size: 1em;
+ font-weight: normal;
+ margin-right: 10px;
+ }
+
+ body .learndash_navigation_lesson_topics_list .topic-completed span:before,
+ body .learndash_navigation_lesson_topics_list ul .topic-completed span:before,
+ body .learndash_topic_dots .topic-completed span:before,
+ body .learndash_topic_dots ul .topic-completed span:before {
+ content: "\e901";
+ font-weight: bold;
+ }
+ .widget_ldcoursenavigation .learndash_topic_widget_list .topic-completed span:before,
+ .widget_ldcoursenavigation .learndash_topic_widget_list .topic-notcompleted span:before {
+ margin-left: 1px;
+ margin-right: 9px;
+ }
+ body .learndash .topic-completed span,
+ body .learndash .topic-notcompleted span {
+ background: none;
+ padding: 0;
+ }
+ #learndash_next_prev_link {
+ margin: 0;
+ padding: 2em 0 0;
+ border-top: 1px solid #eeeeee;
+ overflow: hidden;
+ line-height: 0;
+ }
+
+ #learndash_next_prev_link a {
+ margin: 2px;
+ display: inline-block;
+ padding: 0 1.5em;
+ height: 2.33333em;
+ line-height: 2.33333em;
+ text-align: center;
+ font-size: 16px;
+ font-size: 1.06666rem;
+ }';
+ return Astra_Enqueue_Scripts::trim_css( $ld_static_css );
+ }
+ }
+
+endif;
+
+if ( apply_filters( 'astra_enable_learndash_integration', true ) ) {
+
+ /**
+ * Kicking this off by calling 'get_instance()' method
+ */
+ Astra_LearnDash::get_instance();
+}
diff --git a/inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php b/inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php
new file mode 100644
index 0000000..f9e2370
--- /dev/null
+++ b/inc/compatibility/learndash/customizer/class-astra-customizer-register-learndash-section.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Register customizer panels & sections.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since 1.2.0
+ * @since 1.4.6 Chnaged to using Astra_Customizer API
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+if ( ! class_exists( 'Astra_Customizer_Register_Learndash_Section' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Customizer_Register_Learndash_Section extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Panels and Sections for Customizer.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.2.0
+ * @since 1.4.6 Chnaged to using Astra_Customizer API
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $configs = array(
+ array(
+ 'type' => 'section',
+ 'name' => 'section-learndash',
+ 'priority' => 65,
+ 'title' => __( 'LearnDash', 'astra' ),
+ ),
+ );
+
+ return array_merge( $configurations, $configs );
+ }
+ }
+}
+
+
+new Astra_Customizer_Register_Learndash_Section();
diff --git a/inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php b/inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php
new file mode 100644
index 0000000..9e0d704
--- /dev/null
+++ b/inc/compatibility/learndash/customizer/sections/class-astra-learndash-container-configs.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Container Options for Astra theme.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since 1.3.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Learndash_Container_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Learndash_Container_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register LearnDash Container settings.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Shop Page
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[learndash-content-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'section' => 'section-container-layout',
+ 'default' => astra_get_option( 'learndash-content-layout' ),
+ 'priority' => 68,
+ 'title' => __( 'LearnDash Layout', 'astra' ),
+ 'description' => __( 'Will be applied to All Single Courses, Topics, Lessons and Quizzes. Does not work on pages created with LearnDash shortcodes.', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'boxed-container' => __( 'Boxed', 'astra' ),
+ 'content-boxed-container' => __( 'Content Boxed', 'astra' ),
+ 'plain-container' => __( 'Full Width / Contained', 'astra' ),
+ 'page-builder' => __( 'Full Width / Stretched', 'astra' ),
+ ),
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Learndash_Container_Configs();
diff --git a/inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php b/inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php
new file mode 100644
index 0000000..336afee
--- /dev/null
+++ b/inc/compatibility/learndash/customizer/sections/class-astra-learndash-sidebar-configs.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Content Spacing Options for our theme.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since 1.3.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Learndash_Sidebar_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Learndash_Sidebar_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register LearnDash Sidebar settings.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: LearnDash
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[learndash-sidebar-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'section' => 'section-sidebars',
+ 'divider' => array( 'ast_class' => 'ast-top-divider' ),
+ 'default' => astra_get_option( 'learndash-sidebar-layout' ),
+ 'priority' => 5,
+ 'title' => __( 'LearnDash', 'astra' ),
+ 'description' => __( 'This layout will apply on all single course, lesson, topic and quiz.', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'no-sidebar' => __( 'No Sidebar', 'astra' ),
+ 'left-sidebar' => __( 'Left Sidebar', 'astra' ),
+ 'right-sidebar' => __( 'Right Sidebar', 'astra' ),
+ ),
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+ }
+ }
+}
+
+new Astra_Learndash_Sidebar_Configs();
diff --git a/inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php b/inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php
new file mode 100644
index 0000000..5a3b019
--- /dev/null
+++ b/inc/compatibility/learndash/customizer/sections/layout/class-astra-learndash-general-configs.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * LifterLMS General Options for our theme.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since 1.3.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Learndash_General_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Learndash_General_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register LearnDash General Layout settings.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Display Serial Number
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[learndash-lesson-serial-number]',
+ 'section' => 'section-learndash',
+ 'type' => 'control',
+ 'control' => 'ast-toggle-control',
+ 'default' => astra_get_option( 'learndash-lesson-serial-number' ),
+ 'title' => __( 'Display Serial Number', 'astra' ),
+ 'priority' => 25,
+ 'divider' => array(
+ 'ast_class' => 'ast-top-divider',
+ 'ast_title' => __( 'Course Content Table', 'astra' ),
+ ),
+ ),
+
+ /**
+ * Option: Differentiate Rows
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[learndash-differentiate-rows]',
+ 'default' => astra_get_option( 'learndash-differentiate-rows' ),
+ 'type' => 'control',
+ 'control' => 'ast-toggle-control',
+ 'section' => 'section-learndash',
+ 'title' => __( 'Differentiate Rows', 'astra' ),
+ 'priority' => 30,
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Learndash_General_Configs();
diff --git a/inc/compatibility/lifterlms/class-astra-lifterlms.php b/inc/compatibility/lifterlms/class-astra-lifterlms.php
new file mode 100644
index 0000000..48d6344
--- /dev/null
+++ b/inc/compatibility/lifterlms/class-astra-lifterlms.php
@@ -0,0 +1,858 @@
+<?php
+/**
+ * Lifter LMS Compatibility File.
+ *
+ * @package Astra
+ * @since 1.2.0
+ */
+
+// If plugin - 'Lifter LMS' not exist then return.
+if ( ! class_exists( 'LifterLMS' ) ) {
+ return;
+}
+
+/**
+ * Astra Lifter LMS Compatibility
+ */
+if ( ! class_exists( 'Astra_LifterLMS' ) ) :
+
+ /**
+ * Astra Lifter LMS Compatibility
+ *
+ * @since 1.2.0
+ */
+ class Astra_LifterLMS {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+
+ add_action( 'wp', array( $this, 'lifterlms_init' ), 1 );
+ add_filter( 'llms_get_theme_default_sidebar', array( $this, 'add_sidebar' ) );
+ add_action( 'after_setup_theme', array( $this, 'add_theme_support' ) );
+ add_filter( 'astra_theme_assets', array( $this, 'add_styles' ) );
+ add_action( 'wp_enqueue_scripts', array( $this, 'add_dynamic_styles' ) );
+
+ add_action( 'customize_register', array( $this, 'customize_register' ), 2 );
+
+ add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
+
+ // Sidebar Layout.
+ add_filter( 'astra_page_layout', array( $this, 'sidebar_layout' ) );
+ // Content Layout.
+ add_filter( 'astra_get_content_layout', array( $this, 'content_layout' ) );
+
+ add_action( 'lifterlms_before_main_content', array( $this, 'before_main_content_start' ) );
+ add_action( 'lifterlms_after_main_content', array( $this, 'before_main_content_end' ) );
+
+ // Grid.
+ add_filter( 'lifterlms_loop_columns', array( $this, 'course_grid' ) );
+ add_filter( 'llms_get_loop_list_classes', array( $this, 'course_responsive_grid' ), 999 );
+
+ // Course builder custom fields.
+ add_filter( 'llms_builder_register_custom_fields', array( $this, 'register_builder_fields' ) );
+
+ }
+
+ /**
+ * Remove LifterLMS Default actions
+ *
+ * @since 1.2.0
+ */
+ public function lifterlms_init() {
+
+ // Page Title.
+ if ( is_courses() ) {
+ $course_page_id = get_option( 'lifterlms_shop_page_id' );
+ $course_title = get_post_meta( $course_page_id, 'site-post-title', true );
+ $main_header_display = get_post_meta( $course_page_id, 'ast-main-header-display', true );
+ $footer_layout = get_post_meta( $course_page_id, 'footer-sml-layout', true );
+
+ if ( 'disabled' === $course_title ) {
+ add_filter( 'lifterlms_show_page_title', '__return_false' );
+ }
+
+ if ( 'disabled' === $main_header_display ) {
+ remove_action( 'astra_masthead', 'astra_masthead_primary_template' );
+ }
+
+ if ( 'disabled' === $footer_layout ) {
+ remove_action( 'astra_footer_content', 'astra_footer_small_footer_template', 5 );
+ }
+ }
+
+ // Page Title.
+ if ( is_memberships() ) {
+ $membership_page_id = get_option( 'lifterlms_memberships_page_id' );
+ $membership_title = get_post_meta( $membership_page_id, 'site-post-title', true );
+ $main_header_display = get_post_meta( $membership_page_id, 'ast-main-header-display', true );
+ $footer_layout = get_post_meta( $membership_page_id, 'footer-sml-layout', true );
+
+ if ( 'disabled' === $membership_title ) {
+ add_filter( 'lifterlms_show_page_title', '__return_false' );
+ }
+
+ if ( 'disabled' === $main_header_display ) {
+ remove_action( 'astra_masthead', 'astra_masthead_primary_template' );
+ }
+
+ if ( 'disabled' === $footer_layout ) {
+ remove_action( 'astra_footer_content', 'astra_footer_small_footer_template', 5 );
+ }
+ }
+
+ remove_action( 'lifterlms_before_main_content', 'lifterlms_output_content_wrapper', 10 );
+ remove_action( 'lifterlms_after_main_content', 'lifterlms_output_content_wrapper_end', 10 );
+ remove_action( 'lifterlms_sidebar', 'lifterlms_get_sidebar' );
+
+ if ( is_lesson() ) {
+ remove_action( 'lifterlms_single_lesson_after_summary', 'lifterlms_template_lesson_navigation', 20 );
+ remove_action( 'astra_entry_after', 'astra_single_post_navigation_markup' );
+ if ( 'yes' !== apply_filters( 'llms_blocks_is_post_migrated', get_post_meta( get_the_ID(), '_llms_blocks_migrated', true ), get_the_ID() ) ) {
+ add_action( 'astra_entry_after', 'lifterlms_template_lesson_navigation' );
+ }
+ }
+
+ if ( is_quiz() || is_singular( 'llms_assignment' ) ) {
+ remove_action( 'astra_entry_after', 'astra_single_post_navigation_markup' );
+ }
+
+ $lifter_certificate_post_type = get_post_type();
+ if ( 'llms_certificate' === $lifter_certificate_post_type || 'llms_my_certificate' === $lifter_certificate_post_type ) {
+ if ( ! is_admin() ) {
+ add_filter( 'post_class', 'astra_certificate_class' );
+
+ /**
+ * Remove ast-article-single class in case of content-boxed and boxed layout.
+ *
+ * @since 2.3.3
+ * @param array $array is a array of classes.
+ * @return array
+ */
+ function astra_certificate_class( $array ) {
+ $delete_class = array_search( 'ast-article-single', $array );
+ if ( false !== $delete_class ) {
+ unset( $array[ $delete_class ] );
+ }
+ return $array;
+ }
+ }
+ }
+
+ remove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_single_reviews', 100 );
+ add_action( 'lifterlms_single_course_after_summary', array( $this, 'single_reviews' ), 100 );
+
+ remove_action( 'lifterlms_student_dashboard_header', 'lifterlms_template_student_dashboard_title', 20 );
+ }
+
+ /**
+ * Register Customizer sections and panel for lifterlms
+ *
+ * @since 1.2.0
+ * @param WP_Customize_Manager $wp_customize Theme Customizer object.
+ */
+ public function customize_register( $wp_customize ) {
+
+ // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ /**
+ * Register Sections & Panels
+ */
+ require ASTRA_THEME_DIR . 'inc/compatibility/lifterlms/customizer/class-astra-liferlms-section-configs.php';
+
+ /**
+ * Sections
+ */
+ require ASTRA_THEME_DIR . 'inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-container-configs.php';
+ require ASTRA_THEME_DIR . 'inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-sidebar-configs.php';
+ require ASTRA_THEME_DIR . 'inc/compatibility/lifterlms/customizer/sections/layout/class-astra-lifter-general-configs.php';
+ // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ }
+
+ /**
+ * Theme Defaults.
+ *
+ * @since 1.2.0
+ * @param array $defaults Array of options value.
+ * @return array
+ */
+ public function theme_defaults( $defaults ) {
+
+ // General.
+ $defaults['llms-course-grid'] = array(
+ 'desktop' => 3,
+ 'tablet' => 2,
+ 'mobile' => 1,
+ );
+ $defaults['llms-membership-grid'] = array(
+ 'desktop' => 3,
+ 'tablet' => 2,
+ 'mobile' => 1,
+ );
+
+ // Container.
+ $defaults['lifterlms-content-layout'] = 'plain-container';
+
+ // Sidebar.
+ $defaults['lifterlms-sidebar-layout'] = 'no-sidebar';
+ $defaults['lifterlms-course-lesson-sidebar-layout'] = 'default';
+
+ return $defaults;
+ }
+
+ /**
+ * This function handles the HTML output of the reviews and review form.
+ * If the option is enabled, the review form will be output,
+ * if not, nothing will happen. This function also checks to
+ * see if a user is allowed to review more than once.
+ *
+ * @since 1.2.0
+ */
+ public function single_reviews() {
+
+ /**
+ * Check to see if we are supposed to output the code at all
+ */
+ if ( get_post_meta( get_the_ID(), '_llms_display_reviews', true ) ) {
+ ?>
+ <div id="old_reviews">
+ <h3><?php echo apply_filters( 'lifterlms_reviews_section_title', _e( 'What Others Have Said', 'astra' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></h3>
+ <?php
+ $args = array(
+ 'posts_per_page' => get_post_meta( get_the_ID(), '_llms_num_reviews', true ), // phpcs:ignore WPThemeReview.CoreFunctionality.PostsPerPage.posts_per_page_posts_per_page, WordPress.WP.PostsPerPage.posts_per_page_posts_per_page
+ 'post_type' => 'llms_review',
+ 'post_status' => 'publish',
+ 'post_parent' => get_the_ID(),
+ 'suppress_filters' => true,
+ );
+ $posts_array = get_posts( $args );
+
+ $styles = array(
+ 'background-color' => '#EFEFEF',
+ 'title-color' => 'inherit',
+ 'text-color' => 'inherit',
+ 'custom-css' => '',
+ );
+
+ if ( has_filter( 'llms_review_custom_styles' ) ) {
+ $styles = apply_filters( 'llms_review_custom_styles', $styles );
+ }
+
+ foreach ( $posts_array as $post ) {
+ echo $styles['custom-css']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+
+ ?>
+ <div class="llms_review" style="background-color:<?php echo esc_attr( $styles['background-color'] ); ?>;">
+ <h5 style="color:<?php echo esc_attr( $styles['title-color'] ); ?>;"><strong><?php echo esc_html( get_the_title( $post->ID ) ); ?></strong></h5>
+ <?php /* translators: 1 Author Name. */ ?>
+ <h6 style="color:<?php echo esc_attr( $styles['text-color'] ); ?>;"><?php echo esc_html( sprintf( __( 'By: %s', 'astra' ), get_the_author_meta( 'display_name', get_post_field( 'post_author', $post->ID ) ) ) ); ?></h6>
+ <p style="color:<?php echo esc_attr( $styles['text-color'] ); ?>;"><?php echo get_post_field( 'post_content', $post->ID ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
+ </div>
+ <?php
+ }
+ ?>
+ <hr>
+ </div>
+ <?php
+ }
+
+ /**
+ * Check to see if reviews are open
+ */
+ if ( get_post_meta( get_the_ID(), '_llms_reviews_enabled', true ) && is_user_logged_in() ) {
+ /**
+ * Look for previous reviews that we have written on this course.
+ *
+ * @var array
+ */
+ $args = array(
+ 'posts_per_page' => 1,
+ 'post_type' => 'llms_review',
+ 'post_status' => 'publish',
+ 'post_parent' => get_the_ID(),
+ 'author' => get_current_user_id(),
+ 'suppress_filters' => true,
+ );
+ $posts_array = get_posts( $args );
+
+ /**
+ * Check to see if we are allowed to write more than one review.
+ * If we are not, check to see if we have written a review already.
+ */
+ if ( get_post_meta( get_the_ID(), '_llms_multiple_reviews_disabled', true ) && $posts_array ) {
+ ?>
+ <div id="thank_you_box">
+ <h2><?php echo apply_filters( 'llms_review_thank_you_text', __( 'Thank you for your review!', 'astra' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></h2>
+ </div>
+ <?php
+ } else {
+ ?>
+ <div class="review_box" id="review_box">
+ <h3><?php esc_html_e( 'Write a Review', 'astra' ); ?></h3>
+ <input type="text" name="review_title" placeholder="<?php esc_attr_e( 'Review Title', 'astra' ); ?>" id="review_title">
+ <h5 style="color:red; display:none" id="review_title_error"><?php esc_html_e( 'Review Title is required.', 'astra' ); ?></h5>
+ <textarea name="review_text" placeholder="<?php esc_attr_e( 'Review Text', 'astra' ); ?>" id="review_text"></textarea>
+ <h5 style="color:red; display:none" id="review_text_error"><?php esc_html_e( 'Review Text is required.', 'astra' ); ?></h5>
+ <?php wp_nonce_field( 'submit_review', 'submit_review_nonce_code' ); ?>
+ <input name="action" value="submit_review" type="hidden">
+ <input name="post_ID" value="<?php echo get_the_ID(); ?>" type="hidden" id="post_ID">
+ <input type="submit" class="button" value="<?php esc_attr_e( 'Leave Review', 'astra' ); ?>" id="llms_review_submit_button">
+ </div>
+ <div id="thank_you_box" style="display:none;">
+ <h2><?php echo apply_filters( 'llms_review_thank_you_text', __( 'Thank you for your review!', 'astra' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></h2>
+ </div>
+ <?php
+ }
+ }
+ }
+
+ /**
+ * LLMS Grid.
+ *
+ * @since 1.2.0
+ * @param number $grid Number of grid for course.
+ * @return number
+ */
+ public function course_grid( $grid ) {
+
+ $course_grid = astra_get_option( 'llms-course-grid' );
+ if ( ! empty( $course_grid['desktop'] ) ) {
+ return $course_grid['desktop'];
+ }
+ return $grid;
+ }
+
+ /**
+ * LLMS Resposive grid class.
+ *
+ * @since 1.2.0
+ * @param array $classes Classes.
+ * @return array
+ */
+ public function course_responsive_grid( $classes ) {
+
+ $llms_grid = astra_get_option( 'llms-course-grid' );
+ if ( in_array( 'llms-membership-list', $classes ) ) {
+ $llms_grid = astra_get_option( 'llms-membership-grid' );
+
+ if ( ! empty( $llms_grid['desktop'] ) ) {
+ $default_class = array( 'cols-1', 'cols-2', 'cols-3', 'cols-4', 'cols-5', 'cols-6' );
+ foreach ( $default_class as $class ) {
+ $index = array_search( $class, $classes );
+ if ( $index >= 0 ) {
+ unset( $classes[ $index ] );
+ }
+ }
+ $classes[] = 'cols-' . $llms_grid['desktop'];
+ }
+ }
+
+ if ( ! empty( $llms_grid['tablet'] ) ) {
+ $classes[] = 'llms-tablet-cols-' . $llms_grid['tablet'];
+ }
+ if ( ! empty( $llms_grid['mobile'] ) ) {
+ $classes[] = 'llms-mobile-cols-' . $llms_grid['mobile'];
+ }
+
+ return $classes;
+ }
+
+ /**
+ * Enqueue styles
+ *
+ * @since 1.2.0
+ * @return void
+ */
+ public function add_dynamic_styles() {
+
+ /**
+ * - Variable Declaration
+ */
+ $theme_color = astra_get_option( 'theme-color' );
+ $link_color = astra_get_option( 'link-color', $theme_color );
+ $link_h_color = astra_get_option( 'link-h-color' );
+
+ $theme_forground_color = astra_get_foreground_color( $link_color );
+ $btn_color = astra_get_option( 'button-color' );
+ if ( empty( $btn_color ) ) {
+ $btn_color = $theme_forground_color;
+ }
+
+ $btn_h_color = astra_get_option( 'button-h-color' );
+ if ( empty( $btn_h_color ) ) {
+ $btn_h_color = astra_get_foreground_color( $link_h_color );
+ }
+ $btn_bg_color = astra_get_option( 'button-bg-color', '', $link_color );
+ $btn_bg_h_color = astra_get_option( 'button-bg-h-color', '', $link_h_color );
+
+ $btn_border_radius = astra_get_option( 'button-radius' );
+ $theme_btn_padding = astra_get_option( 'theme-button-padding' );
+
+ $css_output = array(
+ 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, button.llms-field-button, a.llms-field-button' => array(
+ 'color' => $btn_color,
+ 'border-color' => $btn_bg_color,
+ 'background-color' => $btn_bg_color,
+ ),
+ 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, .llms-field-button, .llms-button-action.large' => array(
+ 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ),
+ 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ),
+ 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ),
+ 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ),
+ 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ),
+ ),
+ 'a.llms-button-primary:hover, a.llms-button-primary:focus, .llms-button-secondary:hover, .llms-button-secondary:focus, .llms-button-action:hover, .llms-button-action:focus, button.llms-field-button:hover, button.llms-field-button:focus, a.llms-field-button:hover, a.llms-field-button:focus' => array(
+ 'color' => $btn_h_color,
+ 'border-color' => $btn_bg_h_color,
+ 'background-color' => $btn_bg_h_color,
+ ),
+ 'nav.llms-pagination ul li a:focus, nav.llms-pagination ul li a:hover, nav.llms-pagination ul li span.current' => array(
+ 'background' => $link_color,
+ 'color' => $btn_color,
+ ),
+ 'nav.llms-pagination ul, nav.llms-pagination ul li, .llms-instructor-info .llms-instructors .llms-author, .llms-instructor-info .llms-instructors .llms-author .avatar' => array(
+ 'border-color' => $link_color,
+ ),
+ '.llms-progress .progress-bar-complete, .llms-instructor-info .llms-instructors .llms-author .avatar, h4.llms-access-plan-title, .llms-lesson-preview .llms-icon-free, .llms-access-plan .stamp, .llms-student-dashboard .llms-status.llms-active, .llms-student-dashboard .llms-status.llms-completed, .llms-student-dashboard .llms-status.llms-txn-succeeded, .color-full, body .llms-syllabus-wrapper .llms-section-title' => array(
+ 'background' => $link_color,
+ ),
+ '.llms-lesson-preview.is-complete .llms-lesson-complete, .llms-lesson-preview.is-free .llms-lesson-complete, .llms-widget-syllabus .lesson-complete-placeholder.done, .llms-widget-syllabus .llms-lesson-complete.done, .single-llms_quiz .llms-quiz-results .llms-donut.passing, .llms-quiz-timer' => array(
+ 'color' => $link_color,
+ ),
+ '.llms-quiz-timer' => array(
+ 'border-color' => $link_color,
+ ),
+ '.single-llms_quiz .llms-quiz-results .llms-donut.passing svg path' => array(
+ 'stroke' => $link_color,
+ ),
+ 'h4.llms-access-plan-title, .llms-instructor-info .llms-instructors .llms-author .avatar, h4.llms-access-plan-title, .llms-lesson-preview .llms-icon-free, .llms-access-plan .stamp, .llms-student-dashboard .llms-status.llms-active, .llms-student-dashboard .llms-status.llms-completed, .llms-student-dashboard .llms-status.llms-txn-succeeded, body .llms-syllabus-wrapper .llms-section-title' => array(
+ 'color' => $theme_forground_color,
+ ),
+ 'body .progress-bar-complete:after' => array(
+ 'color' => $theme_forground_color,
+ ),
+ );
+
+ /* Parse CSS from array() */
+ $css_output = astra_parse_css( $css_output );
+
+ if ( is_lesson() ) {
+ $css_output .= $this->llms_single_lesson_css();
+ }
+ /**
+ * Global button CSS - Tablet.
+ */
+ $css_global_button_tablet = array(
+ 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, .llms-field-button, .llms-button-action.large' => array(
+ 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ),
+ 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ),
+ 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ),
+ 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ),
+ ),
+ );
+
+ $css_output .= astra_parse_css( $css_global_button_tablet, '', astra_get_tablet_breakpoint() );
+
+ /**
+ * Global button CSS - Mobile.
+ */
+ $css_global_button_mobile = array(
+ 'a.llms-button-primary, .llms-button-secondary, .llms-button-action, .llms-field-button, .llms-button-action.large' => array(
+ 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ),
+ 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ),
+ 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ),
+ 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ),
+ ),
+ );
+
+ $css_output .= astra_parse_css( $css_global_button_mobile, '', astra_get_mobile_breakpoint() );
+
+ wp_add_inline_style( 'lifterlms-styles', apply_filters( 'astra_theme_lifterlms_dynamic_css', $css_output ) );
+
+ }
+
+ /**
+ * Add start of wrapper
+ *
+ * @since 1.2.0
+ * @return void
+ */
+ public function before_main_content_start() {
+ $site_sidebar = astra_page_layout();
+ if ( 'left-sidebar' == $site_sidebar ) {
+ get_sidebar();
+ }
+ ?>
+ <div id="primary" class="content-area primary">
+
+ <?php astra_primary_content_top(); ?>
+
+ <main id="main" class="site-main">
+ <div class="ast-lifterlms-container">
+ <?php
+ }
+
+ /**
+ * Add end of wrapper
+ *
+ * @since 1.2.0
+ * @return void
+ */
+ public function before_main_content_end() {
+ ?>
+ </div> <!-- .ast-lifterlms-container -->
+ </main> <!-- #main -->
+
+ <?php astra_primary_content_bottom(); ?>
+
+ </div> <!-- #primary -->
+ <?php
+ $site_sidebar = astra_page_layout();
+ if ( 'right-sidebar' == $site_sidebar ) {
+ get_sidebar();
+ }
+ }
+
+ /**
+ * Display LifterLMS Course and Lesson sidebars
+ * on courses and lessons in place of the sidebar returned by
+ * this function
+ *
+ * @since 1.2.0
+ * @param string $id default sidebar id (an empty string).
+ * @return string
+ */
+ public function add_sidebar( $id ) {
+ $sidebar_id = 'sidebar-1'; // replace this with theme's sidebar ID.
+ return $sidebar_id;
+ }
+
+ /**
+ * Declare explicit theme support for LifterLMS course and lesson sidebars
+ *
+ * @since 1.2.0
+ * @return void
+ */
+ public function add_theme_support() {
+ add_theme_support( 'lifterlms' );
+ add_theme_support( 'lifterlms-quizzes' );
+ add_theme_support( 'lifterlms-sidebars' );
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @since 1.2.0
+ * @param array $assets list of theme assets (JS & CSS).
+ * @return array List of updated assets.
+ */
+ public function add_styles( $assets ) {
+ $assets['css']['astra-lifterlms'] = ( ! Astra_Builder_Helper::apply_flex_based_css() ) ? 'compatibility/lifterlms' : 'compatibility/lifterlms-flex';
+ return $assets;
+ }
+
+ /**
+ * LifterLMS Sidebar
+ *
+ * @since 1.2.0
+ * @param string $layout Layout type.
+ * @return string $layout Layout type.
+ */
+ public function sidebar_layout( $layout ) {
+
+ if ( ( is_lifterlms() ) || is_llms_account_page() || is_llms_checkout() ) {
+
+ $llms_sidebar = astra_get_option( 'lifterlms-sidebar-layout' );
+ if ( is_lesson() || is_course() ) {
+ $llms_sidebar = astra_get_option( 'lifterlms-course-lesson-sidebar-layout' );
+ }
+
+ if ( 'default' !== $llms_sidebar ) {
+
+ $layout = $llms_sidebar;
+ }
+
+ if ( is_courses() ) {
+ $shop_page_id = get_option( 'lifterlms_shop_page_id' );
+ $shop_sidebar = get_post_meta( $shop_page_id, 'site-sidebar-layout', true );
+ } elseif ( is_memberships() ) {
+ $membership_page_id = get_option( 'lifterlms_memberships_page_id' );
+ $shop_sidebar = get_post_meta( $membership_page_id, 'site-sidebar-layout', true );
+ } elseif ( is_course_taxonomy() ) {
+ $shop_sidebar = 'default';
+ } else {
+ $shop_sidebar = astra_get_option_meta( 'site-sidebar-layout', '', true );
+ }
+
+ if ( 'default' !== $shop_sidebar && ! empty( $shop_sidebar ) ) {
+ $layout = $shop_sidebar;
+ }
+ }
+
+ return $layout;
+ }
+
+ /**
+ * LifterLMS Container
+ *
+ * @since 1.2.0
+ * @param string $layout Layout type.
+ * @return string $layout Layout type.
+ */
+ public function content_layout( $layout ) {
+
+ if ( is_lifterlms() || is_llms_account_page() || is_llms_checkout() ) {
+
+ $llms_layout = astra_get_option( 'lifterlms-content-layout' );
+
+ if ( 'default' !== $llms_layout ) {
+
+ $layout = $llms_layout;
+ }
+
+ if ( is_courses() ) {
+ $shop_page_id = get_option( 'lifterlms_shop_page_id' );
+ $shop_layout = get_post_meta( $shop_page_id, 'site-content-layout', true );
+ } elseif ( is_memberships() ) {
+ $membership_page_id = get_option( 'lifterlms_memberships_page_id' );
+ $shop_layout = get_post_meta( $membership_page_id, 'site-content-layout', true );
+ } elseif ( is_course_taxonomy() ) {
+ $shop_layout = 'default';
+ } else {
+ $shop_layout = astra_get_option_meta( 'site-content-layout', '', true );
+ }
+
+ if ( 'default' !== $shop_layout && ! empty( $shop_layout ) ) {
+ $layout = $shop_layout;
+ }
+ }
+
+ return $layout;
+ }
+
+ /**
+ * Register theme postmeta fields with the LifterLMS Builder
+ *
+ * @since 1.3.3
+ * @param string $default_fields Default custom field definitions.
+ * @return string $default_fields Updated custom field definitions.
+ */
+ public function register_builder_fields( $default_fields ) {
+ $disable_fields = array();
+ $show_meta_field = ! Astra_Meta_Boxes::is_bb_themer_layout();
+ /**
+ * Main Header.
+ */
+ $disable_fields[] = array(
+ 'attribute' => 'ast-main-header-display',
+ 'id' => 'ast-main-header-display',
+ 'label' => esc_html__( 'Disable Primary Header', 'astra' ),
+ 'switch_on' => 'disabled',
+ 'type' => 'switch',
+ );
+ /**
+ * Above Header
+ */
+ $disable_fields[] = array(
+ 'attribute' => 'ast-hfb-above-header-display',
+ 'id' => 'ast-hfb-above-header-display',
+ 'label' => esc_html__( 'Disable Above Header', 'astra' ),
+ 'switch_on' => 'disabled',
+ 'type' => 'switch',
+ );
+ /**
+ * Below Header
+ */
+ $disable_fields[] = array(
+ 'attribute' => 'ast-hfb-below-header-display',
+ 'id' => 'ast-hfb-below-header-display',
+ 'label' => esc_html__( 'Disable Below Header', 'astra' ),
+ 'switch_on' => 'disabled',
+ 'type' => 'switch',
+ );
+ /**
+ * Mobile Header
+ */
+ $disable_fields[] = array(
+ 'attribute' => 'ast-hfb-mobile-header-display',
+ 'id' => 'ast-hfb-mobile-header-display',
+ 'label' => esc_html__( 'Disable Mobile Header', 'astra' ),
+ 'switch_on' => 'disabled',
+ 'type' => 'switch',
+ );
+ if ( $show_meta_field ) {
+ $disable_fields[] = array(
+ 'attribute' => 'site-post-title',
+ 'id' => 'site-post-title',
+ 'label' => esc_html__( 'Disable Title', 'astra' ),
+ 'switch_on' => 'disabled',
+ 'type' => 'switch',
+ );
+ }
+ if ( $show_meta_field && 'disabled' != astra_get_option( 'footer-adv' ) ) {
+ $disable_fields[] = array(
+ 'attribute' => 'footer-adv-display',
+ 'id' => 'footer-adv-display',
+ 'label' => esc_html__( 'Disable Footer Widgets', 'astra' ),
+ 'switch_on' => 'disabled',
+ 'type' => 'switch',
+ );
+ }
+ if ( 'disabled' != astra_get_option( 'footer-sml-layout' ) ) {
+ $disable_fields[] = array(
+ 'attribute' => 'footer-sml-layout',
+ 'id' => 'footer-sml-layout',
+ 'label' => esc_html__( 'Disable Footer', 'astra' ),
+ 'switch_on' => 'disabled',
+ 'type' => 'switch',
+ );
+ }
+ $fields['astra_theme_settings'] = array(
+ 'title' => __( 'Astra Settings', 'astra' ),
+ 'toggleable' => true,
+ 'fields' => apply_filters(
+ 'astra_theme_lifterlms_settings',
+ array(
+ array(
+ array(
+ 'attribute' => 'site-sidebar-layout',
+ 'id' => 'site-sidebar-layout',
+ 'label' => esc_html__( 'Sidebar', 'astra' ),
+ 'type' => 'ast-select',
+ 'options' => array(
+ 'default' => esc_html__( 'Customizer Setting', 'astra' ),
+ 'left-sidebar' => esc_html__( 'Left Sidebar', 'astra' ),
+ 'right-sidebar' => esc_html__( 'Right Sidebar', 'astra' ),
+ 'no-sidebar' => esc_html__( 'No Sidebar', 'astra' ),
+ ),
+ ),
+ array(
+ 'attribute' => 'site-content-layout',
+ 'id' => 'site-content-layout',
+ 'label' => esc_html__( 'Content Layout', 'astra' ),
+ 'type' => 'ast-select',
+ 'options' => array(
+ 'default' => esc_html__( 'Customizer Setting', 'astra' ),
+ 'boxed-container' => esc_html__( 'Boxed', 'astra' ),
+ 'content-boxed-container' => esc_html__( 'Content Boxed', 'astra' ),
+ 'plain-container' => esc_html__( 'Full Width / Contained', 'astra' ),
+ 'page-builder' => esc_html__( 'Full Width / Stretched', 'astra' ),
+ ),
+ ),
+ ),
+ $disable_fields,
+ )
+ ),
+ );
+ $default_fields['assignment'] = $fields;
+ $default_fields['lesson'] = $fields;
+ $default_fields['quiz'] = $fields;
+ return $default_fields;
+ }
+
+ /**
+ * Llms single lesson static CSS move to dynamic to load conditionally.
+ *
+ * @since 3.3.0
+ * @return string
+ */
+ public function llms_single_lesson_css() {
+ $single_lesson_static_css = '
+ .single-lesson.ast-separate-container .llms-lesson-preview .llms-lesson-link {
+ background: #fff;
+ }
+
+ .single-lesson.ast-separate-container .llms-lesson-preview .llms-lesson-link:hover {
+ background: #fafafa;
+ }
+
+ .single-lesson .ast-article-single .llms-lesson-button-wrapper {
+ font-weight: 600;
+ }
+
+ .single-lesson .ast-article-single .llms-lesson-button-wrapper .llms-complete-lesson-form .llms-field-button:before {
+ content: "\2714";
+ margin-right: .5em;
+ }
+
+ .single-lesson .llms-course-navigation {
+ padding: 2em 0 0;
+ border-top: 1px solid #eeeeee;
+ }
+
+ .single-lesson .llms-course-navigation .llms-lesson-preview {
+ vertical-align: top;
+ margin-top: 0;
+ }
+
+ .single-lesson .llms-course-navigation .llms-lesson-preview .llms-lesson-link {
+ padding-left: 20px;
+ padding-right: 20px;
+ }
+
+ .single-lesson .llms-course-navigation .llms-prev-lesson h6.llms-pre-text:before {
+ content: "\2190";
+ margin-right: .5em;
+ }
+
+ .single-lesson .llms-course-navigation .llms-back-to-course:first-child h6.llms-pre-text:before {
+ content: "\2190";
+ margin-right: .5em;
+ }
+
+ .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course h6.llms-pre-text:after,
+ .single-lesson .llms-course-navigation .llms-next-lesson h6.llms-pre-text:after {
+ content: "\2192";
+ margin-left: 5px;
+ }
+
+ .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course .llms-lesson-title,
+ .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course .llms-lesson-excerpt,
+ .single-lesson .llms-course-navigation .llms-prev-lesson ~ .llms-back-to-course h6.llms-pre-text,
+ .single-lesson .llms-course-navigation .llms-next-lesson .llms-lesson-title,
+ .single-lesson .llms-course-navigation .llms-next-lesson .llms-lesson-excerpt,
+ .single-lesson .llms-course-navigation .llms-next-lesson h6.llms-pre-text {
+ text-align: right;
+ }
+
+ @media (max-width: 544px) {
+ .single-lesson .llms-course-navigation {
+ padding-top: 1.5em;
+ }
+ .single-lesson .llms-course-navigation .llms-course-nav {
+ width: 100%;
+ margin: 0;
+ }
+ .single-lesson .llms-course-navigation .llms-course-nav:first-child {
+ margin-bottom: 1.5em;
+ }
+ }';
+ return Astra_Enqueue_Scripts::trim_css( $single_lesson_static_css );
+ }
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+if ( apply_filters( 'astra_enable_lifterlms_integration', true ) ) {
+ Astra_LifterLMS::get_instance();
+}
diff --git a/inc/compatibility/lifterlms/customizer/class-astra-liferlms-section-configs.php b/inc/compatibility/lifterlms/customizer/class-astra-liferlms-section-configs.php
new file mode 100644
index 0000000..e6e6956
--- /dev/null
+++ b/inc/compatibility/lifterlms/customizer/class-astra-liferlms-section-configs.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Register customizer panels & sections.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since Astra 1.2.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+if ( ! class_exists( 'Astra_Liferlms_Section_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Liferlms_Section_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register LearnDash Container settings.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ array(
+ 'name' => 'section-lifterlms',
+ 'type' => 'section',
+ 'priority' => 65,
+ 'title' => __( 'LifterLMS', 'astra' ),
+ ),
+
+ /**
+ * General Section
+ */
+ array(
+ 'name' => 'section-lifterlms-general',
+ 'type' => 'section',
+ 'title' => __( 'General', 'astra' ),
+ 'section' => 'section-lifterlms',
+ 'priority' => 0,
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Liferlms_Section_Configs();
diff --git a/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-container-configs.php b/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-container-configs.php
new file mode 100644
index 0000000..c74af6f
--- /dev/null
+++ b/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-container-configs.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ * Container Options for Astra theme.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since 1.4.3
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Lifter_Container_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ *
+ * @since 1.4.3
+ */
+ class Astra_Lifter_Container_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register LifterLMS Container Settings.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Shop Page
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[lifterlms-content-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'section' => 'section-container-layout',
+ 'default' => astra_get_option( 'lifterlms-content-layout' ),
+ 'priority' => 66,
+ 'title' => __( 'LifterLMS Layout', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'boxed-container' => __( 'Boxed', 'astra' ),
+ 'content-boxed-container' => __( 'Content Boxed', 'astra' ),
+ 'plain-container' => __( 'Full Width / Contained', 'astra' ),
+ 'page-builder' => __( 'Full Width / Stretched', 'astra' ),
+ ),
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Lifter_Container_Configs();
+
+
diff --git a/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-sidebar-configs.php b/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-sidebar-configs.php
new file mode 100644
index 0000000..787d385
--- /dev/null
+++ b/inc/compatibility/lifterlms/customizer/sections/class-astra-lifter-sidebar-configs.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Content Spacing Options for our theme.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since Astra 1.2.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Lifter_Sidebar_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Lifter_Sidebar_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra-LifterLMS Sidebar Customizer Configurations.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Shop Page
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[lifterlms-sidebar-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'section' => 'section-sidebars',
+ 'priority' => 5,
+ 'default' => astra_get_option( 'lifterlms-sidebar-layout' ),
+ 'title' => __( 'LifterLMS', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'no-sidebar' => __( 'No Sidebar', 'astra' ),
+ 'left-sidebar' => __( 'Left Sidebar', 'astra' ),
+ 'right-sidebar' => __( 'Right Sidebar', 'astra' ),
+ ),
+ ),
+
+ /**
+ * Option: LifterLMS Course/Lesson
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[lifterlms-course-lesson-sidebar-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'section' => 'section-sidebars',
+ 'default' => astra_get_option( 'lifterlms-course-lesson-sidebar-layout' ),
+ 'priority' => 5,
+ 'title' => __( 'LifterLMS Course/Lesson', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'no-sidebar' => __( 'No Sidebar', 'astra' ),
+ 'left-sidebar' => __( 'Left Sidebar', 'astra' ),
+ 'right-sidebar' => __( 'Right Sidebar', 'astra' ),
+ ),
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Lifter_Sidebar_Configs();
diff --git a/inc/compatibility/lifterlms/customizer/sections/layout/class-astra-lifter-general-configs.php b/inc/compatibility/lifterlms/customizer/sections/layout/class-astra-lifter-general-configs.php
new file mode 100644
index 0000000..392e28b
--- /dev/null
+++ b/inc/compatibility/lifterlms/customizer/sections/layout/class-astra-lifter-general-configs.php
@@ -0,0 +1,104 @@
+<?php
+/**
+ * LifterLMS General Options for our theme.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since 1.4.3
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Lifter_General_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Lifter_General_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra-LifterLMS General Customizer Configurations.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'lifterlms' ) ) {
+ $divider_array = array( 'ast_class' => 'ast-bottom-divider' );
+ $section = 'section-lifterlms-general';
+ } else {
+ $divider_array = array();
+ $section = 'section-lifterlms';
+ }
+
+ $_configs = array(
+
+ /**
+ * Option: Course Columns
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[llms-course-grid]',
+ 'type' => 'control',
+ 'control' => 'ast-responsive-slider',
+ 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
+ 'section' => $section,
+ 'default' => astra_get_option(
+ 'llms-course-grid',
+ array(
+ 'desktop' => 3,
+ 'tablet' => 2,
+ 'mobile' => 1,
+ )
+ ),
+ 'title' => __( 'Course Columns', 'astra' ),
+ 'priority' => 0,
+ 'input_attrs' => array(
+ 'step' => 1,
+ 'min' => 1,
+ 'max' => 6,
+ ),
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+ ),
+
+ /**
+ * Option: Membership Columns
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[llms-membership-grid]',
+ 'type' => 'control',
+ 'control' => 'ast-responsive-slider',
+ 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
+ 'section' => $section,
+ 'default' => astra_get_option(
+ 'llms-membership-grid',
+ array(
+ 'desktop' => 3,
+ 'tablet' => 2,
+ 'mobile' => 1,
+ )
+ ),
+ 'title' => __( 'Membership Columns', 'astra' ),
+ 'priority' => 0,
+ 'input_attrs' => array(
+ 'step' => 1,
+ 'min' => 1,
+ 'max' => 6,
+ ),
+ 'divider' => $divider_array,
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Lifter_General_Configs();
diff --git a/inc/compatibility/woocommerce/class-astra-woocommerce.php b/inc/compatibility/woocommerce/class-astra-woocommerce.php
new file mode 100644
index 0000000..91cd6ef
--- /dev/null
+++ b/inc/compatibility/woocommerce/class-astra-woocommerce.php
@@ -0,0 +1,1819 @@
+<?php
+/**
+ * WooCommerce Compatibility File.
+ *
+ * @link https://woocommerce.com/
+ *
+ * @package Astra
+ */
+
+// If plugin - 'WooCommerce' not exist then return.
+if ( ! class_exists( 'WooCommerce' ) ) {
+ return;
+}
+
+/**
+ * Astra WooCommerce Compatibility
+ */
+if ( ! class_exists( 'Astra_Woocommerce' ) ) :
+
+ /**
+ * Astra WooCommerce Compatibility
+ *
+ * @since 1.0.0
+ */
+ class Astra_Woocommerce {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+
+ require_once ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/woocommerce-common-functions.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+
+ add_filter( 'woocommerce_enqueue_styles', array( $this, 'woo_filter_style' ) );
+
+ add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
+
+ add_action( 'after_setup_theme', array( $this, 'setup_theme' ) );
+
+ // Register Store Sidebars.
+ add_action( 'widgets_init', array( $this, 'store_widgets_init' ), 15 );
+ // Replace Store Sidebars.
+ add_filter( 'astra_get_sidebar', array( $this, 'replace_store_sidebar' ) );
+ // Store Sidebar Layout.
+ add_filter( 'astra_page_layout', array( $this, 'store_sidebar_layout' ) );
+ // Store Content Layout.
+ add_filter( 'astra_get_content_layout', array( $this, 'store_content_layout' ) );
+
+ add_action( 'woocommerce_before_main_content', array( $this, 'before_main_content_start' ) );
+ add_action( 'woocommerce_after_main_content', array( $this, 'before_main_content_end' ) );
+ add_filter( 'wp_enqueue_scripts', array( $this, 'add_styles' ) );
+ add_action( 'wp', array( $this, 'shop_customization' ), 5 );
+ add_action( 'wp_head', array( $this, 'single_product_customization' ), 5 );
+ add_action( 'wp', array( $this, 'woocommerce_init' ), 1 );
+ add_action( 'wp', array( $this, 'woocommerce_checkout' ) );
+ add_action( 'wp', array( $this, 'shop_meta_option' ), 1 );
+ add_action( 'wp', array( $this, 'cart_page_upselles' ) );
+
+ add_filter( 'loop_shop_columns', array( $this, 'shop_columns' ) );
+ add_filter( 'loop_shop_per_page', array( $this, 'shop_no_of_products' ) );
+ add_filter( 'body_class', array( $this, 'shop_page_products_item_class' ) );
+ add_filter( 'post_class', array( $this, 'single_product_class' ) );
+ add_filter( 'woocommerce_product_get_rating_html', array( $this, 'rating_markup' ), 10, 3 );
+ add_filter( 'woocommerce_output_related_products_args', array( $this, 'related_products_args' ) );
+
+ // Add Cart icon in Menu.
+ add_filter( 'astra_get_dynamic_header_content', array( $this, 'astra_header_cart' ), 10, 3 );
+
+ // Add Cart option in dropdown.
+ add_filter( 'astra_header_section_elements', array( $this, 'header_section_elements' ) );
+
+ // Cart fragment.
+ if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.3', '>=' ) ) {
+ add_filter( 'woocommerce_add_to_cart_fragments', array( $this, 'cart_link_fragment' ) );
+ } else {
+ add_filter( 'add_to_cart_fragments', array( $this, 'cart_link_fragment' ) );
+ }
+
+ add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'product_flip_image' ), 10 );
+ add_filter( 'woocommerce_subcategory_count_html', array( $this, 'subcategory_count_markup' ), 10, 2 );
+
+ add_action( 'customize_register', array( $this, 'customize_register' ), 2 );
+
+ add_filter( 'woocommerce_get_stock_html', 'astra_woo_product_in_stock', 10, 2 );
+
+ add_filter( 'astra_schema_body', array( $this, 'remove_body_schema' ) );
+
+ // Header Cart Icon.
+ add_action( 'astra_woo_header_cart_icons_before', array( $this, 'header_cart_icon_markup' ) );
+
+ add_action( 'astra_cart_in_menu_class', array( $this, 'header_cart_icon_class' ), 99 );
+
+ }
+
+ /**
+ * Header Cart Extra Icons markup
+ *
+ * @return void;
+ */
+ 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( 'woo-header-cart-icon' );
+ $cart_total_display = astra_get_option( 'woo-header-cart-total-display' );
+ $cart_count_display = apply_filters( 'astra_header_cart_count', true );
+ $cart_title_display = astra_get_option( 'woo-header-cart-title-display' );
+ $cart_title = apply_filters( 'astra_header_cart_title', __( 'Cart', 'astra' ) );
+
+ $cart_title_markup = '<span class="ast-woo-header-cart-title">' . esc_html( $cart_title ) . '</span>';
+ $cart_total_markup = '';
+ if ( null !== WC()->cart ) {
+ $cart_total_markup = '<span class="ast-woo-header-cart-total">' . WC()->cart->get_cart_subtotal() . '</span>';
+ }
+
+ // Cart Title & Cart Cart total markup.
+ $cart_info_markup = sprintf(
+ '<span class="ast-woo-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_contents_count = 0;
+ if ( null !== WC()->cart ) {
+ $cart_contents_count = WC()->cart->get_cart_contents_count();
+ }
+
+ // Cart Icon markup with total number of items.
+ $cart_icon = sprintf(
+ '<i class="astra-icon ast-icon-shopping-%1$s %2$s"
+ %3$s
+ >%4$s</i>',
+ ( $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( 'woocommerce' ) ) ) {
+ // 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_woo_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
+ );
+ }
+ }
+
+ /**
+ * Header Cart Icon Class
+ *
+ * @param array $classes Default argument array.
+ *
+ * @return array;
+ */
+ public function header_cart_icon_class( $classes ) {
+
+ if ( false === Astra_Builder_Helper::$is_header_footer_builder_active && ! defined( 'ASTRA_EXT_VER' ) ) {
+ return $classes;
+ }
+
+ $header_cart_icon_style = astra_get_option( 'woo-header-cart-icon-style' );
+
+ $classes[] = 'ast-menu-cart-' . $header_cart_icon_style;
+ $header_cart_icon_has_color = astra_get_option( 'woo-header-cart-icon-color' );
+ if ( ! empty( $header_cart_icon_has_color ) && ( 'none' !== $header_cart_icon_style ) ) {
+ $classes[] = 'ast-menu-cart-has-color';
+ }
+
+ return $classes;
+ }
+
+ /**
+ * Remove body schema when using WooCommerce template.
+ * WooCommerce adds it's own product schema hence schema data from Astra should be disabled here.
+ *
+ * @since 1.8.0
+ * @param String $schema Schema markup.
+ * @return String
+ */
+ public function remove_body_schema( $schema ) {
+ if ( is_woocommerce() ) {
+ $schema = '';
+ }
+
+ return $schema;
+ }
+
+ /**
+ * Rating Markup
+ *
+ * @since 1.2.2
+ * @param string $html Rating Markup.
+ * @param float $rating Rating being shown.
+ * @param int $count Total number of ratings.
+ * @return string
+ */
+ public function rating_markup( $html, $rating, $count ) {
+
+ if ( 0 == $rating ) {
+ $html = '<div class="star-rating">';
+ $html .= wc_get_star_rating_html( $rating, $count );
+ $html .= '</div>';
+ }
+ return $html;
+ }
+
+ /**
+ * Cart Page Upselles products.
+ *
+ * @return void
+ */
+ public function cart_page_upselles() {
+
+ $upselles_enabled = astra_get_option( 'enable-cart-upsells' );
+ if ( ! $upselles_enabled ) {
+ remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
+ }
+ }
+
+ /**
+ * Subcategory Count Markup
+ *
+ * @param array $styles Css files.
+ *
+ * @return array
+ */
+ public function woo_filter_style( $styles ) {
+
+ /* Directory and Extension */
+ $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
+ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
+
+ $css_uri = ASTRA_THEME_URI . 'assets/css/' . $dir_name . '/compatibility/woocommerce/';
+
+ // Register & Enqueue Styles.
+ // Generate CSS URL.
+
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ $styles = array(
+ 'woocommerce-layout' => array(
+ 'src' => $css_uri . 'woocommerce-layout' . $file_prefix . '.css',
+ 'deps' => '',
+ 'version' => ASTRA_THEME_VERSION,
+ 'media' => 'all',
+ 'has_rtl' => true,
+ ),
+ 'woocommerce-smallscreen' => array(
+ 'src' => $css_uri . 'woocommerce-smallscreen' . $file_prefix . '.css',
+ 'deps' => 'woocommerce-layout',
+ 'version' => ASTRA_THEME_VERSION,
+ 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', astra_get_tablet_breakpoint() . 'px' ) . ')',
+ 'has_rtl' => true,
+ ),
+ 'woocommerce-general' => array(
+ 'src' => $css_uri . 'woocommerce' . $file_prefix . '.css',
+ 'deps' => '',
+ 'version' => ASTRA_THEME_VERSION,
+ 'media' => 'all',
+ 'has_rtl' => true,
+ ),
+ );
+ } else {
+ $styles = array(
+ 'woocommerce-layout' => array(
+ 'src' => $css_uri . 'woocommerce-layout-grid' . $file_prefix . '.css',
+ 'deps' => '',
+ 'version' => ASTRA_THEME_VERSION,
+ 'media' => 'all',
+ 'has_rtl' => true,
+ ),
+ 'woocommerce-smallscreen' => array(
+ 'src' => $css_uri . 'woocommerce-smallscreen-grid' . $file_prefix . '.css',
+ 'deps' => 'woocommerce-layout',
+ 'version' => ASTRA_THEME_VERSION,
+ 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', astra_get_tablet_breakpoint() . 'px' ) . ')',
+ 'has_rtl' => true,
+ ),
+ 'woocommerce-general' => array(
+ 'src' => $css_uri . 'woocommerce-grid' . $file_prefix . '.css',
+ 'deps' => '',
+ 'version' => ASTRA_THEME_VERSION,
+ 'media' => 'all',
+ 'has_rtl' => true,
+ ),
+ );
+ }
+
+ return $styles;
+ }
+
+ /**
+ * Subcategory Count Markup
+ *
+ * @param mixed $content Count Markup.
+ * @param object $category Object of Category.
+ * @return mixed
+ */
+ public function subcategory_count_markup( $content, $category ) {
+
+ $content = sprintf( // WPCS: XSS OK.
+ /* translators: 1: number of products */
+ _nx( '%1$s Product', '%1$s Products', $category->count, 'product categories', 'astra' ),
+ number_format_i18n( $category->count )
+ );
+
+ return '<mark class="count">' . $content . '</mark>';
+ }
+
+ /**
+ * Product Flip Image
+ */
+ public function product_flip_image() {
+
+ global $product;
+
+ $hover_style = astra_get_option( 'shop-hover-style' );
+
+ if ( 'swap' === $hover_style ) {
+
+ $attachment_ids = $product->get_gallery_image_ids();
+
+ if ( $attachment_ids ) {
+
+ $image_size = apply_filters( 'single_product_archive_thumbnail_size', 'shop_catalog' );
+
+ echo apply_filters( 'astra_woocommerce_product_flip_image', wp_get_attachment_image( reset( $attachment_ids ), $image_size, false, array( 'class' => 'show-on-hover' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+ }
+ }
+ }
+
+ /**
+ * Theme Defaults.
+ *
+ * @param array $defaults Array of options value.
+ * @return array
+ */
+ public function theme_defaults( $defaults ) {
+
+ // Container.
+ $defaults['woocommerce-content-layout'] = 'plain-container';
+
+ // Sidebar.
+ $defaults['woocommerce-sidebar-layout'] = 'no-sidebar';
+ $defaults['single-product-sidebar-layout'] = 'default';
+
+ /* Shop */
+ $defaults['shop-grids'] = array(
+ 'desktop' => 4,
+ 'tablet' => 3,
+ 'mobile' => 2,
+ );
+ $defaults['shop-no-of-products'] = '12';
+ $defaults['shop-product-structure'] = array(
+ 'category',
+ 'title',
+ 'ratings',
+ 'price',
+ 'add_cart',
+ );
+ $defaults['shop-hover-style'] = '';
+
+ /* Single */
+ $defaults['single-product-breadcrumb-disable'] = false;
+
+ /* Cart */
+ $defaults['enable-cart-upsells'] = true;
+
+ $defaults['shop-archive-width'] = 'default';
+ $defaults['shop-archive-max-width'] = 1200;
+
+ return $defaults;
+ }
+
+ /**
+ * Update Shop page grid
+ *
+ * @param int $col Shop Column.
+ * @return int
+ */
+ public function shop_columns( $col ) {
+
+ $col = astra_get_option( 'shop-grids' );
+ return $col['desktop'];
+ }
+
+ /**
+ * Check if the current page is a Product Subcategory page or not.
+ *
+ * @param integer $category_id Current page Category ID.
+ * @return boolean
+ */
+ public function astra_woo_is_subcategory( $category_id = null ) {
+ if ( is_tax( 'product_cat' ) ) {
+ if ( empty( $category_id ) ) {
+ $category_id = get_queried_object_id();
+ }
+ $category = get_term( get_queried_object_id(), 'product_cat' );
+ if ( empty( $category->parent ) ) {
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Update Shop page grid
+ *
+ * @return int
+ */
+ public function shop_no_of_products() {
+ $taxonomy_page_display = get_option( 'woocommerce_category_archive_display', false );
+ if ( is_product_taxonomy() && 'subcategories' === $taxonomy_page_display ) {
+ if ( $this->astra_woo_is_subcategory() ) {
+ $products = astra_get_option( 'shop-no-of-products' );
+ return $products;
+ }
+ $products = wp_count_posts( 'product' )->publish;
+ } else {
+ $products = astra_get_option( 'shop-no-of-products' );
+ }
+ return $products;
+ }
+
+ /**
+ * Add products item class on shop page
+ *
+ * @param Array $classes product classes.
+ *
+ * @return array.
+ */
+ public function shop_page_products_item_class( $classes = '' ) {
+
+ if ( is_shop() || is_product_taxonomy() ) {
+ $shop_grid = astra_get_option( 'shop-grids' );
+ $classes[] = 'columns-' . $shop_grid['desktop'];
+ $classes[] = 'tablet-columns-' . $shop_grid['tablet'];
+ $classes[] = 'mobile-columns-' . $shop_grid['mobile'];
+
+ $classes[] = 'ast-woo-shop-archive';
+ }
+ // Cart menu is emabled.
+ $rt_section = astra_get_option( 'header-main-rt-section' );
+
+ if ( 'woocommerce' === $rt_section ) {
+ $classes[] = 'ast-woocommerce-cart-menu';
+ }
+
+ return $classes;
+ }
+
+ /**
+ * Get grid columns for either Archive|Single product.
+ * Introducing this function to reduce lot of CSS we write for 'grid-template-columns' for every count (till 6).
+ *
+ * @param string $type - WooCommerce page type Archive/Single.
+ * @param string $device - Device specific grid option.
+ * @param int $default - Default grid count (fallback basically).
+ *
+ * @return int grid count.
+ * @since 3.4.3
+ */
+ public function get_grid_column_count( $type = 'archive', $device = 'desktop', $default = 2 ) {
+
+ if ( 'archive' === $type ) {
+ $products_grid = astra_get_option( 'shop-grids' );
+ } else {
+ $products_grid = astra_get_option( 'single-product-related-upsell-grid' );
+ }
+
+ return isset( $products_grid[ $device ] ) ? absint( $products_grid[ $device ] ) : $default;
+ }
+
+ /**
+ * Add class on single product page
+ *
+ * @param Array $classes product classes.
+ *
+ * @return array.
+ */
+ public function single_product_class( $classes ) {
+
+ if ( is_product() && 0 == get_post_meta( get_the_ID(), '_wc_review_count', true ) ) {
+ $classes[] = 'ast-woo-product-no-review';
+ }
+
+ if ( is_shop() || is_product_taxonomy() ) {
+ $hover_style = astra_get_option( 'shop-hover-style' );
+
+ if ( '' !== $hover_style ) {
+ $classes[] = 'astra-woo-hover-' . $hover_style;
+ }
+ }
+
+ return $classes;
+ }
+
+ /**
+ * Update woocommerce related product numbers
+ *
+ * @param array $args Related products array.
+ * @return array
+ */
+ public function related_products_args( $args ) {
+
+ $col = astra_get_option( 'shop-grids' );
+ $args['posts_per_page'] = $col['desktop'];
+ return $args;
+ }
+
+ /**
+ * Setup theme
+ *
+ * @since 1.0.3
+ */
+ public function setup_theme() {
+
+ // WooCommerce.
+ add_theme_support( 'wc-product-gallery-zoom' );
+ add_theme_support( 'wc-product-gallery-lightbox' );
+ add_theme_support( 'wc-product-gallery-slider' );
+ }
+
+ /**
+ * Store widgets init.
+ */
+ public function store_widgets_init() {
+ register_sidebar(
+ apply_filters(
+ 'astra_woocommerce_shop_sidebar_init',
+ array(
+ 'name' => esc_html__( 'WooCommerce Sidebar', 'astra' ),
+ 'id' => 'astra-woo-shop-sidebar',
+ 'description' => __( 'This sidebar will be used on Product archive, Cart, Checkout and My Account pages.', 'astra' ),
+ 'before_widget' => '<div id="%1$s" class="widget %2$s">',
+ 'after_widget' => '</div>',
+ 'before_title' => '<h2 class="widget-title">',
+ 'after_title' => '</h2>',
+ )
+ )
+ );
+ register_sidebar(
+ apply_filters(
+ 'astra_woocommerce_single_sidebar_init',
+ array(
+ 'name' => esc_html__( 'Product Sidebar', 'astra' ),
+ 'id' => 'astra-woo-single-sidebar',
+ 'description' => __( 'This sidebar will be used on Single Product page.', 'astra' ),
+ 'before_widget' => '<div id="%1$s" class="widget %2$s">',
+ 'after_widget' => '</div>',
+ 'before_title' => '<h2 class="widget-title">',
+ 'after_title' => '</h2>',
+ )
+ )
+ );
+ }
+
+ /**
+ * Assign shop sidebar for store page.
+ *
+ * @param String $sidebar Sidebar.
+ *
+ * @return String $sidebar Sidebar.
+ */
+ public function replace_store_sidebar( $sidebar ) {
+
+ if ( is_shop() || is_product_taxonomy() || is_checkout() || is_cart() || is_account_page() ) {
+ $sidebar = 'astra-woo-shop-sidebar';
+ } elseif ( is_product() ) {
+ $sidebar = 'astra-woo-single-sidebar';
+ }
+
+ return $sidebar;
+ }
+
+ /**
+ * WooCommerce Container
+ *
+ * @param String $sidebar_layout Layout type.
+ *
+ * @return String $sidebar_layout Layout type.
+ */
+ public function store_sidebar_layout( $sidebar_layout ) {
+
+ if ( is_shop() || is_product_taxonomy() || is_checkout() || is_cart() || is_account_page() ) {
+
+ $woo_sidebar = astra_get_option( 'woocommerce-sidebar-layout' );
+
+ if ( 'default' !== $woo_sidebar ) {
+
+ $sidebar_layout = $woo_sidebar;
+ }
+
+ if ( is_shop() ) {
+ $shop_page_id = get_option( 'woocommerce_shop_page_id' );
+ $shop_sidebar = get_post_meta( $shop_page_id, 'site-sidebar-layout', true );
+ } elseif ( is_product_taxonomy() ) {
+ $shop_sidebar = 'default';
+ } else {
+ $shop_sidebar = astra_get_option_meta( 'site-sidebar-layout', '', true );
+ }
+
+ if ( 'default' !== $shop_sidebar && ! empty( $shop_sidebar ) ) {
+ $sidebar_layout = $shop_sidebar;
+ }
+ }
+
+ return $sidebar_layout;
+ }
+ /**
+ * WooCommerce Container
+ *
+ * @param String $layout Layout type.
+ *
+ * @return String $layout Layout type.
+ */
+ public function store_content_layout( $layout ) {
+
+ if ( is_woocommerce() || is_checkout() || is_cart() || is_account_page() ) {
+
+ $woo_layout = astra_get_option( 'woocommerce-content-layout' );
+
+ if ( 'default' !== $woo_layout ) {
+
+ $layout = $woo_layout;
+ }
+
+ if ( is_shop() ) {
+ $shop_page_id = get_option( 'woocommerce_shop_page_id' );
+ $shop_layout = get_post_meta( $shop_page_id, 'site-content-layout', true );
+ } elseif ( is_product_taxonomy() ) {
+ $shop_layout = 'default';
+ } else {
+ $shop_layout = astra_get_option_meta( 'site-content-layout', '', true );
+ }
+
+ if ( 'default' !== $shop_layout && ! empty( $shop_layout ) ) {
+ $layout = $shop_layout;
+ }
+ }
+
+ return apply_filters( 'astra_get_store_content_layout', $layout );
+ }
+
+ /**
+ * Shop Page Meta
+ *
+ * @return void
+ */
+ public function shop_meta_option() {
+
+ // Page Title.
+ if ( is_shop() ) {
+
+ $shop_page_id = get_option( 'woocommerce_shop_page_id' );
+ $shop_title = get_post_meta( $shop_page_id, 'site-post-title', true );
+ $main_header_display = get_post_meta( $shop_page_id, 'ast-main-header-display', true );
+ $footer_layout = get_post_meta( $shop_page_id, 'footer-sml-layout', true );
+
+ if ( 'disabled' === $shop_title ) {
+ add_filter( 'woocommerce_show_page_title', '__return_false' );
+ }
+
+ if ( 'disabled' === $main_header_display ) {
+ remove_action( 'astra_masthead', 'astra_masthead_primary_template' );
+ }
+
+ if ( 'disabled' === $footer_layout ) {
+ remove_action( 'astra_footer_content', 'astra_footer_small_footer_template', 5 );
+ }
+ }
+ }
+
+
+ /**
+ * Shop customization.
+ *
+ * @return void
+ */
+ public function shop_customization() {
+
+ if ( ! apply_filters( 'astra_woo_shop_product_structure_override', false ) ) {
+
+ add_action( 'woocommerce_before_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_start', 6 );
+ /**
+ * Add sale flash before shop loop.
+ */
+ add_action( 'woocommerce_before_shop_loop_item', 'woocommerce_show_product_loop_sale_flash', 9 );
+
+ add_action( 'woocommerce_after_shop_loop_item', 'astra_woo_shop_thumbnail_wrap_end', 8 );
+ /**
+ * Add Out of Stock to the Shop page
+ */
+ add_action( 'woocommerce_shop_loop_item_title', 'astra_woo_shop_out_of_stock', 8 );
+
+ remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
+
+ /**
+ * Shop Page Product Content Sorting
+ */
+ add_action( 'woocommerce_after_shop_loop_item', 'astra_woo_woocommerce_shop_product_content' );
+ }
+ }
+
+ /**
+ * Checkout customization.
+ *
+ * @return void
+ */
+ public function woocommerce_checkout() {
+
+ if ( is_admin() ) {
+ return;
+ }
+
+ if ( ! apply_filters( 'astra_woo_shop_product_structure_override', false ) ) {
+
+ /**
+ * Checkout Page
+ */
+ add_action( 'woocommerce_checkout_billing', array( WC()->checkout(), 'checkout_form_shipping' ) );
+ }
+
+ // Checkout Page.
+ remove_action( 'woocommerce_checkout_shipping', array( WC()->checkout(), 'checkout_form_shipping' ) );
+ }
+
+ /**
+ * Single product customization.
+ *
+ * @return void
+ */
+ public function single_product_customization() {
+
+ if ( ! is_product() ) {
+ return;
+ }
+
+ add_filter( 'woocommerce_product_description_heading', '__return_false' );
+ add_filter( 'woocommerce_product_additional_information_heading', '__return_false' );
+
+ // Breadcrumb.
+ remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
+ if ( ! astra_get_option( 'single-product-breadcrumb-disable' ) ) {
+ add_action( 'woocommerce_single_product_summary', 'woocommerce_breadcrumb', 2 );
+ }
+ }
+
+ /**
+ * Remove Woo-Commerce Default actions
+ */
+ public function woocommerce_init() {
+ remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
+ remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );
+ remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
+ remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
+ remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 );
+ remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
+ remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );
+ }
+
+ /**
+ * Add start of wrapper
+ */
+ public function before_main_content_start() {
+ $site_sidebar = astra_page_layout();
+ if ( 'left-sidebar' == $site_sidebar ) {
+ get_sidebar();
+ }
+ ?>
+ <div id="primary" class="content-area primary">
+
+ <?php astra_primary_content_top(); ?>
+
+ <main id="main" class="site-main">
+ <div class="ast-woocommerce-container">
+ <?php
+ }
+
+ /**
+ * Add end of wrapper
+ */
+ public function before_main_content_end() {
+ ?>
+ </div> <!-- .ast-woocommerce-container -->
+ </main> <!-- #main -->
+
+ <?php astra_primary_content_bottom(); ?>
+
+ </div> <!-- #primary -->
+ <?php
+ $site_sidebar = astra_page_layout();
+ if ( 'right-sidebar' == $site_sidebar ) {
+ get_sidebar();
+ }
+ }
+
+ /**
+ * Enqueue styles
+ *
+ * @since 1.0.31
+ */
+ public function add_styles() {
+
+ /**
+ * - Variable Declaration
+ */
+ $is_site_rtl = is_rtl();
+ $theme_color = astra_get_option( 'theme-color' );
+ $link_color = astra_get_option( 'link-color', $theme_color );
+ $text_color = astra_get_option( 'text-color' );
+ $link_h_color = astra_get_option( 'link-h-color' );
+
+ $btn_color = astra_get_option( 'button-color' );
+ if ( empty( $btn_color ) ) {
+ $btn_color = astra_get_foreground_color( $theme_color );
+ }
+
+ $btn_h_color = astra_get_option( 'button-h-color' );
+ if ( empty( $btn_h_color ) ) {
+ $btn_h_color = astra_get_foreground_color( $link_h_color );
+ }
+ $btn_bg_color = astra_get_option( 'button-bg-color', '', $theme_color );
+ $btn_bg_h_color = astra_get_option( 'button-bg-h-color', '', $link_h_color );
+
+ $btn_border_radius = astra_get_option( 'button-radius' );
+ $theme_btn_padding = astra_get_option( 'theme-button-padding' );
+
+ $cart_h_color = astra_get_foreground_color( $link_h_color );
+
+ $site_content_width = astra_get_option( 'site-content-width', 1200 );
+ $woo_shop_archive_width = astra_get_option( 'shop-archive-width' );
+ $woo_shop_archive_max_width = astra_get_option( 'shop-archive-max-width' );
+
+ // global button border settings.
+ $global_custom_button_border_size = astra_get_option( 'theme-button-border-group-border-size' );
+ $btn_border_color = astra_get_option( 'theme-button-border-group-border-color' );
+ $btn_border_h_color = astra_get_option( 'theme-button-border-group-border-h-color' );
+
+ $css_output = array(
+ '.woocommerce span.onsale, .wc-block-grid__product .wc-block-grid__product-onsale' => array(
+ 'background-color' => $theme_color,
+ 'color' => astra_get_foreground_color( $theme_color ),
+ ),
+ '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled], .woocommerce input.button:disabled:hover, .woocommerce input.button:disabled[disabled]:hover, .woocommerce #respond input#submit, .woocommerce button.button.alt.disabled, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link, .wc-block-grid__product-onsale' => array(
+ 'color' => $btn_color,
+ 'border-color' => $btn_bg_color,
+ 'background-color' => $btn_bg_color,
+ ),
+ '.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce .woocommerce-message a.button:hover,.woocommerce #respond input#submit:hover,.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce input.button:hover, .woocommerce button.button.alt.disabled:hover, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array(
+ 'color' => $btn_h_color,
+ 'border-color' => $btn_bg_h_color,
+ 'background-color' => $btn_bg_h_color,
+ ),
+ '.woocommerce-message, .woocommerce-info' => array(
+ 'border-top-color' => $link_color,
+ ),
+ '.woocommerce-message::before,.woocommerce-info::before' => array(
+ 'color' => $link_color,
+ ),
+ '.woocommerce ul.products li.product .price, .woocommerce div.product p.price, .woocommerce div.product span.price, .widget_layered_nav_filters ul li.chosen a, .woocommerce-page ul.products li.product .ast-woo-product-category, .wc-layered-nav-rating a' => array(
+ 'color' => $text_color,
+ ),
+ // Form Fields, Pagination border Color.
+ '.woocommerce nav.woocommerce-pagination ul,.woocommerce nav.woocommerce-pagination ul li' => array(
+ 'border-color' => $link_color,
+ ),
+ '.woocommerce nav.woocommerce-pagination ul li a:focus, .woocommerce nav.woocommerce-pagination ul li a:hover, .woocommerce nav.woocommerce-pagination ul li span.current' => array(
+ 'background' => $link_color,
+ 'color' => $btn_color,
+ ),
+ '.woocommerce-MyAccount-navigation-link.is-active a' => array(
+ 'color' => $link_h_color,
+ ),
+ '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle' => array(
+ 'background-color' => $link_color,
+ ),
+ // Button Typography.
+ '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array(
+ 'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ),
+ 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'desktop' ),
+ 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'desktop' ),
+ 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'desktop' ),
+ 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'desktop' ),
+ ),
+ '.woocommerce .star-rating, .woocommerce .comment-form-rating .stars a, .woocommerce .star-rating::before' => array(
+ 'color' => $link_color,
+ ),
+ '.woocommerce div.product .woocommerce-tabs ul.tabs li.active:before' => array(
+ 'background' => $link_color,
+ ),
+ '.woocommerce a.remove:hover' => array(
+ 'color' => esc_attr( $link_color ),
+ 'border-color' => esc_attr( $link_color ),
+ 'background-color' => esc_attr( '#ffffff' ),
+ ),
+ );
+
+ if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
+
+ $compat_css_desktop = array(
+ /**
+ * Cart in menu
+ */
+ '.ast-site-header-cart a' => array(
+ 'color' => esc_attr( $text_color ),
+ ),
+
+ '.ast-site-header-cart a:focus, .ast-site-header-cart a:hover, .ast-site-header-cart .current-menu-item a' => array(
+ 'color' => esc_attr( $link_color ),
+ ),
+
+ '.ast-cart-menu-wrap .count, .ast-cart-menu-wrap .count:after' => array(
+ 'border-color' => esc_attr( $link_color ),
+ 'color' => esc_attr( $link_color ),
+ ),
+
+ '.ast-cart-menu-wrap:hover .count' => array(
+ 'color' => esc_attr( $cart_h_color ),
+ 'background-color' => esc_attr( $link_color ),
+ ),
+
+ '.ast-site-header-cart .widget_shopping_cart .total .woocommerce-Price-amount' => array(
+ 'color' => esc_attr( $link_color ),
+ ),
+
+ '.woocommerce a.remove:hover, .ast-woocommerce-cart-menu .main-header-menu .woocommerce-custom-menu-item .menu-item:hover > .menu-link.remove:hover' => array(
+ 'color' => esc_attr( $link_color ),
+ 'border-color' => esc_attr( $link_color ),
+ 'background-color' => esc_attr( '#ffffff' ),
+ ),
+
+ /**
+ * Checkout button color for widget
+ */
+ '.ast-site-header-cart .widget_shopping_cart .buttons .button.checkout, .woocommerce .widget_shopping_cart .woocommerce-mini-cart__buttons .checkout.wc-forward' => array(
+ 'color' => $btn_h_color,
+ 'border-color' => $btn_bg_h_color,
+ 'background-color' => $btn_bg_h_color,
+ ),
+ '.site-header .ast-site-header-cart-data .button.wc-forward, .site-header .ast-site-header-cart-data .button.wc-forward:hover' => array(
+ 'color' => $btn_color,
+ ),
+ '.below-header-user-select .ast-site-header-cart .widget, .ast-above-header-section .ast-site-header-cart .widget a, .below-header-user-select .ast-site-header-cart .widget_shopping_cart a' => array(
+ 'color' => $text_color,
+ ),
+ '.below-header-user-select .ast-site-header-cart .widget_shopping_cart a:hover, .ast-above-header-section .ast-site-header-cart .widget_shopping_cart a:hover, .below-header-user-select .ast-site-header-cart .widget_shopping_cart a.remove:hover, .ast-above-header-section .ast-site-header-cart .widget_shopping_cart a.remove:hover' => array(
+ 'color' => esc_attr( $link_color ),
+ ),
+ );
+
+ $css_output = array_merge( $css_output, $compat_css_desktop );
+ }
+
+ if ( Astra_Builder_Helper::apply_flex_based_css() ) {
+ $css_output['.woocommerce[class*="rel-up-columns-"] .site-main div.product .related.products ul.products li.product, .woocommerce-page .site-main ul.products li.product'] = array(
+ 'width' => '100%',
+ );
+ }
+
+ if ( false === Astra_Icons::is_svg_icons() ) {
+ $css_output['.woocommerce ul.product-categories > li ul li:before'] = array(
+ 'content' => '"\e900"',
+ 'padding' => '0 5px 0 5px',
+ 'display' => 'inline-block',
+ 'font-family' => 'Astra',
+ 'transform' => 'rotate(-90deg)',
+ 'font-size' => '11px',
+ 'font-size' => '0.7rem',
+ );
+ } else {
+ $css_output['.woocommerce ul.product-categories > li ul li'] = array(
+ 'position' => 'relative',
+ );
+ if ( $is_site_rtl ) {
+ $css_output['.woocommerce ul.product-categories > li ul li:before'] = array(
+ 'content' => '""',
+ 'border-width' => '1px 0 0 1px',
+ 'border-style' => 'solid',
+ 'display' => 'inline-block',
+ 'width' => '6px',
+ 'height' => '6px',
+ 'position' => 'absolute',
+ 'top' => '50%',
+ 'margin-top' => '-2px',
+ '-webkit-transform' => 'rotate(45deg)',
+ 'transform' => 'rotate(45deg)',
+ );
+ $css_output['.woocommerce ul.product-categories > li ul li a'] = array(
+ 'margin-right' => '15px',
+ );
+ } else {
+ $css_output['.woocommerce ul.product-categories > li ul li:before'] = array(
+ 'content' => '""',
+ 'border-width' => '1px 1px 0 0',
+ 'border-style' => 'solid',
+ 'display' => 'inline-block',
+ 'width' => '6px',
+ 'height' => '6px',
+ 'position' => 'absolute',
+ 'top' => '50%',
+ 'margin-top' => '-2px',
+ '-webkit-transform' => 'rotate(45deg)',
+ 'transform' => 'rotate(45deg)',
+ );
+ $css_output['.woocommerce ul.product-categories > li ul li a'] = array(
+ 'margin-left' => '15px',
+ );
+ }
+ }
+
+ /* Parse WooCommerce General CSS from array() */
+ $css_output = astra_parse_css( $css_output );
+
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ $tablet_css_shop_page_grid = array(
+ '.woocommerce.tablet-columns-6 ul.products li.product, .woocommerce-page.tablet-columns-6 ul.products li.product' => array(
+ 'width' => '12.7%',
+ 'width' => 'calc(16.66% - 16.66px)',
+ ),
+ '.woocommerce.tablet-columns-5 ul.products li.product, .woocommerce-page.tablet-columns-5 ul.products li.product' => array(
+ 'width' => '16.2%',
+ 'width' => 'calc(20% - 16px)',
+ ),
+ '.woocommerce.tablet-columns-4 ul.products li.product, .woocommerce-page.tablet-columns-4 ul.products li.product' => array(
+ 'width' => '21.5%',
+ 'width' => 'calc(25% - 15px)',
+ ),
+ '.woocommerce.tablet-columns-3 ul.products li.product, .woocommerce-page.tablet-columns-3 ul.products li.product' => array(
+ 'width' => '30.2%',
+ 'width' => 'calc(33.33% - 14px)',
+ ),
+ '.woocommerce.tablet-columns-2 ul.products li.product, .woocommerce-page.tablet-columns-2 ul.products li.product' => array(
+ 'width' => '47.6%',
+ 'width' => 'calc(50% - 10px)',
+ ),
+ '.woocommerce.tablet-columns-1 ul.products li.product, .woocommerce-page.tablet-columns-1 ul.products li.product' => array(
+ 'width' => '100%',
+ ),
+ '.woocommerce div.product .related.products ul.products li.product' => array(
+ 'width' => '30.2%',
+ 'width' => 'calc(33.33% - 14px)',
+ ),
+ );
+
+ } else {
+ $archive_tablet_grid = $this->get_grid_column_count( 'archive', 'tablet' );
+
+ $tablet_css_shop_page_grid = array(
+ '.woocommerce.tablet-columns-' . $archive_tablet_grid . ' ul.products li.product, .woocommerce-page.tablet-columns-' . $archive_tablet_grid . ' ul.products' => array(
+ 'grid-template-columns' => 'repeat(' . $archive_tablet_grid . ', minmax(0, 1fr))',
+ ),
+ );
+ }
+ $css_output .= astra_parse_css( $tablet_css_shop_page_grid, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() );
+
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ if ( $is_site_rtl ) {
+ $tablet_shop_page_grid_lang_direction_css = array(
+ '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array(
+ 'width' => '30.2%',
+ 'width' => 'calc(33.33% - 14px)',
+ 'margin-left' => '20px',
+ ),
+ '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n)' => array(
+ 'margin-left' => 0,
+ 'clear' => 'left',
+ ),
+ '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n+1)' => array(
+ 'clear' => 'right',
+ ),
+ '.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)' => array(
+ 'margin-left' => '20px',
+ 'clear' => 'none',
+ ),
+ '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n)' => array(
+ 'margin-left' => '0',
+ 'clear' => 'left',
+ ),
+ '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n+1)' => array(
+ 'clear' => 'right',
+ ),
+ '.woocommerce div.product .related.products ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-1 .site-main ul.products li.product' => array(
+ 'margin-left' => 0,
+ 'clear' => 'left',
+ ),
+ '.woocommerce div.product .related.products ul.products li.product:nth-child(3n+1)' => array(
+ 'clear' => 'right',
+ ),
+ );
+ } else {
+ $tablet_shop_page_grid_lang_direction_css = array(
+ '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array(
+ 'width' => '30.2%',
+ 'width' => 'calc(33.33% - 14px)',
+ 'margin-right' => '20px',
+ ),
+ '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n)' => array(
+ 'margin-right' => 0,
+ 'clear' => 'right',
+ ),
+ '.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(3n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(3n+1)' => array(
+ 'clear' => 'left',
+ ),
+ '.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)' => array(
+ 'margin-right' => '20px',
+ 'clear' => 'none',
+ ),
+ '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n)' => array(
+ 'margin-right' => '0',
+ 'clear' => 'right',
+ ),
+ '.woocommerce.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.tablet-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.tablet-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.tablet-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.tablet-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.tablet-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.tablet-columns-6 ul.products li.product:nth-child(6n+1)' => array(
+ 'clear' => 'left',
+ ),
+ '.woocommerce div.product .related.products ul.products li.product:nth-child(3n), .woocommerce-page.tablet-columns-1 .site-main ul.products li.product' => array(
+ 'margin-right' => 0,
+ 'clear' => 'right',
+ ),
+ '.woocommerce div.product .related.products ul.products li.product:nth-child(3n+1)' => array(
+ 'clear' => 'left',
+ ),
+ );
+ }
+ $css_output .= astra_parse_css( $tablet_shop_page_grid_lang_direction_css, astra_get_mobile_breakpoint( '', 1 ), astra_get_tablet_breakpoint() );
+ }
+
+ /**
+ * Global button CSS - Tablet = min-wdth: (tablet + 1)px
+ */
+ if ( $is_site_rtl ) {
+ $min_tablet_css = array(
+ '.woocommerce #reviews #comments' => array(
+ 'width' => '55%',
+ 'float' => 'right',
+ ),
+ '.woocommerce #reviews #review_form_wrapper' => array(
+ 'width' => '45%',
+ 'float' => 'left',
+ 'padding-right' => '2em',
+ ),
+ '.woocommerce form.checkout_coupon' => array(
+ 'width' => '50%',
+ ),
+ );
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ $min_tablet_css['.woocommerce #reviews #comments']['float'] = 'right';
+ $min_tablet_css['.woocommerce #reviews #review_form_wrapper']['float'] = 'left';
+ }
+ } else {
+ $min_tablet_css = array(
+ '.woocommerce #reviews #comments' => array(
+ 'width' => '55%',
+ ),
+ '.woocommerce #reviews #review_form_wrapper' => array(
+ 'width' => '45%',
+ 'padding-left' => '2em',
+ ),
+ '.woocommerce form.checkout_coupon' => array(
+ 'width' => '50%',
+ ),
+ );
+
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ $min_tablet_css['.woocommerce #reviews #comments']['float'] = 'left';
+ $min_tablet_css['.woocommerce #reviews #review_form_wrapper']['float'] = 'right';
+ }
+ }
+
+ $css_output .= astra_parse_css( $min_tablet_css, astra_get_tablet_breakpoint( '', 1 ) );
+
+ /**
+ * Global button CSS - Tablet = max-width: (tab-breakpoint)px.
+ */
+ $css_global_button_tablet = array(
+ '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart, .ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack.ast-no-menu-items .ast-site-header-cart' => array(
+ 'padding-right' => 0,
+ 'padding-left' => 0,
+ ),
+ '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .main-header-bar' => array(
+ 'text-align' => 'center',
+ ),
+ '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-site-header-cart, .ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-1.ast-mobile-header-stack .ast-mobile-menu-buttons' => array(
+ 'display' => 'inline-block',
+ ),
+ '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-2.ast-mobile-header-inline .site-branding' => array(
+ 'flex' => 'auto',
+ ),
+ '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .site-branding' => array(
+ 'flex' => '0 0 100%',
+ ),
+ '.ast-header-break-point.ast-woocommerce-cart-menu .header-main-layout-3.ast-mobile-header-stack .main-header-container' => array(
+ 'display' => 'flex',
+ 'justify-content' => 'center',
+ ),
+ '.woocommerce-cart .woocommerce-shipping-calculator .button' => array(
+ 'width' => '100%',
+ ),
+ '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array(
+ 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'tablet' ),
+ 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'tablet' ),
+ 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'tablet' ),
+ 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'tablet' ),
+ ),
+ '.woocommerce div.product div.images, .woocommerce div.product div.summary, .woocommerce #content div.product div.images, .woocommerce #content div.product div.summary, .woocommerce-page div.product div.images, .woocommerce-page div.product div.summary, .woocommerce-page #content div.product div.images, .woocommerce-page #content div.product div.summary' => array(
+ 'float' => 'none',
+ 'width' => '100%',
+ ),
+ '.woocommerce-cart table.cart td.actions .ast-return-to-shop' => array(
+ 'display' => 'block',
+ 'text-align' => 'center',
+ 'margin-top' => '1em',
+ ),
+ );
+
+ if ( Astra_Builder_Helper::apply_flex_based_css() ) {
+ $css_global_button_tablet['.woocommerce ul.products, .woocommerce-page ul.products'] = array(
+ 'grid-template-columns' => 'repeat(3, minmax(0, 1fr))',
+ );
+
+ if ( is_shop() || is_product_taxonomy() ) {
+
+ $archive_tablet_grid = $this->get_grid_column_count( 'archive', 'tablet' );
+
+ $css_global_button_tablet[ '.woocommerce.tablet-columns-' . $archive_tablet_grid . ' ul.products' ] = array(
+ 'grid-template-columns' => 'repeat(' . $archive_tablet_grid . ', minmax(0, 1fr))',
+ );
+ $css_global_button_tablet['.woocommerce[class*="tablet-columns-"] .site-main div.product .related.products ul.products li.product'] = array(
+ 'width' => '100%',
+ );
+ }
+
+ if ( is_product() ) {
+
+ $single_tablet_grid = $this->get_grid_column_count( 'single', 'tablet' );
+
+ $css_global_button_tablet[ '.woocommerce.tablet-rel-up-columns-' . $single_tablet_grid . ' ul.products' ] = array(
+ 'grid-template-columns' => 'repeat(' . $single_tablet_grid . ', minmax(0, 1fr))',
+ );
+ $css_global_button_tablet['.woocommerce[class*="tablet-rel-up-columns-"] .site-main div.product .related.products ul.products li.product'] = array(
+ 'width' => '100%',
+ );
+ }
+ }
+
+ $css_output .= astra_parse_css( $css_global_button_tablet, '', astra_get_tablet_breakpoint() );
+
+ /**
+ * Global button CSS - Mobile = max-width: (mobile-breakpoint)px.
+ */
+ $css_global_button_mobile = array(
+ '.ast-separate-container .ast-woocommerce-container' => array(
+ 'padding' => '.54em 1em 1.33333em',
+ ),
+ '.woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link' => array(
+ 'padding-top' => astra_responsive_spacing( $theme_btn_padding, 'top', 'mobile' ),
+ 'padding-right' => astra_responsive_spacing( $theme_btn_padding, 'right', 'mobile' ),
+ 'padding-bottom' => astra_responsive_spacing( $theme_btn_padding, 'bottom', 'mobile' ),
+ 'padding-left' => astra_responsive_spacing( $theme_btn_padding, 'left', 'mobile' ),
+ ),
+ '.woocommerce-message, .woocommerce-error, .woocommerce-info' => array(
+ 'display' => 'flex',
+ 'flex-wrap' => 'wrap',
+ ),
+ '.woocommerce-message a.button, .woocommerce-error a.button, .woocommerce-info a.button' => array(
+ 'order' => '1',
+ 'margin-top' => '.5em',
+ ),
+
+ '.woocommerce .woocommerce-ordering, .woocommerce-page .woocommerce-ordering' => array(
+ 'float' => 'none',
+ 'margin-bottom' => '2em',
+ 'width' => '100%',
+ ),
+ '.woocommerce ul.products a.button, .woocommerce-page ul.products a.button' => array(
+ 'padding' => '0.5em 0.75em',
+ ),
+ '.woocommerce table.cart td.actions .button, .woocommerce #content table.cart td.actions .button, .woocommerce-page table.cart td.actions .button, .woocommerce-page #content table.cart td.actions .button' => array(
+ 'padding-left' => '1em',
+ 'padding-right' => '1em',
+ ),
+ '.woocommerce #content table.cart .button, .woocommerce-page #content table.cart .button' => array(
+ 'width' => '100%',
+ ),
+ '.woocommerce #content table.cart .product-thumbnail, .woocommerce-page #content table.cart .product-thumbnail' => array(
+ 'display' => 'block',
+ 'text-align' => 'center !important',
+ ),
+ '.woocommerce #content table.cart .product-thumbnail::before, .woocommerce-page #content table.cart .product-thumbnail::before' => array(
+ 'display' => 'none',
+ ),
+ '.woocommerce #content table.cart td.actions .coupon, .woocommerce-page #content table.cart td.actions .coupon' => array(
+ 'float' => 'none',
+ ),
+ '.woocommerce #content table.cart td.actions .coupon .button, .woocommerce-page #content table.cart td.actions .coupon .button' => array(
+ 'flex' => '1',
+ ),
+ '.woocommerce #content div.product .woocommerce-tabs ul.tabs li a, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li a' => array(
+ 'display' => 'block',
+ ),
+ );
+
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ $css_global_button_mobile['.woocommerce div.product .related.products ul.products li.product, .woocommerce.mobile-columns-2 ul.products li.product, .woocommerce-page.mobile-columns-2 ul.products li.product'] = array(
+ 'width' => '46.1%',
+ 'width' => 'calc(50% - 10px)',
+ );
+ $css_global_button_mobile['.woocommerce.mobile-columns-6 ul.products li.product, .woocommerce-page.mobile-columns-6 ul.products li.product'] = array(
+ 'width' => '10.2%',
+ 'width' => 'calc(16.66% - 16.66px)',
+ );
+ $css_global_button_mobile['.woocommerce.mobile-columns-5 ul.products li.product, .woocommerce-page.mobile-columns-5 ul.products li.product'] = array(
+ 'width' => '13%',
+ 'width' => 'calc(20% - 16px)',
+ );
+ $css_global_button_mobile['.woocommerce.mobile-columns-4 ul.products li.product, .woocommerce-page.mobile-columns-4 ul.products li.product'] = array(
+ 'width' => '19%',
+ 'width' => 'calc(25% - 15px)',
+ );
+ $css_global_button_mobile['.woocommerce.mobile-columns-3 ul.products li.product, .woocommerce-page.mobile-columns-3 ul.products li.product'] = array(
+ 'width' => '28.2%',
+ 'width' => 'calc(33.33% - 14px)',
+ );
+ $css_global_button_mobile['.woocommerce.mobile-columns-1 ul.products li.product, .woocommerce-page.mobile-columns-1 ul.products li.product'] = array(
+ 'width' => '100%',
+ );
+ } else {
+
+ $archive_mobile_grid = $this->get_grid_column_count( 'archive', 'mobile' );
+ $single_mobile_grid = $this->get_grid_column_count( 'single', 'mobile' );
+
+ $css_global_button_mobile[ '.woocommerce ul.products, .woocommerce-page ul.products, .woocommerce.mobile-columns-' . $archive_mobile_grid . ' ul.products, .woocommerce-page.mobile-columns-' . $archive_mobile_grid . ' ul.products' ] = array(
+ 'grid-template-columns' => 'repeat(' . $archive_mobile_grid . ', minmax(0, 1fr))',
+ );
+ $css_global_button_mobile[ '.woocommerce.mobile-rel-up-columns-' . $single_mobile_grid . ' ul.products' ] = array(
+ 'grid-template-columns' => 'repeat(' . $single_mobile_grid . ', minmax(0, 1fr))',
+ );
+ }
+
+ $css_output .= astra_parse_css( $css_global_button_mobile, '', astra_get_mobile_breakpoint() );
+
+ if ( $is_site_rtl ) {
+ $global_button_mobile_lang_direction_css = array(
+ '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array(
+ 'width' => '46.1%',
+ 'width' => 'calc(50% - 10px)',
+ 'margin-left' => '20px',
+ ),
+ '.woocommerce ul.products a.button.loading::after, .woocommerce-page ul.products a.button.loading::after' => array(
+ 'display' => 'inline-block',
+ 'margin-right' => '5px',
+ 'position' => 'initial',
+ ),
+ '.woocommerce.mobile-columns-1 .site-main ul.products li.product:nth-child(n), .woocommerce-page.mobile-columns-1 .site-main ul.products li.product:nth-child(n)' => array(
+ 'margin-left' => 0,
+ ),
+ '.woocommerce #content div.product .woocommerce-tabs ul.tabs li, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li' => array(
+ 'display' => 'block',
+ 'margin-left' => 0,
+ ),
+ );
+
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)'] = array(
+ 'margin-left' => '20px',
+ 'clear' => 'none',
+ );
+ $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-6>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-6>ul.products li.product:nth-child(2n)'] = array(
+ 'margin-left' => 0,
+ 'clear' => 'left',
+ );
+ $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(2n+1)'] = array(
+ 'clear' => 'right',
+ );
+ $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-] ul.products li.product:nth-child(n), .woocommerce[class*=columns-] ul.products li.product:nth-child(n)'] = array(
+ 'margin-left' => '20px',
+ 'clear' => 'none',
+ );
+ $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce div.product .related.products ul.products li.product:nth-child(2n)'] = array(
+ 'margin-left' => 0,
+ 'clear' => 'left',
+ );
+ $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce div.product .related.products ul.products li.product:nth-child(2n+1)'] = array(
+ 'clear' => 'right',
+ );
+ }
+ } else {
+ $global_button_mobile_lang_direction_css = array(
+ '.woocommerce[class*="columns-"].columns-3 > ul.products li.product, .woocommerce[class*="columns-"].columns-4 > ul.products li.product, .woocommerce[class*="columns-"].columns-5 > ul.products li.product, .woocommerce[class*="columns-"].columns-6 > ul.products li.product' => array(
+ 'width' => '46.1%',
+ 'width' => 'calc(50% - 10px)',
+ 'margin-right' => '20px',
+ ),
+ '.woocommerce ul.products a.button.loading::after, .woocommerce-page ul.products a.button.loading::after' => array(
+ 'display' => 'inline-block',
+ 'margin-left' => '5px',
+ 'position' => 'initial',
+ ),
+ '.woocommerce.mobile-columns-1 .site-main ul.products li.product:nth-child(n), .woocommerce-page.mobile-columns-1 .site-main ul.products li.product:nth-child(n)' => array(
+ 'margin-right' => 0,
+ ),
+ '.woocommerce #content div.product .woocommerce-tabs ul.tabs li, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li' => array(
+ 'display' => 'block',
+ 'margin-right' => 0,
+ ),
+ );
+
+ if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
+ $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"] ul.products li.product:nth-child(n), .woocommerce-page[class*="columns-"] ul.products li.product:nth-child(n)'] = array(
+ 'margin-right' => '20px',
+ 'clear' => 'none',
+ );
+ $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce-page[class*=columns-].columns-6>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-3>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-4>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-5>ul.products li.product:nth-child(2n), .woocommerce[class*=columns-].columns-6>ul.products li.product:nth-child(2n)'] = array(
+ 'margin-right' => 0,
+ 'clear' => 'right',
+ );
+ $global_button_mobile_lang_direction_css['.woocommerce[class*="columns-"].columns-3 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-4 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-5 > ul.products li.product:nth-child(2n+1), .woocommerce[class*="columns-"].columns-6 > ul.products li.product:nth-child(2n+1)'] = array(
+ 'clear' => 'left',
+ );
+ $global_button_mobile_lang_direction_css['.woocommerce-page[class*=columns-] ul.products li.product:nth-child(n), .woocommerce[class*=columns-] ul.products li.product:nth-child(n)'] = array(
+ 'margin-right' => '20px',
+ 'clear' => 'none',
+ );
+ $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n), .woocommerce div.product .related.products ul.products li.product:nth-child(2n)'] = array(
+ 'margin-right' => 0,
+ 'clear' => 'right',
+ );
+ $global_button_mobile_lang_direction_css['.woocommerce.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce-page.mobile-columns-6 ul.products li.product:nth-child(6n+1), .woocommerce.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce-page.mobile-columns-5 ul.products li.product:nth-child(5n+1), .woocommerce.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce-page.mobile-columns-4 ul.products li.product:nth-child(4n+1), .woocommerce.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce-page.mobile-columns-3 ul.products li.product:nth-child(3n+1), .woocommerce.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce-page.mobile-columns-2 ul.products li.product:nth-child(2n+1), .woocommerce div.product .related.products ul.products li.product:nth-child(2n+1)'] = array(
+ 'clear' => 'left',
+ );
+ }
+ }
+
+ $css_output .= astra_parse_css( $global_button_mobile_lang_direction_css, '', astra_get_mobile_breakpoint() );
+
+ if ( 'page-builder' !== astra_get_content_layout() ) {
+ /* Woocommerce Shop Archive width */
+ if ( 'custom' === $woo_shop_archive_width ) :
+ // Woocommerce shop archive custom width.
+ $site_width = array(
+ '.ast-woo-shop-archive .site-content > .ast-container' => array(
+ 'max-width' => astra_get_css_value( $woo_shop_archive_max_width, 'px' ),
+ ),
+ );
+ $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) );
+
+ else :
+ // Woocommerce shop archive default width.
+ $site_width = array(
+ '.ast-woo-shop-archive .site-content > .ast-container' => array(
+ 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ),
+ ),
+ );
+
+ /* Parse CSS from array()*/
+ $css_output .= astra_parse_css( $site_width, astra_get_tablet_breakpoint( '', 1 ) );
+ endif;
+ }
+
+ $woo_product_css = array(
+ '.woocommerce #content .ast-woocommerce-container div.product div.images, .woocommerce .ast-woocommerce-container div.product div.images, .woocommerce-page #content .ast-woocommerce-container div.product div.images, .woocommerce-page .ast-woocommerce-container div.product div.images' => array(
+ 'width' => '50%',
+ ),
+ '.woocommerce #content .ast-woocommerce-container div.product div.summary, .woocommerce .ast-woocommerce-container div.product div.summary, .woocommerce-page #content .ast-woocommerce-container div.product div.summary, .woocommerce-page .ast-woocommerce-container div.product div.summary' => array(
+ 'width' => '46%',
+ ),
+ '.woocommerce.woocommerce-checkout form #customer_details.col2-set .col-1, .woocommerce.woocommerce-checkout form #customer_details.col2-set .col-2, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set .col-1, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set .col-2' => array(
+ 'float' => 'none',
+ 'width' => 'auto',
+ ),
+ );
+
+ /* Parse CSS from array()*/
+ $css_output .= astra_parse_css( $woo_product_css, astra_get_tablet_breakpoint( '', 1 ) );
+
+ /*
+ * global button settings not working for woocommerce button on shop and single page.
+ * check if the current user is existing user or new user.
+ * if new user load the CSS bty default if existing provide a filter
+ */
+ if ( self::astra_global_btn_woo_comp() ) {
+
+ $woo_global_button_css = array(
+ '.woocommerce a.button , .woocommerce button.button.alt ,.woocommerce-page table.cart td.actions .button, .woocommerce-page #content table.cart td.actions .button , .woocommerce a.button.alt ,.woocommerce .woocommerce-message a.button , .ast-site-header-cart .widget_shopping_cart .buttons .button.checkout, .woocommerce button.button.alt.disabled , .wc-block-grid__products .wc-block-grid__product .wp-block-button__link ' => array(
+ 'border' => 'solid',
+ 'border-top-width' => ( isset( $global_custom_button_border_size['top'] ) && '' !== $global_custom_button_border_size['top'] ) ? astra_get_css_value( $global_custom_button_border_size['top'], 'px' ) : '0',
+ 'border-right-width' => ( isset( $global_custom_button_border_size['right'] ) && '' !== $global_custom_button_border_size['right'] ) ? astra_get_css_value( $global_custom_button_border_size['right'], 'px' ) : '0',
+ 'border-left-width' => ( isset( $global_custom_button_border_size['left'] ) && '' !== $global_custom_button_border_size['left'] ) ? astra_get_css_value( $global_custom_button_border_size['left'], 'px' ) : '0',
+ 'border-bottom-width' => ( isset( $global_custom_button_border_size['bottom'] ) && '' !== $global_custom_button_border_size['bottom'] ) ? astra_get_css_value( $global_custom_button_border_size['bottom'], 'px' ) : '0',
+ 'border-color' => $btn_border_color ? $btn_border_color : $btn_bg_color,
+ ),
+ '.woocommerce a.button:hover , .woocommerce button.button.alt:hover , .woocommerce-page table.cart td.actions .button:hover, .woocommerce-page #content table.cart td.actions .button:hover, .woocommerce a.button.alt:hover ,.woocommerce .woocommerce-message a.button:hover , .ast-site-header-cart .widget_shopping_cart .buttons .button.checkout:hover , .woocommerce button.button.alt.disabled:hover , .wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover' => array(
+ 'border-color' => $btn_border_h_color ? $btn_border_h_color : $btn_bg_h_color,
+ ),
+ );
+
+ $css_output .= astra_parse_css( $woo_global_button_css );
+ }
+
+ if ( ! is_shop() && ! is_product() ) {
+
+ $css_output .= astra_parse_css(
+ array(
+ '.widget_product_search button' => array(
+ 'flex' => '0 0 auto',
+ 'padding' => '10px 20px;',
+ ),
+ )
+ );
+ }
+
+ if ( $is_site_rtl ) {
+ $woo_product_lang_direction_css = array(
+ '.woocommerce.woocommerce-checkout form #customer_details.col2-set, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set' => array(
+ 'width' => '55%',
+ 'float' => 'right',
+ 'margin-left' => '4.347826087%',
+ ),
+ '.woocommerce.woocommerce-checkout form #order_review, .woocommerce.woocommerce-checkout form #order_review_heading, .woocommerce-page.woocommerce-checkout form #order_review, .woocommerce-page.woocommerce-checkout form #order_review_heading' => array(
+ 'width' => '40%',
+ 'float' => 'left',
+ 'margin-left' => '0',
+ 'clear' => 'left',
+ ),
+ );
+ } else {
+ $woo_product_lang_direction_css = array(
+ '.woocommerce.woocommerce-checkout form #customer_details.col2-set, .woocommerce-page.woocommerce-checkout form #customer_details.col2-set' => array(
+ 'width' => '55%',
+ 'float' => 'left',
+ 'margin-right' => '4.347826087%',
+ ),
+ '.woocommerce.woocommerce-checkout form #order_review, .woocommerce.woocommerce-checkout form #order_review_heading, .woocommerce-page.woocommerce-checkout form #order_review, .woocommerce-page.woocommerce-checkout form #order_review_heading' => array(
+ 'width' => '40%',
+ 'float' => 'right',
+ 'margin-right' => '0',
+ 'clear' => 'right',
+ ),
+ );
+ }
+
+ /* Parse CSS from array()*/
+ $css_output .= astra_parse_css( $woo_product_lang_direction_css, astra_get_tablet_breakpoint( '', 1 ) );
+
+ wp_add_inline_style( 'woocommerce-general', apply_filters( 'astra_theme_woocommerce_dynamic_css', $css_output ) );
+
+ /**
+ * YITH WooCommerce Wishlist Style
+ */
+ $yith_wcwl_main_style = array(
+ '.yes-js.js_active .ast-plain-container.ast-single-post #primary' => array(
+ 'margin' => esc_attr( '4em 0' ),
+ ),
+ '.js_active .ast-plain-container.ast-single-post .entry-header' => array(
+ 'margin-top' => esc_attr( '0' ),
+ ),
+ '.woocommerce table.wishlist_table' => array(
+ 'font-size' => esc_attr( '100%' ),
+ ),
+ '.woocommerce table.wishlist_table tbody td.product-name' => array(
+ 'font-weight' => esc_attr( '700' ),
+ ),
+ '.woocommerce table.wishlist_table thead th' => array(
+ 'border-top' => esc_attr( '0' ),
+ ),
+ '.woocommerce table.wishlist_table tr td.product-remove' => array(
+ 'padding' => esc_attr( '.7em 1em' ),
+ ),
+ '.woocommerce table.wishlist_table tbody td' => array(
+ 'border-right' => esc_attr( '0' ),
+ ),
+ '.woocommerce .wishlist_table td.product-add-to-cart a' => array(
+ 'display' => esc_attr( 'inherit !important' ),
+ ),
+ '.wishlist_table tr td, .wishlist_table tr th.wishlist-delete, .wishlist_table tr th.product-checkbox' => array(
+ 'text-align' => esc_attr( 'left' ),
+ ),
+ '.woocommerce #content table.wishlist_table.cart a.remove' => array(
+ 'display' => esc_attr( 'inline-block' ),
+ 'vertical-align' => esc_attr( 'middle' ),
+ 'font-size' => esc_attr( '18px' ),
+ 'font-weight' => esc_attr( 'normal' ),
+ 'width' => esc_attr( '24px' ),
+ 'height' => esc_attr( '24px' ),
+ 'line-height' => esc_attr( '21px' ),
+ 'color' => esc_attr( '#ccc !important' ),
+ 'text-align' => esc_attr( 'center' ),
+ 'border' => esc_attr( '1px solid #ccc' ),
+ ),
+ '.woocommerce #content table.wishlist_table.cart a.remove:hover' => array(
+ 'color' => esc_attr( $link_color . '!important' ),
+ 'border-color' => esc_attr( $link_color ),
+ 'background-color' => esc_attr( '#ffffff' ),
+ ),
+ );
+ /* Parse CSS from array() */
+ $yith_wcwl_main_style = astra_parse_css( $yith_wcwl_main_style );
+
+ $yith_wcwl_main_style_small = array(
+ '.yes-js.js_active .ast-plain-container.ast-single-post #primary' => array(
+ 'padding' => esc_attr( '1.5em 0' ),
+ 'margin' => esc_attr( '0' ),
+ ),
+ );
+ /* Parse CSS from array()*/
+ $yith_wcwl_main_style .= astra_parse_css( $yith_wcwl_main_style_small, '', astra_get_tablet_breakpoint() );
+
+ wp_add_inline_style( 'yith-wcwl-main', $yith_wcwl_main_style );
+ }
+
+ /**
+ * Register Customizer sections and panel for woocommerce
+ *
+ * @since 1.0.0
+ * @param WP_Customize_Manager $wp_customize Theme Customizer object.
+ */
+ public function customize_register( $wp_customize ) {
+
+ // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ /**
+ * Register Sections & Panels
+ */
+ require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php';
+
+ /**
+ * Sections
+ */
+ require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php';
+ require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php';
+ require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php';
+ require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php';
+ require ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php';
+ // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+
+ }
+
+ /**
+ * Add Cart icon markup
+ *
+ * @param String $output Markup.
+ * @param String $section Section name.
+ * @param String $section_type Section selected option.
+ * @return Markup String.
+ *
+ * @since 1.0.0
+ */
+ public function astra_header_cart( $output, $section, $section_type ) {
+
+ if ( 'woocommerce' === $section_type && apply_filters( 'astra_woo_header_cart_icon', true ) ) {
+
+ $output = $this->woo_mini_cart_markup();
+ }
+
+ return $output;
+ }
+
+ /**
+ * Woocommerce mini cart markup markup
+ *
+ * @since 1.2.2
+ * @return html
+ */
+ public function woo_mini_cart_markup() {
+
+ if ( is_cart() ) {
+ $class = 'current-menu-item';
+ } else {
+ $class = '';
+ }
+
+ $cart_menu_classes = apply_filters( 'astra_cart_in_menu_class', array( 'ast-menu-cart-with-border' ) );
+
+ ob_start();
+ if ( is_customize_preview() && true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
+ Astra_Builder_UI_Controller::render_customizer_edit_button();
+ }
+ ?>
+ <div id="ast-site-header-cart" class="ast-site-header-cart <?php echo esc_attr( implode( ' ', $cart_menu_classes ) ); ?>">
+ <div class="ast-site-header-cart-li <?php echo esc_attr( $class ); ?>">
+ <?php $this->astra_get_cart_link(); ?>
+ </div>
+ <div class="ast-site-header-cart-data">
+ <?php the_widget( 'WC_Widget_Cart', 'title=' ); ?>
+ </div>
+ </div>
+ <?php
+ return ob_get_clean();
+ }
+
+ /**
+ * Add Cart icon markup
+ *
+ * @param Array $options header options array.
+ *
+ * @return Array header options array.
+ * @since 1.0.0
+ */
+ public function header_section_elements( $options ) {
+
+ $options['woocommerce'] = 'WooCommerce';
+
+ return $options;
+ }
+
+ /**
+ * Cart Link
+ * Displayed a link to the cart including the number of items present and the cart total
+ *
+ * @return void
+ * @since 1.0.0
+ */
+ public function astra_get_cart_link() {
+
+ $view_shopping_cart = apply_filters( 'astra_woo_view_shopping_cart_title', __( 'View your shopping cart', 'astra' ) );
+
+ $woo_cart_link = wc_get_cart_url();
+
+ if ( is_customize_preview() ) {
+ $woo_cart_link = '#';
+ }
+ ?>
+ <a class="cart-container" href="<?php echo esc_url( $woo_cart_link ); ?>" title="<?php echo esc_attr( $view_shopping_cart ); ?>">
+
+ <?php
+ do_action( 'astra_woo_header_cart_icons_before' );
+
+ if ( apply_filters( 'astra_woo_default_header_cart_icon', true ) ) {
+ ?>
+ <div class="ast-cart-menu-wrap">
+ <span class="count">
+ <?php
+ if ( apply_filters( 'astra_woo_header_cart_total', true ) && null != WC()->cart ) {
+ echo WC()->cart->get_cart_contents_count(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+ }
+ ?>
+ </span>
+ </div>
+ <?php
+ }
+
+ do_action( 'astra_woo_header_cart_icons_after' );
+
+ ?>
+ </a>
+ <?php
+ }
+
+ /**
+ * Cart Fragments
+ * Ensure cart contents update when products are added to the cart via AJAX
+ *
+ * @param array $fragments Fragments to refresh via AJAX.
+ * @return array Fragments to refresh via AJAX
+ */
+ public function cart_link_fragment( $fragments ) {
+
+ ob_start();
+ $this->astra_get_cart_link();
+ $fragments['a.cart-container'] = ob_get_clean();
+
+ return $fragments;
+ }
+
+ /**
+ * For existing users, do not load the wide/full width image CSS by default.
+ *
+ * @since 2.5.0
+ * @return boolean false if it is an existing user , true if not.
+ */
+ public static function astra_global_btn_woo_comp() {
+ $astra_settings = get_option( ASTRA_THEME_SETTINGS );
+ $astra_settings['global-btn-woo-css'] = isset( $astra_settings['global-btn-woo-css'] ) ? false : true;
+ return apply_filters( 'astra_global_btn_woo_comp', $astra_settings['global-btn-woo-css'] );
+ }
+ }
+
+endif;
+
+if ( apply_filters( 'astra_enable_woocommerce_integration', true ) ) {
+ Astra_Woocommerce::get_instance();
+}
diff --git a/inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php b/inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php
new file mode 100644
index 0000000..e075ba1
--- /dev/null
+++ b/inc/compatibility/woocommerce/customizer/class-astra-customizer-register-woo-section.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Register customizer panels & sections fro Woocommerce.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.1.0
+ * @since 1.4.6 Chnaged to using Astra_Customizer API
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+if ( ! class_exists( 'Astra_Customizer_Register_Woo_Section' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Customizer_Register_Woo_Section extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Panels and Sections for Customizer.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $configs = array(
+
+ array(
+ 'name' => 'section-woo-general',
+ 'title' => __( 'General', 'astra' ),
+ 'type' => 'section',
+ 'priority' => 10,
+ 'panel' => 'woocommerce',
+ ),
+ array(
+ 'name' => 'section-woo-shop',
+ 'title' => __( 'Shop', 'astra' ),
+ 'type' => 'section',
+ 'priority' => 20,
+ 'panel' => 'woocommerce',
+ ),
+
+ array(
+ 'name' => 'section-woo-shop-single',
+ 'type' => 'section',
+ 'title' => __( 'Single Product', 'astra' ),
+ 'priority' => 12,
+ 'panel' => 'woocommerce',
+ ),
+
+ array(
+ 'name' => 'section-woo-shop-cart',
+ 'type' => 'section',
+ 'title' => __( 'Cart', 'astra' ),
+ 'priority' => 20,
+ 'panel' => 'woocommerce',
+ ),
+ );
+
+ return array_merge( $configurations, $configs );
+ }
+ }
+}
+
+
+new Astra_Customizer_Register_Woo_Section();
diff --git a/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php b/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php
new file mode 100644
index 0000000..a24d642
--- /dev/null
+++ b/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-container-configs.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Container Options for Astra theme.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since Astra 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Woo_Shop_Container_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Woo_Shop_Container_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra-WooCommerce Shop Container Settings.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Shop Page
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[woocommerce-content-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'default' => astra_get_option( 'woocommerce-content-layout' ),
+ 'section' => 'section-container-layout',
+ 'priority' => 85,
+ 'title' => __( 'WooCommerce Layout', 'astra' ),
+ 'divider' => array( 'ast_class' => 'ast-top-divider' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'boxed-container' => __( 'Boxed', 'astra' ),
+ 'content-boxed-container' => __( 'Content Boxed', 'astra' ),
+ 'plain-container' => __( 'Full Width / Contained', 'astra' ),
+ 'page-builder' => __( 'Full Width / Stretched', 'astra' ),
+ ),
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Woo_Shop_Container_Configs();
+
diff --git a/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php b/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php
new file mode 100644
index 0000000..6534163
--- /dev/null
+++ b/inc/compatibility/woocommerce/customizer/sections/class-astra-woo-shop-sidebar-configs.php
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Content Spacing Options for our theme.
+ *
+ * @package Astra
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since Astra 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Woo_Shop_Sidebar_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Woo_Shop_Sidebar_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra-WooCommerce Shop Sidebar Configurations.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Shop Page
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[woocommerce-sidebar-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'section' => 'section-sidebars',
+ 'default' => astra_get_option( 'woocommerce-sidebar-layout' ),
+ 'priority' => 5,
+ 'title' => __( 'WooCommerce', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'no-sidebar' => __( 'No Sidebar', 'astra' ),
+ 'left-sidebar' => __( 'Left Sidebar', 'astra' ),
+ 'right-sidebar' => __( 'Right Sidebar', 'astra' ),
+ ),
+ ),
+
+ /**
+ * Option: Single Product
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[single-product-sidebar-layout]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'default' => astra_get_option( 'single-product-sidebar-layout' ),
+ 'section' => 'section-sidebars',
+ 'priority' => 5,
+ 'title' => __( 'Single Product', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'no-sidebar' => __( 'No Sidebar', 'astra' ),
+ 'left-sidebar' => __( 'Left Sidebar', 'astra' ),
+ 'right-sidebar' => __( 'Right Sidebar', 'astra' ),
+ ),
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Woo_Shop_Sidebar_Configs();
+
+
+
diff --git a/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php
new file mode 100644
index 0000000..6c36a4f
--- /dev/null
+++ b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-cart-layout-configs.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * WooCommerce Options for Astra Theme.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Woo_Shop_Cart_Layout_Configs' ) ) {
+
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Woo_Shop_Cart_Layout_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra-WooCommerce Shop Cart Layout Customizer Configurations.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Cart upsells
+ *
+ * Enable Cross-sells - in the code it is refrenced as upsells rather than cross-sells.
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[enable-cart-upsells]',
+ 'section' => 'section-woo-shop-cart',
+ 'type' => 'control',
+ 'control' => 'ast-toggle-control',
+ 'default' => astra_get_option( 'enable-cart-upsells' ),
+ 'title' => __( 'Enable Cross-sells', 'astra' ),
+ 'priority' => 10,
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+ }
+ }
+}
+
+new Astra_Woo_Shop_Cart_Layout_Configs();
diff --git a/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php
new file mode 100644
index 0000000..77a0981
--- /dev/null
+++ b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-layout-configs.php
@@ -0,0 +1,158 @@
+<?php
+/**
+ * WooCommerce Options for Astra Theme.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Woo_Shop_Layout_Configs' ) ) {
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Woo_Shop_Layout_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra-WooCommerce Shop Layout Customizer Configurations.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Shop Columns
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[shop-grids]',
+ 'type' => 'control',
+ 'control' => 'ast-responsive-slider',
+ 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
+ 'section' => 'woocommerce_product_catalog',
+ 'default' => astra_get_option(
+ 'shop-grids',
+ array(
+ 'desktop' => 4,
+ 'tablet' => 3,
+ 'mobile' => 2,
+ )
+ ),
+ 'priority' => 11,
+ 'title' => __( 'Shop Columns', 'astra' ),
+ 'input_attrs' => array(
+ 'step' => 1,
+ 'min' => 1,
+ 'max' => 6,
+ ),
+ ),
+
+ /**
+ * Option: Products Per Page
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[shop-no-of-products]',
+ 'type' => 'control',
+ 'section' => 'woocommerce_product_catalog',
+ 'title' => __( 'Products Per Page', 'astra' ),
+ 'default' => astra_get_option( 'shop-no-of-products' ),
+ 'control' => 'number',
+ 'priority' => 15,
+ 'input_attrs' => array(
+ 'min' => 1,
+ 'step' => 1,
+ 'max' => 100,
+ ),
+ ),
+
+ /**
+ * Option: Single Post Meta
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[shop-product-structure]',
+ 'type' => 'control',
+ 'control' => 'ast-sortable',
+ 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ),
+ 'section' => 'woocommerce_product_catalog',
+ 'default' => astra_get_option( 'shop-product-structure' ),
+ 'priority' => 15,
+ 'title' => __( 'Shop Product Structure', 'astra' ),
+ 'choices' => array(
+ 'title' => __( 'Title', 'astra' ),
+ 'price' => __( 'Price', 'astra' ),
+ 'ratings' => __( 'Ratings', 'astra' ),
+ 'short_desc' => __( 'Short Description', 'astra' ),
+ 'add_cart' => __( 'Add To Cart', 'astra' ),
+ 'category' => __( 'Category', 'astra' ),
+ ),
+ ),
+
+ /**
+ * Option: Shop Archive Content Width
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[shop-archive-width]',
+ 'type' => 'control',
+ 'control' => 'ast-select',
+ 'section' => 'woocommerce_product_catalog',
+ 'default' => astra_get_option( 'shop-archive-width' ),
+ 'priority' => 10,
+ 'title' => __( 'Shop Archive Content Width', 'astra' ),
+ 'choices' => array(
+ 'default' => __( 'Default', 'astra' ),
+ 'custom' => __( 'Custom', 'astra' ),
+ ),
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+ ),
+
+ /**
+ * Option: Enter Width
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[shop-archive-max-width]',
+ 'type' => 'control',
+ 'control' => 'ast-slider',
+ 'section' => 'woocommerce_product_catalog',
+ 'default' => astra_get_option( 'shop-archive-max-width' ),
+ 'priority' => 10,
+ 'title' => __( 'Custom Width', 'astra' ),
+ 'transport' => 'postMessage',
+ 'suffix' => 'px',
+ 'input_attrs' => array(
+ 'min' => 768,
+ 'step' => 1,
+ 'max' => 1920,
+ ),
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+ 'context' => array(
+ Astra_Builder_Helper::$general_tab_config,
+ array(
+ 'setting' => ASTRA_THEME_SETTINGS . '[shop-archive-width]',
+ 'operator' => '===',
+ 'value' => 'custom',
+ ),
+ ),
+ ),
+ );
+
+ $configurations = array_merge( $configurations, $_configs );
+
+ return $configurations;
+
+ }
+ }
+}
+
+new Astra_Woo_Shop_Layout_Configs();
+
diff --git a/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php
new file mode 100644
index 0000000..5a02370
--- /dev/null
+++ b/inc/compatibility/woocommerce/customizer/sections/layout/class-astra-woo-shop-single-layout-configs.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * WooCommerce Options for Astra Theme.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! class_exists( 'Astra_Woo_Shop_Single_Layout_Configs' ) ) {
+
+
+ /**
+ * Customizer Sanitizes Initial setup
+ */
+ class Astra_Woo_Shop_Single_Layout_Configs extends Astra_Customizer_Config_Base {
+
+ /**
+ * Register Astra-WooCommerce Shop Single Layout Customizer Configurations.
+ *
+ * @param Array $configurations Astra Customizer Configurations.
+ * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
+ * @since 1.4.3
+ * @return Array Astra Customizer Configurations with updated configurations.
+ */
+ public function register_configuration( $configurations, $wp_customize ) {
+
+ $_configs = array(
+
+ /**
+ * Option: Disable Breadcrumb
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[single-product-breadcrumb-disable]',
+ 'section' => 'section-woo-shop-single',
+ 'type' => 'control',
+ 'control' => 'ast-toggle-control',
+ 'default' => astra_get_option( 'single-product-breadcrumb-disable' ),
+ 'title' => __( 'Disable Breadcrumb', 'astra' ),
+ 'priority' => 16,
+ ),
+
+ /**
+ * Option: Disable Transparent Header on WooCommerce Product pages
+ */
+ array(
+ 'name' => ASTRA_THEME_SETTINGS . '[transparent-header-disable-woo-products]',
+ 'default' => astra_get_option( 'transparent-header-disable-woo-products' ),
+ 'type' => 'control',
+ 'section' => 'section-transparent-header',
+ 'title' => __( 'Disable on WooCommerce Product Pages?', 'astra' ),
+ 'context' => array(
+ Astra_Builder_Helper::$general_tab_config,
+ array(
+ 'setting' => ASTRA_THEME_SETTINGS . '[transparent-header-enable]',
+ 'operator' => '==',
+ 'value' => '1',
+ ),
+ ),
+ 'priority' => 26,
+ 'control' => 'ast-toggle-control',
+ 'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
+ ),
+ );
+
+ return array_merge( $configurations, $_configs );
+
+ }
+ }
+}
+
+new Astra_Woo_Shop_Single_Layout_Configs();
+
+
diff --git a/inc/compatibility/woocommerce/woocommerce-common-functions.php b/inc/compatibility/woocommerce/woocommerce-common-functions.php
new file mode 100644
index 0000000..4921337
--- /dev/null
+++ b/inc/compatibility/woocommerce/woocommerce-common-functions.php
@@ -0,0 +1,299 @@
+<?php
+/**
+ * Custom functions that used for Woocommerce compatibility.
+ *
+ * Eventually, some of the functionality here could be replaced by core features.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Shop page - Products Title markup updated
+ */
+if ( ! function_exists( 'astra_woo_shop_products_title' ) ) :
+
+ /**
+ * Shop Page product titles with anchor
+ *
+ * @hooked woocommerce_after_shop_loop_item - 10
+ *
+ * @since 1.1.0
+ */
+ function astra_woo_shop_products_title() {
+ echo '<a href="' . esc_url( get_the_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
+
+ echo '<h2 class="woocommerce-loop-product__title">' . esc_html( get_the_title() ) . '</h2>';
+
+ echo '</a>';
+ }
+
+endif;
+
+/**
+ * Shop page - Parent Category
+ */
+if ( ! function_exists( 'astra_woo_shop_parent_category' ) ) :
+ /**
+ * Add and/or Remove Categories from shop archive page.
+ *
+ * @hooked woocommerce_after_shop_loop_item - 9
+ *
+ * @since 1.1.0
+ */
+ function astra_woo_shop_parent_category() {
+ if ( apply_filters( 'astra_woo_shop_parent_category', true ) ) : ?>
+ <span class="ast-woo-product-category">
+ <?php
+ global $product;
+ $product_categories = function_exists( 'wc_get_product_category_list' ) ? wc_get_product_category_list( get_the_ID(), ';', '', '' ) : $product->get_categories( ';', '', '' );
+
+ $product_categories = htmlspecialchars_decode( wp_strip_all_tags( $product_categories ) );
+ if ( $product_categories ) {
+ list( $parent_cat ) = explode( ';', $product_categories );
+ echo apply_filters( 'astra_woo_shop_product_categories', esc_html( $parent_cat ), get_the_ID() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+ }
+
+ ?>
+ </span>
+ <?php
+ endif;
+ }
+endif;
+
+/**
+ * Shop page - Out of Stock
+ */
+if ( ! function_exists( 'astra_woo_shop_out_of_stock' ) ) :
+ /**
+ * Add Out of Stock to the Shop page
+ *
+ * @hooked woocommerce_shop_loop_item_title - 8
+ *
+ * @since 1.1.0
+ */
+ function astra_woo_shop_out_of_stock() {
+ $out_of_stock = get_post_meta( get_the_ID(), '_stock_status', true );
+ $out_of_stock_string = apply_filters( 'astra_woo_shop_out_of_stock_string', __( 'Out of stock', 'astra' ) );
+ if ( 'outofstock' === $out_of_stock ) {
+ ?>
+ <span class="ast-shop-product-out-of-stock"><?php echo esc_html( $out_of_stock_string ); ?></span>
+ <?php
+ }
+ }
+
+endif;
+
+/**
+ * Shop page - Short Description
+ */
+if ( ! function_exists( 'astra_woo_shop_product_short_description' ) ) :
+ /**
+ * Product short description
+ *
+ * @hooked woocommerce_after_shop_loop_item
+ *
+ * @since 1.1.0
+ */
+ function astra_woo_shop_product_short_description() {
+ ?>
+ <?php if ( has_excerpt() ) { ?>
+ <div class="ast-woo-shop-product-description">
+ <?php the_excerpt(); ?>
+ </div>
+ <?php } ?>
+ <?php
+ }
+endif;
+/**
+ * Product page - Availability: in stock
+ */
+if ( ! function_exists( 'astra_woo_product_in_stock' ) ) :
+ /**
+ * Availability: in stock string updated
+ *
+ * @param string $markup Markup.
+ * @param object $product Object of Product.
+ *
+ * @since 1.1.0
+ */
+ function astra_woo_product_in_stock( $markup, $product ) {
+
+ if ( is_product() ) {
+ $product_avail = $product->get_availability();
+ $stock_quantity = $product->get_stock_quantity();
+ $availability = $product_avail['availability'];
+ $avail_class = $product_avail['class'];
+ if ( ! empty( $availability ) && $stock_quantity ) {
+ ob_start();
+ ?>
+ <p class="ast-stock-detail">
+ <span class="ast-stock-avail"><?php esc_html_e( 'Availability:', 'astra' ); ?></span>
+ <span class="stock <?php echo esc_html( $avail_class ); ?>"><?php echo esc_html( $availability ); ?></span>
+ </p>
+ <?php
+ $markup = ob_get_clean();
+ }
+ }
+
+ return $markup;
+ }
+endif;
+
+if ( ! function_exists( 'astra_woo_woocommerce_template_loop_product_title' ) ) {
+
+ /**
+ * Show the product title in the product loop. By default this is an H2.
+ */
+ function astra_woo_woocommerce_template_loop_product_title() {
+
+ echo '<a href="' . esc_url( get_the_permalink() ) . '" class="ast-loop-product__link">';
+ woocommerce_template_loop_product_title();
+ echo '</a>';
+ }
+}
+
+if ( ! function_exists( 'astra_woo_woocommerce_shop_product_content' ) ) {
+
+ /**
+ * Show the product title in the product loop. By default this is an H2.
+ */
+ function astra_woo_woocommerce_shop_product_content() {
+
+ $shop_structure = apply_filters( 'astra_woo_shop_product_structure', astra_get_option( 'shop-product-structure' ) );
+ if ( is_array( $shop_structure ) && ! empty( $shop_structure ) ) {
+
+ do_action( 'astra_woo_shop_before_summary_wrap' );
+ echo '<div class="astra-shop-summary-wrap">';
+ do_action( 'astra_woo_shop_summary_wrap_top' );
+
+ foreach ( $shop_structure as $value ) {
+
+ switch ( $value ) {
+ case 'title':
+ /**
+ * Add Product Title on shop page for all products.
+ */
+ do_action( 'astra_woo_shop_title_before' );
+ astra_woo_woocommerce_template_loop_product_title();
+ do_action( 'astra_woo_shop_title_after' );
+ break;
+ case 'price':
+ /**
+ * Add Product Price on shop page for all products.
+ */
+ do_action( 'astra_woo_shop_price_before' );
+ woocommerce_template_loop_price();
+ do_action( 'astra_woo_shop_price_after' );
+ break;
+ case 'ratings':
+ /**
+ * Add rating on shop page for all products.
+ */
+ do_action( 'astra_woo_shop_rating_before' );
+ woocommerce_template_loop_rating();
+ do_action( 'astra_woo_shop_rating_after' );
+ break;
+ case 'short_desc':
+ do_action( 'astra_woo_shop_short_description_before' );
+ astra_woo_shop_product_short_description();
+ do_action( 'astra_woo_shop_short_description_after' );
+ break;
+ case 'add_cart':
+ do_action( 'astra_woo_shop_add_to_cart_before' );
+ woocommerce_template_loop_add_to_cart();
+ do_action( 'astra_woo_shop_add_to_cart_after' );
+ break;
+ case 'category':
+ /**
+ * Add and/or Remove Categories from shop archive page.
+ */
+ do_action( 'astra_woo_shop_category_before' );
+ astra_woo_shop_parent_category();
+ do_action( 'astra_woo_shop_category_after' );
+ break;
+ default:
+ break;
+ }
+ }
+
+ do_action( 'astra_woo_shop_summary_wrap_bottom' );
+ echo '</div>';
+ do_action( 'astra_woo_shop_after_summary_wrap' );
+ }
+ }
+}
+
+if ( ! function_exists( 'astra_woo_shop_thumbnail_wrap_start' ) ) {
+
+ /**
+ * Thumbnail wrap start.
+ */
+ function astra_woo_shop_thumbnail_wrap_start() {
+
+ echo '<div class="astra-shop-thumbnail-wrap">';
+ }
+}
+
+if ( ! function_exists( 'astra_woo_shop_thumbnail_wrap_end' ) ) {
+
+ /**
+ * Thumbnail wrap end.
+ */
+ function astra_woo_shop_thumbnail_wrap_end() {
+
+ echo '</div>';
+ }
+}
+
+
+/**
+ * Woocommerce filter - Widget Products Tags
+ */
+if ( ! function_exists( 'astra_widget_product_tag_cloud_args' ) ) {
+
+ /**
+ * Woocommerce filter - Widget Products Tags
+ *
+ * @param array $args Tag arguments.
+ * @return array Modified tag arguments.
+ */
+ function astra_widget_product_tag_cloud_args( $args = array() ) {
+
+ $sidebar_link_font_size = astra_get_option( 'font-size-body' );
+ $sidebar_link_font_size['desktop'] = ( '' != $sidebar_link_font_size['desktop'] ) ? $sidebar_link_font_size['desktop'] : 15;
+
+ $args['smallest'] = intval( $sidebar_link_font_size['desktop'] ) - 2;
+ $args['largest'] = intval( $sidebar_link_font_size['desktop'] ) + 3;
+ $args['unit'] = 'px';
+
+ return apply_filters( 'astra_widget_product_tag_cloud_args', $args );
+ }
+ add_filter( 'woocommerce_product_tag_cloud_widget_args', 'astra_widget_product_tag_cloud_args', 90 );
+
+}
+
+/**
+ * Woocommerce shop/product div close tag.
+ */
+if ( ! function_exists( 'astra_woocommerce_div_wrapper_close' ) ) :
+
+ /**
+ * Woocommerce shop/product div close tag.
+ *
+ * @return void
+ */
+ function astra_woocommerce_div_wrapper_close() {
+
+ echo '</div>';
+
+ }
+
+endif;