'shop-breadcrumbs'], blocksy_collect_and_return(function () { woocommerce_breadcrumb(); }) ); }); } } }); add_filter( 'woocommerce_demo_store', function ($notice) { $parser = new Blocksy_Attributes_Parser(); $notice = $parser->add_attribute_to_images_with_tag( $notice, 'data-position', get_theme_mod('store_notice_position', 'bottom'), 'p' ); return $notice; } ); add_action( 'woocommerce_single_product_summary', function () { if (get_theme_mod('has_product_single_rating', 'yes') === 'yes') { woocommerce_template_single_rating(); } blocksy_add_customizer_preview_cache(function () { return blocksy_html_tag( 'div', ['data-id' => '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 ); if (! function_exists('blocksy_get_woocommerce_ratio')) { function blocksy_get_woocommerce_ratio() { $cropping = get_option('woocommerce_thumbnail_cropping', '1:1'); if ($cropping === 'uncropped') { return 'original'; } if ($cropping === '1:1') { return '1/1'; } if ($cropping === 'custom' || $cropping === 'predefined') { $width = get_option('woocommerce_thumbnail_cropping_custom_width', 4); $height = get_option('woocommerce_thumbnail_cropping_custom_height', 3); return $width . '/' . $height; } return '1/1'; } } add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); 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 = blocksy_get_wp_parent_theme(); wp_enqueue_style( 'ct-woocommerce-styles', get_template_directory_uri() . '/static/bundle/woocommerce.css', [], $theme->get('Version') ); // wp_dequeue_style( 'wc-block-style' ); 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); 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); // add_action( // 'woocommerce_before_quantity_input_field', // function () { // echo ''; // } // ); add_action( 'woocommerce_after_quantity_input_field', function () { echo ''; echo ''; } ); add_action( 'woocommerce_before_add_to_cart_form', function () { global $product; global $root_product; $root_product = $product; } ); add_action( 'woocommerce_before_add_to_cart_quantity', function () { global $product; global $root_product; if (! $root_product) { return; } if (! $root_product->is_type('simple') && ! $root_product->is_type('variable')){ return; } echo '