Created
February 21, 2021 15:05
-
-
Save WP-Panda/1c1afb7a485e8e2e05de36291c7f1577 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $porto_settings; | |
$term = get_queried_object(); | |
$zag = get_field( 'zag', $term ); | |
$text = get_field( 'text', $term ); | |
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; | |
wp_register_script( 'wc-jquery-ui-touchpunch', WC()->plugin_url() . '/assets/js/jquery-ui-touch-punch/jquery-ui-touch-punch' . $suffix . '.js', array( 'jquery-ui-slider' ), WC_VERSION, true ); | |
wp_register_script( 'wc-price-slider', WC()->plugin_url() . '/assets/js/frontend/price-slider' . $suffix . '.js', array( 'jquery-ui-slider', 'wc-jquery-ui-touchpunch' ), WC_VERSION, true ); | |
wp_enqueue_script( 'wc-price-slider' ); | |
/** | |
* Hook: woocommerce_before_main_content. | |
* | |
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content) | |
* @hooked woocommerce_breadcrumb - 20 | |
* @hooked WC_Structured_Data::generate_website_data() - 30 | |
*/ | |
do_action( 'woocommerce_before_main_content' ); | |
if ( apply_filters( 'woocommerce_show_page_title', true ) ) : | |
printf( '<h2 class="page-title">%s</h2>', woocommerce_page_title( false ) ); | |
endif; | |
/** | |
* Hook: woocommerce_archive_description. | |
* | |
* @hooked woocommerce_taxonomy_archive_description - 10 | |
* @hooked woocommerce_product_archive_description - 10 | |
*/ | |
if ( ! empty( $term->taxonomy ) && $term->taxonomy === 'pa_vendors' ) { | |
if ( ! empty( $zag ) ) { | |
printf( '<h1>%s</h1>', $zag ); | |
} else { | |
printf( '<h1>Зонты %s</h1>', $term->name ); | |
} | |
} | |
do_action( 'woocommerce_archive_description' ); | |
if ( ! empty( $text ) ) { | |
printf( ' <div class="text_itemer">%s<div class="clearfix"></div></div>', $text ); | |
} | |
if ( ( function_exists( 'woocommerce_product_loop' ) && woocommerce_product_loop() ) || ( ! function_exists( 'woocommerce_product_loop' ) && have_posts() ) ) { | |
/** | |
* Hook: woocommerce_before_shop_loop. | |
* | |
* @hooked woocommerce_output_all_notices - 10 | |
* @hooked woocommerce_result_count - 20 | |
* @hooked woocommerce_catalog_ordering - 30 | |
*/ | |
do_action( 'woocommerce_before_shop_loop' ); | |
global $woocommerce_loop; | |
if ( is_shop() && ! is_product_category() ) { | |
$woocommerce_loop[ 'columns' ] = $porto_settings[ 'shop-product-cols' ]; | |
$woocommerce_loop[ 'columns_mobile' ] = $porto_settings[ 'shop-product-cols-mobile' ]; | |
} | |
?> | |
<div class="archive-products"> | |
<?php | |
woocommerce_product_loop_start(); | |
if ( ! function_exists( 'wc_get_loop_prop' ) || wc_get_loop_prop( 'total' ) ) { | |
while ( have_posts() ) { | |
the_post(); | |
/** | |
* Hook: woocommerce_shop_loop. | |
*/ | |
do_action( 'woocommerce_shop_loop' ); | |
wc_get_template_part( 'content', 'product' ); | |
} | |
} | |
woocommerce_product_loop_end(); | |
?> | |
</div> | |
<?php | |
/** | |
* Hook: woocommerce_after_shop_loop. | |
* | |
* @hooked woocommerce_pagination - 10 | |
*/ | |
do_action( 'woocommerce_after_shop_loop' ); | |
} else { | |
global $porto_shop_filter_layout; | |
if ( isset( $porto_shop_filter_layout ) && 'horizontal2' == $porto_shop_filter_layout ) { | |
do_action( 'woocommerce_before_shop_loop' ); | |
} else { | |
printf( '<div class="shop-loop-before clearfix" style="display:none;"></div>' ); | |
} | |
?> | |
<div class="archive-products"> | |
<?php | |
/** | |
* Hook: woocommerce_no_products_found. | |
* | |
* @hooked wc_no_products_found - 10 | |
*/ | |
do_action( 'woocommerce_no_products_found' ); | |
?> | |
</div> | |
<div class="shop-loop-after clearfix" style="display:none;"></div> | |
<?php | |
} | |
/** | |
* Hook: woocommerce_after_main_content. | |
* | |
* @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content) | |
*/ | |
do_action( 'woocommerce_after_main_content' ); | |
/** | |
* Hook: woocommerce_sidebar. | |
* | |
* @hooked woocommerce_get_sidebar - 10 | |
*/ | |
//do_action( 'woocommerce_sidebar' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment