add_node( array( 'id' => 'edit', 'title' => __('Edit Page'), 'href' => get_edit_post_link($page_ID), ) ); } } } add_action('admin_bar_menu', 'dotspice_woo_admin_bar_edit_menu', 80); // Disable styles add_filter('woocommerce_enqueue_styles', '__return_empty_array'); // Add theme support function dotspice_woo_support() { add_theme_support('woocommerce', array( 'thumbnail_image_width' => 1500, 'single_image_width' => 800, 'gallery_thumbnail_image_width' => 150, 'cart_item_thumbnail' => 100, 'product_grid' => array( 'default_rows' => 4, 'min_rows' => 2, 'max_rows' => 8, 'default_columns' => 3, 'min_columns' => 1, 'max_columns' => 4, ), )); add_theme_support('wc-product-gallery-lightbox'); add_theme_support('wc-product-gallery-slider'); } add_action('after_setup_theme', 'dotspice_woo_support', 99); // Disable page title add_filter('woocommerce_show_page_title', '__return_false'); // Disable result count // remove_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20); // Disable breadcrumb remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); // Unset ship to different address checked add_filter('woocommerce_ship_to_different_address_checked', '__return_false'); // Update Cart Count on Fragments function dotspice_woo_cart_count_fragments($fragments) { $cart_count = WC()->cart->get_cart_contents_count(); $fragments['.navbar-btn.mini-cart .count'] = '' . $cart_count . ''; return $fragments; } add_filter('woocommerce_add_to_cart_fragments', 'dotspice_woo_cart_count_fragments', 10, 1); // Plus & minus button function dotspice_woo_single_quantity() { ?>
is_search) { if (!isset($query->query_vars['post_type'])) { $query->set('post_type', array('post', 'page')); } } return $query; } add_filter('pre_get_posts', 'searchFilter'); // Transfer product data tabs remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10); add_action('woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 80); // Remove product tab headers add_filter('woocommerce_product_description_heading', '__return_empty_string'); add_filter('woocommerce_product_additional_information_heading', '__return_empty_string'); // Remove sidebar on single product remove_action('woocommerce_sidebar', 'woocommerce_get_sidebar', 10); // Remove content wrappers remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); // Remove loop product link close remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5); // Replace Mini cart buttons add_action('woocommerce_widget_shopping_cart_buttons', function () { // Removing Buttons remove_action('woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_button_view_cart', 10); remove_action('woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20); // Adding customized Buttons add_action('woocommerce_widget_shopping_cart_buttons', 'dotspice_woo_widget_shopping_cart_button_view_cart', 10); add_action('woocommerce_widget_shopping_cart_buttons', 'dotspice_woo_widget_shopping_cart_proceed_to_checkout', 20); }, 1); function dotspice_woo_widget_shopping_cart_button_view_cart() { echo '' . dotspice_get_svg_icon('shopping-cart-fa-solid', 'html', array('size' => false, 'style' => false)) . esc_html__('View cart', 'woocommerce') . ''; } function dotspice_woo_widget_shopping_cart_proceed_to_checkout() { echo '' . dotspice_get_svg_icon('check-square-fa-solid', 'html', array('size' => false, 'style' => false)) . esc_html__('Checkout', 'woocommerce') . ''; } /** * Change number of related products output */ function dotspice_woo_related_products_args($args) { $args['posts_per_page'] = 3; $args['columns'] = 3; return $args; } add_filter('woocommerce_output_related_products_args', 'dotspice_woo_related_products_args', 20); }