' . $price . ''; }, 10, 3 ); add_action( 'woocommerce_before_quantity_input_field', function () { if ( (is_product() || wp_doing_ajax()) && ! blocksy_manager()->screen->uses_woo_default_template() ) { return; } echo ''; echo ''; } ); add_action( 'woocommerce_before_main_content', function () { $prefix = blocksy_manager()->screen->get_prefix(); if ($prefix === 'woo_categories' || $prefix === 'search') { /** * Note to code reviewers: This line doesn't need to be escaped. * Function blocksy_output_hero_section() used here escapes the value properly. */ echo blocksy_output_hero_section([ 'type' => 'type-2' ]); } $attr = [ 'class' => 'ct-container' ]; if (blocksy_get_page_structure() === 'narrow') { $attr['class'] = 'ct-container-narrow'; } if ($prefix === 'product') { if (blocksy_sidebar_position() === 'none') { $attr['class'] = 'ct-container-full'; $attr['data-content'] = 'normal'; if (blocksy_get_page_structure() === 'narrow') { $attr['data-content'] = 'narrow'; } } echo blocksy_output_hero_section([ 'type' => 'type-2' ]); } echo '
'; if (is_product()) { echo '
'; } else { echo '
'; } if ( $prefix === 'woo_categories' || $prefix === 'search' || $prefix === 'product' ) { /** * Note to code reviewers: This line doesn't need to be escaped. * Function blocksy_output_hero_section() used here escapes the value properly. */ echo blocksy_output_hero_section([ 'type' => 'type-1' ]); } } ); add_action( 'woocommerce_after_main_content', function () { if (is_product()) { echo '
'; } else { echo ''; } get_sidebar(); echo '
'; } ); add_action( 'woocommerce_before_template_part', function ($template_name, $template_path, $located, $args) { if ( $template_name === 'global/quantity-input.php' && blocksy_manager()->screen->uses_woo_default_template() ) { ob_start(); } if ($template_name === 'single-product/up-sells.php') { ob_start(); } if ($template_name === 'single-product/related.php') { ob_start(); } }, 10, 4 ); add_action( 'woocommerce_after_template_part', function ($template_name, $template_path, $located, $args) { if ( $template_name === 'global/quantity-input.php' && blocksy_manager()->screen->uses_woo_default_template() ) { $quantity = ob_get_clean(); echo str_replace( 'class="quantity"', 'class="quantity" data-type="' . get_theme_mod('quantity_type', 'type-1') . '"', $quantity ); } if ($template_name === 'single-product/up-sells.php') { $upsells = ob_get_clean(); echo str_replace( 'class="up-sells upsells products"', 'class="up-sells upsells products ' . trim( blocksy_visibility_classes( get_theme_mod( 'upsell_products_visibility', [ 'desktop' => true, 'tablet' => false, 'mobile' => false, ] ) ) ) . '"', $upsells ); } if ($template_name === 'single-product/related.php') { $related = ob_get_clean(); echo str_replace( 'class="related products"', 'class="related products ' . trim( blocksy_visibility_classes( get_theme_mod( 'related_products_visibility', [ 'desktop' => true, 'tablet' => false, 'mobile' => false, ] ) ) ) . '"', $related ); } }, 4, 4 );