Astra_Woocommerce::add_scripts_styles()
Enqueue styles
Description
Source
File: inc/compatibility/woocommerce/class-astra-woocommerce.php
public function add_scripts_styles() { if ( is_cart() ) { wp_enqueue_script( 'wc-cart-fragments' ); // Require for cart widget update on the cart page. } /** * - 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' ); $if_free_shipping = astra_get_option( 'single-product-enable-shipping' ); $single_product_heading_tab_active_color = astra_get_option( 'single-product-heading-tab-active-color' ); $global_palette = astra_get_option( 'global-color-palette' ); $ltr_left = $is_site_rtl ? 'right' : 'left'; $ltr_right = $is_site_rtl ? 'left' : 'right'; $icon_cart_color_slug = ''; $theme_btn_font_size = astra_get_option( 'font-size-button' ); $font_style_updates = self::astra_update_default_font_styling(); if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { $icon_cart_color_slug = 'woo-header-cart-icon-color'; } else { $icon_cart_color_slug = 'header-woo-cart-icon-color'; } // Supporting color setting for default icon as well. $can_update_cart_color = astra_cart_color_default_icon_old_header(); $cart_new_color_setting = astra_get_option( $icon_cart_color_slug, $theme_color ); $header_cart_count_color = ( $can_update_cart_color ) ? $cart_new_color_setting : $theme_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_fields = astra_get_option( 'button-radius-fields' ); $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 = ''; $theme_color = astra_get_option( 'theme-color' ); $btn_color = astra_get_option( 'button-color' ); if ( empty( $btn_color ) ) { $btn_color = astra_get_foreground_color( $theme_color ); } // WooCommerce global button compatibility for new users only. $woo_btn_compatibility_desktop = array(); $woo_btn_compatibility_tablet = array(); $woo_btn_compatibility_mobile = array(); $astra_support_woo_btns_global = Astra_Dynamic_CSS::astra_woo_support_global_settings(); if ( $astra_support_woo_btns_global ) { $woo_btn_compatibility_desktop = astra_get_font_array_css( astra_get_option( 'font-family-button' ), astra_get_option( 'font-weight-button' ), $theme_btn_font_size, 'font-extras-button' ); $woo_btn_compatibility_tablet = array( 'font-size' => astra_get_font_css_value( $theme_btn_font_size['tablet'], $theme_btn_font_size['tablet-unit'] ), ); $woo_btn_compatibility_mobile = array( 'font-size' => astra_get_font_css_value( $theme_btn_font_size['mobile'], $theme_btn_font_size['mobile-unit'] ), ); } $css_desktop_output = array( '#customer_details h3:not(.elementor-widget-woocommerce-checkout-page h3)' => array( 'font-size' => $font_style_updates ? '' : '1.2rem', 'padding' => '20px 0 14px', 'margin' => '0 0 20px', 'border-bottom' => '1px solid var(--ast-border-color)', 'font-weight' => $font_style_updates ? '' : '700', ), 'form #order_review_heading:not(.elementor-widget-woocommerce-checkout-page #order_review_heading)' => array( 'border-width' => '2px 2px 0 2px', 'border-style' => 'solid', 'font-size' => $font_style_updates ? '' : '1.2rem', 'margin' => '0', 'padding' => '1.5em 1.5em 1em', 'border-color' => 'var(--ast-border-color)', 'font-weight' => $font_style_updates ? '' : '700', ), '.woocommerce-Address h3, .cart-collaterals h2' => array( 'font-size' => $font_style_updates ? '' : '1.2rem', 'padding' => '.7em 1em', ), '.woocommerce-cart .cart-collaterals .cart_totals>h2' => array( 'font-weight' => $font_style_updates ? '' : '700', ), 'form #order_review:not(.elementor-widget-woocommerce-checkout-page #order_review)' => array( 'padding' => '0 2em', 'border-width' => '0 2px 2px', 'border-style' => 'solid', 'border-color' => 'var(--ast-border-color)', ), 'ul#shipping_method li:not(.elementor-widget-woocommerce-cart #shipping_method li)' => array( 'margin' => '0', 'padding' => '0.25em 0 0.25em 22px', 'text-indent' => '-22px', 'list-style' => 'none outside', ), '.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-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, ), '.woocommerce .star-rating, .woocommerce .comment-form-rating .stars a, .woocommerce .star-rating::before' => array( 'color' => 'var(--ast-global-color-3)', ), '.woocommerce div.product .woocommerce-tabs ul.tabs li.active:before, .woocommerce div.ast-product-tabs-layout-vertical .woocommerce-tabs ul.tabs li:hover::before' => array( 'background' => $single_product_heading_tab_active_color ? $single_product_heading_tab_active_color : $link_color, ), ); 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_desktop_output = array_merge( $css_desktop_output, $compat_css_desktop ); } // WooCommerce global button compatibility for new users only. if ( ! $astra_support_woo_btns_global ) { $css_desktop_output['.woocommerce .woocommerce-cart-form button[name="update_cart"]:disabled'] = array( 'color' => esc_attr( $btn_color ), ); $css_desktop_output['.woocommerce #content table.cart .button[name="apply_coupon"], .woocommerce-page #content table.cart .button[name="apply_coupon"]'] = array( 'padding' => '10px 40px', ); $css_desktop_output['.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( 'line-height' => '1', 'border-width' => '1px', 'border-style' => 'solid', ); $css_desktop_output['.woocommerce ul.products li.product .button, .woocommerce-page ul.products li.product .button'] = array( 'line-height' => '1.3', ); $css_desktop_output['.woocommerce-js a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce-js 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, ); $css_desktop_output['.woocommerce-js 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-js 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, ); $css_desktop_output['.woocommerce-js a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce-js 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_merge( $woo_btn_compatibility_desktop, array( 'border-top-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'top', 'desktop' ), 'border-top-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'right', 'desktop' ), 'border-bottom-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'bottom', 'desktop' ), 'border-bottom-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'left', 'desktop' ), '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' ), ) ); $css_desktop_output['.woocommerce ul.products li.product a, .woocommerce-js a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce #respond input#submit:hover'] = array( 'text-decoration' => 'none', ); } if ( Astra_Dynamic_CSS::v4_block_editor_compat() ) { $css_desktop_output['.entry-content .woocommerce-message, .entry-content .woocommerce-error, .entry-content .woocommerce-info'] = array( 'padding-top' => '1em', 'padding-bottom' => '1em', 'padding-' . $ltr_left => '3.5em', 'padding-' . $ltr_right => '2em', ); } if ( Astra_Builder_Helper::apply_flex_based_css() ) { $css_desktop_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 ( is_cart() && false === Astra_Builder_Helper::apply_flex_based_css() && true === astra_get_option( 'cart-modern-layout' ) && true === astra_get_option( 'enable-cart-upsells' ) ) { $css_desktop_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%', ); } // Backward compatibility for old users for h2 tag global fonts. if ( apply_filters( 'astra_theme_woocommerce_global_h2_font', astra_get_option( 'woo_support_global_settings', false ) ) ) { $css_desktop_output['.woocommerce .up-sells h2, .woocommerce .related.products h2, .woocommerce .woocommerce-tabs h2'] = array( 'font-size' => '1.5rem', ); $css_desktop_output['.woocommerce h2, .woocommerce-account h2'] = array( 'font-size' => '1.625rem', ); } if ( false === Astra_Icons::is_svg_icons() ) { $css_desktop_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', ); $css_desktop_output['.ast-site-header-cart i.astra-icon:before'] = array( 'font-family' => 'Astra', ); $css_desktop_output['.ast-icon-shopping-cart:before'] = array( 'content' => '"\f07a"', ); $css_desktop_output['.ast-icon-shopping-bag:before'] = array( 'content' => '"\f290"', ); $css_desktop_output['.ast-icon-shopping-basket:before'] = array( 'content' => '"\f291"', ); } else { $css_desktop_output['.woocommerce ul.product-categories > li ul li'] = array( 'position' => 'relative', ); if ( $is_site_rtl ) { $css_desktop_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_desktop_output['.woocommerce ul.product-categories > li ul li a'] = array( 'margin-right' => '15px', ); } else { $css_desktop_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_desktop_output['.woocommerce ul.product-categories > li ul li a'] = array( 'margin-left' => '15px', ); } } $css_desktop_output['.ast-icon-shopping-cart svg'] = array( 'height' => '.82em', ); $css_desktop_output['.ast-icon-shopping-bag svg'] = array( 'height' => '1em', 'width' => '1em', ); $css_desktop_output['.ast-icon-shopping-basket svg'] = array( 'height' => '1.15em', 'width' => '1.2em', ); $css_desktop_output['.ast-site-header-cart.ast-menu-cart-outline .ast-addon-cart-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-addon-cart-wrap '] = array( 'line-height' => '1', ); $css_desktop_output['.ast-site-header-cart.ast-menu-cart-fill i.astra-icon'] = array( ' font-size' => '1.1em', ); $css_desktop_output['.ast-site-header-cart.ast-menu-cart-fill i.astra-icon'] = array( ' font-size' => '1.1em', ); $css_desktop_output['li.woocommerce-custom-menu-item .ast-site-header-cart i.astra-icon:after'] = array( ' padding-left' => '2px', ); $css_desktop_output['.ast-hfb-header .ast-addon-cart-wrap'] = array( ' padding' => '0.4em', ); $css_desktop_output['.ast-header-break-point.ast-header-custom-item-outside .ast-woo-header-cart-info-wrap'] = array( ' display' => 'none', ); $css_desktop_output['.ast-site-header-cart i.astra-icon:after'] = array( ' background' => $header_cart_count_color, ); if ( is_account_page() && false === astra_get_option( 'modern-woo-account-view', false ) ) { $css_output .= ' body .woocommerce-MyAccount-navigation-link { list-style: none; border: 1px solid var(--ast-border-color); border-bottom-width: 0; } body .woocommerce-MyAccount-navigation-link:last-child { border-bottom-width: 1px; } body .woocommerce-MyAccount-navigation-link.is-active a { background-color: #fbfbfb; } body .woocommerce-MyAccount-navigation-link a { display: block; padding: .5em 1em; } body .woocommerce form.login, body .woocommerce form.checkout_coupon, body .woocommerce form.register { border: 1px solid var(--ast-border-color); padding: 20px; margin: 2em 0; text-align: left; border-radius: 5px; } '; } // If Off canvas cart is enabled then we should not show view cart link. if ( 'flyout' === astra_get_option( 'woo-header-cart-click-action' ) ) { $css_output .= '.woocommerce a.added_to_cart { display: none; }'; } /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( ! ( defined( 'ASTRA_EXT_VER' ) && class_exists( 'Astra_Ext_Extension' ) && Astra_Ext_Extension::is_active( 'woocommerce' ) ) ) { /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= ' .woocommerce .woocommerce-result-count, .woocommerce-page .woocommerce-result-count { float: left; } .woocommerce .woocommerce-ordering { float: right; margin-bottom: 2.5em; } '; } if ( true === astra_check_is_structural_setup() ) { $css_desktop_output['.ast-separate-container .ast-woocommerce-container'] = array( 'padding' => '3em', ); } if ( ! $astra_support_woo_btns_global ) { $css_output .= ' .woocommerce-js a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit { font-size: 100%; line-height: 1; text-decoration: none; overflow: visible; padding: 0.5em 0.75em; font-weight: 700; border-radius: 3px; color: $secondarytext; background-color: $secondary; border: 0; } .woocommerce-js a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce #respond input#submit:hover { background-color: #dad8da; background-image: none; color: #515151; } '; } /* Parse WooCommerce General CSS from array() */ $css_output .= astra_parse_css( $css_desktop_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:not(.elementor-grid)' => 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 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 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 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_support_woo_btns_global ) { $css_global_button_tablet['.woocommerce-js a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce-js 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_merge( $woo_btn_compatibility_tablet, array( 'border-top-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'top', 'tablet' ), 'border-top-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'right', 'tablet' ), 'border-bottom-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'bottom', 'tablet' ), 'border-bottom-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'left', 'tablet' ), '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' ), ) ); } if ( Astra_Builder_Helper::apply_flex_based_css() ) { $archive_tablet_grid = $this->get_grid_column_count( 'archive', 'tablet' ); $css_global_button_tablet[ '.ast-container .woocommerce ul.products:not(.elementor-grid), .woocommerce-page ul.products:not(.elementor-grid), .woocommerce.tablet-columns-' . $archive_tablet_grid . ' ul.products:not(.elementor-grid)' ] = array( 'grid-template-columns' => 'repeat(' . $archive_tablet_grid . ', minmax(0, 1fr))', ); if ( is_shop() || is_product_taxonomy() ) { $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-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', ), '.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 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_support_woo_btns_global ) { $css_global_button_mobile['.woocommerce ul.products a.button, .woocommerce-page ul.products a.button'] = array( 'padding' => '0.5em 0.75em', ); $css_global_button_mobile['.woocommerce-js a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce-js 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_merge( $woo_btn_compatibility_mobile, array( 'border-top-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'top', 'mobile' ), 'border-top-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'right', 'mobile' ), 'border-bottom-right-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'bottom', 'mobile' ), 'border-bottom-left-radius' => astra_responsive_spacing( $btn_border_radius_fields, 'left', 'mobile' ), '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' ), ) ); } 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[ '.ast-container .woocommerce ul.products:not(.elementor-grid), .woocommerce-page ul.products:not(.elementor-grid), .woocommerce.mobile-columns-' . $archive_mobile_grid . ' ul.products:not(.elementor-grid), .woocommerce-page.mobile-columns-' . $archive_mobile_grid . ' ul.products:not(.elementor-grid)' ] = 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::not(.elementor-grid)' ] = 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 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-"].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' => 'calc(50% - 10px)', 'margin-left' => '20px', ); $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 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-"].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' => 'calc(50% - 10px)', 'margin-right' => '20px', ); $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() ) { if ( ! $astra_support_woo_btns_global ) { $woo_global_button_css = array( '.woocommerce-js a.button , .woocommerce button.button.alt ,.woocommerce-page table.cart td.actions .button, .woocommerce-page #content table.cart td.actions .button , .woocommerce-js 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-js 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-js 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 ( $if_free_shipping ) { $woo_free_shipping_text = array( '.summary .price' => array( 'display' => 'inline-block', ), '.ast-shipping-text' => array( 'display' => 'inline', ), ); $css_output .= astra_parse_css( $woo_free_shipping_text ); } } 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()*/ /** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $woo_product_lang_direction_css, astra_get_tablet_breakpoint( '', 1 ) ); /** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** * Single page cart button size. */ $single_product_cart_button_width = astra_get_option( 'single-product-cart-button-width' ); $single_product_cart_button_width_desktop = ( ! empty( $single_product_cart_button_width['desktop'] ) ) ? $single_product_cart_button_width['desktop'] : ''; $single_product_cart_button_width_tablet = ( ! empty( $single_product_cart_button_width['tablet'] ) ) ? $single_product_cart_button_width['tablet'] : ''; $single_product_cart_button_width_mobile = ( ! empty( $single_product_cart_button_width['mobile'] ) ) ? $single_product_cart_button_width['mobile'] : ''; $single_cart_button = '.woocommerce div.product form.cart .button.single_add_to_cart_button'; $css_output_cart_button_width_desktop = array( $single_cart_button => array( 'width' => astra_get_css_value( $single_product_cart_button_width_desktop, '%' ), ), ); $css_output .= astra_parse_css( $css_output_cart_button_width_desktop ); $css_output_cart_button_width_mobile = array( $single_cart_button => array( 'width' => astra_get_css_value( $single_product_cart_button_width_mobile, '%' ), ), ); $css_output_cart_button_width_tablet = array( $single_cart_button => array( 'width' => astra_get_css_value( $single_product_cart_button_width_tablet, '%' ), ), ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $css_output_cart_button_width_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $css_output_cart_button_width_mobile, '', astra_get_mobile_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** * Select arrow styling */ $arrow_color = str_replace( '#', '%23', $global_palette['palette'][3] ); $arrow_bg = "data:image/svg+xml,%3Csvg class='ast-arrow-svg' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' x='0px' y='0px' width='26px' height='16.043px' fill='" . $arrow_color . "' viewBox='57 35.171 26 16.043' enable-background='new 57 35.171 26 16.043' xml:space='preserve' %3E%3Cpath d='M57.5,38.193l12.5,12.5l12.5-12.5l-2.5-2.5l-10,10l-10-10L57.5,38.193z'%3E%3C/path%3E%3C/svg%3E"; $css_output_woo_select_default = array( 'select, .select2-container .select2-selection--single' => array( 'background-image' => 'url("' . $arrow_bg . '")', 'background-size' => '.8em', 'background-repeat' => 'no-repeat', 'background-position-x' => 'calc( 100% - 10px )', 'background-position-y' => 'center', '-webkit-appearance' => 'none', '-moz-appearance' => 'none', 'padding-right' => '2em', ), ); $css_output .= astra_parse_css( $css_output_woo_select_default ); $is_sticky_add_to_cart_position_active = astra_get_option( 'single-product-sticky-add-to-cart' ); if ( is_product() && $is_sticky_add_to_cart_position_active ) { /** * Sticky add to cart variables. */ $sticky_add_to_cart_position = astra_get_option( 'single-product-sticky-add-to-cart-position' ); $sticky_add_to_cart_text_color = astra_get_option( 'single-product-sticky-add-to-cart-text-color' ); $sticky_add_to_cart_bg_color = astra_get_option( 'single-product-sticky-add-to-cart-bg-color' ); $sticky_add_to_cart_btn_text_color = astra_get_option( 'single-product-sticky-add-to-cart-btn-n-color' ); $sticky_add_to_cart_btn_text_color_h = astra_get_option( 'single-product-sticky-add-to-cart-btn-h-color' ); $sticky_add_to_cart_btn_bg_color = astra_get_option( 'single-product-sticky-add-to-cart-btn-bg-n-color' ); $sticky_add_to_cart_btn_bg_color_h = astra_get_option( 'single-product-sticky-add-to-cart-btn-bg-h-color' ); /** * Single product sticky add to cart. */ $sticky_add_to_cart = array( '.woocommerce .ast-sticky-add-to-cart .button.alt' => array( 'border-color' => $sticky_add_to_cart_btn_bg_color, 'color' => $sticky_add_to_cart_btn_text_color, 'background' => $sticky_add_to_cart_btn_bg_color, ), '.woocommerce .ast-sticky-add-to-cart .button.alt:hover' => array( 'border-color' => $sticky_add_to_cart_btn_bg_color_h, 'color' => $sticky_add_to_cart_btn_text_color_h, 'background' => $sticky_add_to_cart_btn_bg_color_h, ), '.ast-sticky-add-to-cart .ast-container .ast-sticky-add-to-cart-content' => array( 'color' => $sticky_add_to_cart_text_color ? $sticky_add_to_cart_text_color : 'var(--ast-global-color-3)', ), 'div.ast-sticky-add-to-cart' => array( 'background-color' => $sticky_add_to_cart_bg_color, ), ); if ( 'top' === $sticky_add_to_cart_position ) { $sticky_add_to_cart_p = array( 'div.ast-sticky-add-to-cart' => array( 'top' => '0', 'bottom' => 'initial', 'transform' => 'translate(0, -100%)', 'box-shadow' => '0px 1px 10px rgba(0, 0, 0, 0.1), 0px 1px 9px rgba(0, 0, 0, 0.06)', ), ); } else { $sticky_add_to_cart_p = array( 'div.ast-sticky-add-to-cart' => array( 'bottom' => '0', 'top' => 'initial', 'transform' => 'translate(0, 100%)', 'box-shadow' => '0px -1px 10px rgba(0, 0, 0, 0.1), 0px -1px 9px rgba(0, 0, 0, 0.06)', ), ); } $sticky_add_to_cart_responsive_mobile = array( '.ast-sticky-add-to-cart .ast-sticky-add-to-cart-content div.ast-sticky-add-to-cart-title-wrap, .ast-sticky-add-to-cart-action-price' => array( 'display' => 'none', ), '.ast-quantity-add-to-cart, .ast-sticky-add-to-cart-action-wrap, .ast-sticky-add-to-cart-action-wrap > form' => array( 'width' => '100%', ), ); $sticky_add_to_cart_responsive_tablet = array( '.ast-sticky-add-to-cart-title-wrap > img' => array( 'display' => 'none', ), 'div.ast-sticky-add-to-cart .ast-sticky-add-to-cart-content .ast-sticky-add-to-cart-title-wrap .ast-sticky-add-to-cart-title' => array( 'padding-' . $ltr_left . '' => '0', ), ); if ( is_admin_bar_showing() ) { $sticky_add_to_cart_admin_bar = array( '.admin-bar .ast-sticky-add-to-cart.top' => array( 'top' => '32px', ), ); $css_output .= astra_parse_css( $sticky_add_to_cart_admin_bar, '601' ); } /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $sticky_add_to_cart_responsive_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $sticky_add_to_cart_responsive_mobile, '', astra_get_mobile_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $sticky_add_to_cart_p ); $css_output .= astra_parse_css( $sticky_add_to_cart ); } $astra_add_to_cart_quantity_btn_enabled = astra_add_to_cart_quantity_btn_enabled(); // Add to cart quantity button. if ( $astra_add_to_cart_quantity_btn_enabled ) { $add_to_cart_quantity_btn_css = ''; $add_to_cart_quantity_btn_css .= ' .woocommerce-js .quantity.buttons_added { display: inline-flex; } .woocommerce-js .quantity.buttons_added + .button.single_add_to_cart_button { margin-' . $ltr_left . ': unset; } .woocommerce-js .quantity .qty { width: 2.631em; margin-' . $ltr_left . ': 38px; } .woocommerce-js .quantity .minus, .woocommerce-js .quantity .plus { width: 38px; display: flex; justify-content: center; background-color: transparent; border: 1px solid var(--ast-border-color); color: var(--ast-global-color-3); align-items: center; outline: 0; font-weight: 400; z-index: 3; } .woocommerce-js .quantity .minus { border-' . $ltr_right . '-width: 0; margin-' . $ltr_right . ': -38px; } .woocommerce-js .quantity .plus { border-' . $ltr_left . '-width: 0; margin-' . $ltr_right . ': 6px; } .woocommerce-js input[type=number] { max-width: 58px; min-height: 36px; } .woocommerce-js input[type=number].qty::-webkit-inner-spin-button, .woocommerce input[type=number].qty::-webkit-outer-spin-button { -webkit-appearance: none; } .woocommerce-js input[type=number].qty { -webkit-appearance: none; -moz-appearance: textfield; } '; $css_output .= $add_to_cart_quantity_btn_css; } // Modern archive layout. if ( 'shop-page-modern-style' === astra_get_option( 'shop-style' ) ) { $modern_shop_page_css = ''; if ( 'none' !== astra_get_option( 'product-sale-notification', 'default' ) ) { $modern_shop_page_css .= ' .ast-onsale-card { position: absolute; top: 1.5em; ' . esc_attr( $ltr_left ) . ': 1.5em; color: var(--ast-global-color-3); background-color: var(--ast-global-color-5); width: fit-content; border-radius: 20px; padding: 0.4em 0.8em; font-size: .87em; font-weight: 500; line-height: normal; letter-spacing: normal; box-shadow: 0 4px 4px rgba(0,0,0,0.15); opacity: 1; visibility: visible; z-index: 4; } @media(max-width: 420px) { .mobile-columns-3 .ast-onsale-card { top: 1em; ' . esc_attr( $ltr_left ) . ': 1em; } } '; } $modern_shop_page_css .= ' .ast-on-card-button { position: absolute; ' . esc_attr( $ltr_right ) . ': 1em; visibility: hidden; opacity: 0; transition: all 0.2s; z-index: 5; cursor: pointer; } .ast-on-card-button.ast-onsale-card { opacity: 1; visibility: visible; } .ast-on-card-button:hover .ast-card-action-tooltip { opacity: 1; visibility: visible; } .ast-on-card-button:hover .ahfb-svg-iconset { opacity: 1; color: var(--ast-global-color-2); } .ast-on-card-button .ahfb-svg-iconset { border-radius: 50%; color: var(--ast-global-color-2); background: var(--ast-global-color-5); opacity: 0.7; width: 2em; height: 2em; justify-content: center; box-shadow: 0 4px 4px rgba(0, 0, 0, 0.15); } .ast-on-card-button .ahfb-svg-iconset .ast-icon { -js-display: inline-flex; display: inline-flex; align-self: center; } .ast-on-card-button svg { fill: currentColor; } .ast-select-options-trigger { top: 1em; } .ast-select-options-trigger.loading:after { display: block; content: " "; position: absolute; top: 50%; ' . esc_attr( $ltr_right ) . ': 50%; ' . esc_attr( $ltr_left ) . ': auto; width: 16px; height: 16px; margin-top: -12px; margin-' . esc_attr( $ltr_right ) . ': -8px; background-color: var(--ast-global-color-2); background-image: none; border-radius: 100%; -webkit-animation: dotPulse 0.65s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8); animation: dotPulse 0.65s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8); } .ast-select-options-trigger.loading .ast-icon { display: none; } .ast-card-action-tooltip { background-color: var(--ast-global-color-2); pointer-events: none; white-space: nowrap; padding: 8px 9px; padding: 0.7em 0.9em; color: var(--ast-global-color-5); margin-' . esc_attr( $ltr_right ) . ': 10px; border-radius: 3px; font-size: 0.8em; line-height: 1; font-weight: normal; position: absolute; ' . esc_attr( $ltr_right ) . ': 100%; top: auto; visibility: hidden; opacity: 0; transition: all 0.2s; } .ast-card-action-tooltip:after { content: ""; position: absolute; top: 50%; margin-top: -5px; ' . esc_attr( $ltr_right ) . ': -10px; width: 0; height: 0; border-style: solid; border-width: 5px; border-color: transparent transparent transparent var(--ast-global-color-2); } .astra-shop-thumbnail-wrap:hover .ast-on-card-button:not(.ast-onsale-card) { opacity: 1; visibility: visible; } @media (max-width: 420px) { .mobile-columns-3 .ast-select-options-trigger { top: 0.5em; ' . esc_attr( $ltr_right ) . ': 0.5em; } } '; $css_output .= $modern_shop_page_css; } if ( self::load_theme_side_woocommerce_strcture() ) { $css_output .= $this->astra_shop_summary_box_alignment(); } /** * Single page variation tab layout. */ $woo_variation_layout = astra_get_option( 'single-product-variation-tabs-layout' ); if ( 'horizontal' === $woo_variation_layout ) { $css_output_woo_variation_layout = array( '.woocommerce div.product form.cart .variations tr' => array( 'display' => 'flex', 'flex-wrap' => 'wrap', 'margin-bottom' => '1em', ), '.woocommerce div.product form.cart .variations td' => array( 'width' => 'calc( 100% - 70px )', ), '.woocommerce div.product form.cart .variations td.label, .woocommerce div.product form.cart .variations th.label' => array( 'width' => '70px', 'padding-right' => '1em', ), ); $css_output .= astra_parse_css( $css_output_woo_variation_layout ); } /** * Woocommerce Active Filter Styles */ $woo_active_filter_css = array( '.ast-woo-active-filter-widget .wc-block-active-filters' => array( 'display' => esc_attr( 'flex' ), 'align-items' => esc_attr( 'self-start' ), 'justify-content' => esc_attr( 'space-between' ), ), '.ast-woo-active-filter-widget .wc-block-active-filters__clear-all' => array( 'flex' => esc_attr( 'none' ), 'margin-top' => esc_attr( '2px' ), ), ); $css_output .= astra_parse_css( $woo_active_filter_css ); // Single product payment. $single_product_payment_array = astra_get_option( 'single-product-structure' ); if ( is_array( $single_product_payment_array ) && ! empty( $single_product_payment_array ) && in_array( 'single-product-payments', $single_product_payment_array ) ) { $css_output .= ' .ast-single-product-payments { margin-bottom: 1em; display: inline-block; margin-top: 0; padding: 13px 20px 18px; border: 1px solid var(--ast-border-color); border-radius: 0.25rem; width: 100%; } .ast-single-product-payments.ast-text-color-version svg { fill: var(--ast-global-color-3); } .ast-single-product-payments.ast-text-color-version img { filter: grayscale(100%); } .ast-single-product-payments legend { padding: 0 8px; margin-bottom: 0; font-size: 1em; font-weight: 600; text-align: center; color: var(--ast-global-color-3); } .ast-single-product-payments ul { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; justify-content: center; } .ast-single-product-payments ul li { display: flex; width: 48px; margin: 0 0.5em 0.5em 0.5em; } .ast-single-product-payments ul li svg, .ast-single-product-payments ul li img { height: 30px; width: 100%; } '; } // Enable Show Password Icon on Login Form on Woocommerce Account Page. if ( is_account_page() && ! is_user_logged_in() && astra_load_woocommerce_login_form_password_icon() ) { $ltr_left = $is_site_rtl ? esc_attr( 'right' ) : esc_attr( 'left' ); $ltr_right = $is_site_rtl ? esc_attr( 'left' ) : esc_attr( 'right' ); $css_output_show_password_icon = array( '.woocommerce form .password-input, .woocommerce-page form .password-input' => array( 'display' => 'flex', 'flex-direction' => 'column', 'justify-content' => 'center', 'position' => 'relative', ), '.woocommerce form .show-password-input, .woocommerce-page form .show-password-input' => array( 'position' => 'absolute', $ltr_right => '0.7em', 'cursor' => 'pointer', 'top' => '0.7em', ), '.woocommerce form .show-password-input::after, .woocommerce-page form .show-password-input::after' => array( 'font-family' => 'WooCommerce', 'speak' => 'never', 'font-weight' => '400', 'font-variant' => 'normal', 'text-transform' => 'none', 'line-height' => '1', '-webkit-font-smoothing' => 'antialiased', 'margin-' . $ltr_left => '0.618em', 'content' => '"\e010"', 'text-decoration' => 'none', ), ); $css_output .= astra_parse_css( $css_output_show_password_icon ); } 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()*/ /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $yith_wcwl_main_style .= astra_parse_css( $yith_wcwl_main_style_small, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort wp_add_inline_style( 'yith-wcwl-main', $yith_wcwl_main_style ); }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.0.31 | Introduced. |