ASTRA_Ext_WooCommerce_Markup::post_class( array $classes )

Post Class


Description


Parameters

$classes

(array) (Required) Default argument array.


Return

(array;)


Source

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

		public function post_class( $classes ) {

			$wp_doing_ajax = wp_doing_ajax();

			if ( is_shop() || is_product_taxonomy() || ( post_type_exists( 'product' ) && 'product' === get_post_type() ) || $wp_doing_ajax ) {

				// Single product normal & hover box shadow.
				$classes[] = astra_get_option( 'shop-product-align' );
				$classes[] = 'box-shadow-' . astra_get_option( 'shop-product-shadow' );
				$classes[] = 'box-shadow-' . astra_get_option( 'shop-product-shadow-hover' ) . '-hover';

				// Single product gallery layout ( vertical / horizontal ).
				$classes[] = 'ast-product-gallery-layout-' . astra_get_option( 'single-product-gallery-layout' );

				$image_gallery = get_post_meta( get_the_ID(), '_product_image_gallery', true );
				if ( empty( $image_gallery ) ) {
					$classes[] = 'ast-product-gallery-with-no-image';
				}

				// Single product tabs layout ( vertical / horizontal ).
				if ( astra_get_option( 'single-product-tabs-display' ) ) {
					$classes[] = 'ast-product-tabs-layout-' . astra_get_option( 'single-product-tabs-layout' );
				}

				$qv_enable = astra_get_option( 'shop-quick-view-enable' );

				if ( 'disabled' !== $qv_enable ) {
					$classes[] = 'ast-qv-' . $qv_enable;

				}
				// Add Product Hover class only for infinite scroll products.
				if ( $wp_doing_ajax ) {
					$hover_style = astra_get_option( 'shop-hover-style' );

					if ( '' !== $hover_style ) {
						$classes[] = 'astra-woo-hover-' . $hover_style;
					}
				}
			}

			return $classes;
		}

User Contributed Notes

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