From 69c17f9c1942fd0d6a5ea941636e87723b8a6fe2 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 16:19:29 -0500 Subject: dos2unix on all .php files, begin paring down admin page and site branding. --- .../woocommerce/woocommerce-common-functions.php | 598 ++++++++++----------- 1 file changed, 299 insertions(+), 299 deletions(-) (limited to 'inc/compatibility/woocommerce/woocommerce-common-functions.php') diff --git a/inc/compatibility/woocommerce/woocommerce-common-functions.php b/inc/compatibility/woocommerce/woocommerce-common-functions.php index 4921337..1a0995a 100644 --- a/inc/compatibility/woocommerce/woocommerce-common-functions.php +++ b/inc/compatibility/woocommerce/woocommerce-common-functions.php @@ -1,299 +1,299 @@ -'; - - echo '

' . esc_html( get_the_title() ) . '

'; - - echo ''; - } - -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 ) ) : ?> - - 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 - } - - ?> - - - - - -
- -
- - get_availability(); - $stock_quantity = $product->get_stock_quantity(); - $availability = $product_avail['availability']; - $avail_class = $product_avail['class']; - if ( ! empty( $availability ) && $stock_quantity ) { - ob_start(); - ?> -

- - -

- '; - woocommerce_template_loop_product_title(); - echo ''; - } -} - -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 '
'; - 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 '
'; - 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 '
'; - } -} - -if ( ! function_exists( 'astra_woo_shop_thumbnail_wrap_end' ) ) { - - /** - * Thumbnail wrap end. - */ - function astra_woo_shop_thumbnail_wrap_end() { - - echo '
'; - } -} - - -/** - * 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 ''; - - } - -endif; +'; + + echo '

' . esc_html( get_the_title() ) . '

'; + + echo ''; + } + +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 ) ) : ?> + + 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 + } + + ?> + + + + + +
+ +
+ + get_availability(); + $stock_quantity = $product->get_stock_quantity(); + $availability = $product_avail['availability']; + $avail_class = $product_avail['class']; + if ( ! empty( $availability ) && $stock_quantity ) { + ob_start(); + ?> +

+ + +

+ '; + woocommerce_template_loop_product_title(); + echo ''; + } +} + +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 '
'; + 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 '
'; + 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 '
'; + } +} + +if ( ! function_exists( 'astra_woo_shop_thumbnail_wrap_end' ) ) { + + /** + * Thumbnail wrap end. + */ + function astra_woo_shop_thumbnail_wrap_end() { + + echo '
'; + } +} + + +/** + * 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 ''; + + } + +endif; -- cgit v1.2.3-60-g2f50