'single-rating'], blocksy_collect_and_return(function () { woocommerce_template_single_rating(); }) ); }); }, 9 ); add_action( 'woocommerce_single_product_summary', function () { if (get_theme_mod('has_product_single_meta', 'yes') === 'yes') { woocommerce_template_single_meta(); } blocksy_add_customizer_preview_cache(function () { return blocksy_html_tag( 'div', ['data-id' => 'single-meta'], blocksy_collect_and_return(function () { woocommerce_template_single_meta(); }) ); }); }, 39 ); function blocksy_get_woocommerce_ratio() { $cropping = get_option( 'woocommerce_thumbnail_cropping', '1:1' ); if ($cropping === '1:1') { return '1/1'; } if ($cropping === 'custom') { $width = get_option('woocommerce_thumbnail_cropping_custom_width'); $height = get_option('woocommerce_thumbnail_cropping_custom_height'); return $width . '/' . $height; } return '1/1'; } add_filter('woocommerce_style_smallscreen_breakpoint', function ($current) { return '690px'; }); add_filter('woocommerce_output_related_products_args', function ($args) { if (! is_customize_preview()) { $args['posts_per_page'] = intval(get_theme_mod('related_products', 4)); } else { $args['posts_per_page'] = 8; } return $args; }); add_action('wp_enqueue_scripts', function () { if (! function_exists('is_shop')) return; if ( is_shop() || is_product_category() || is_product_tag() ) { wp_enqueue_script('selectWoo'); wp_enqueue_style('select2'); } $theme = wp_get_theme(); wp_enqueue_style( 'ct-woocommerce-styles', get_template_directory_uri() . '/static/bundle/woocommerce.css', [], $theme->get( 'Version' ) ); wp_dequeue_style( 'selectWoo' ); wp_deregister_style( 'selectWoo' ); wp_dequeue_script( 'selectWoo'); call_user_func('wp_' . 'deregister_script', 'selectWoo'); }); add_filter('woocommerce_product_review_comment_form_args', function ($comment_form) { $comment_form['comment_field'] = ''; if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) { $comment_form['comment_field'] = '
'; } $comment_form['comment_field'] .= ''; $comment_form['submit_button'] = '%4$s'; $comment_form['fields']['author'] = ''; $comment_form['fields']['email'] = ''; return $comment_form; }, 10, 1); remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20); add_filter('post_class', function ($classes, $class, $product_id) { if (! function_exists('is_product')) return $classes; if (! is_product()) return $classes; if (get_theme_mod('gallery_style', 'horizontal') === 'vertical') { global $product; if (count($product->get_gallery_image_ids()) > 0) { $classes[] = 'thumbs-left'; } } return $classes; }, 10, 3); function blocksy_output_woo_mini_cart($for_preview = false) { if (!function_exists('woocommerce_mini_cart')) { return ''; } $svgs = [ 'type-1' => '', 'type-2' => '', 'type-3' => '' ]; blocksy_add_customizer_preview_cache( function () use ($svgs) { $result = ''; foreach ($svgs as $single_svg => $svg) { $result .= blocksy_html_tag( 'div', [ 'data-header-cart' => $single_svg ], $svg ); } return $result; } ); $current_count = WC()->cart->get_cart_contents_count(); $class = 'ct-header-cart'; $class .= ' ' . blocksy_visibility_classes(get_theme_mod('header_cart_visibility', [ 'desktop' => true, 'tablet' => true, 'mobile' => false, ])); $badge_output = ''; if (get_theme_mod('has_cart_badge', 'yes') === 'no') { $badge_output === 'data-skip-badge'; } if (empty($type)) { $type = 'type-1'; } ob_start(); ?>