Add the Comments Template After Single Product
function g9_show_reviews() { // Loads the comment template comments_template(); } add_action(‘woocommerce_after_single_product’, ‘g9_show_reviews’, 15);Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
function g9_show_reviews() { // Loads the comment template comments_template(); } add_action(‘woocommerce_after_single_product’, ‘g9_show_reviews’, 15);Continue reading
add_filter(‘woocommerce_apply_base_tax_for_local_pickup’, ‘__return_false’);Continue reading
add_action( ‘woocommerce_email_order_meta’, function( $order, $sent_to_admin, $plain_text, $email ) { // Check if coupon is used in order if ( $order->get_used_coupons() ) { // Get the coupon codes used in the order $coupon_codes = implode( ‘, ‘, $order->get_used_coupons() ); // Set…Continue reading
remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 10 ); function g9_woocommerce_template_product_description() { woocommerce_get_template( ‘single-product/tabs/description.php’ ); } add_action( ‘woocommerce_after_single_product_summary’, ‘g9_woocommerce_template_product_description’, 20 );Continue reading
function g9_remove_order_notes( $fields ) { unset($fields[‘order’][‘order_comments’]); return $fields; } add_filter( ‘woocommerce_checkout_fields’ , ‘g9_remove_order_notes’ );Continue reading
function g9_add_percentage_to_sale_badge($html, $post, $product) { global $product; $stock = $product->get_stock_status(); $product_type = $product->get_type(); $sale_price = 0; $regular_price = 0; if ($product_type == ‘variable’) { $product_variations = $product->get_available_variations(); foreach ($product_variations as $kay => $value) { if ($value[‘display_price’] < $value['display_regular_price']) { $sale_price…Continue reading
remove_action(‘woocommerce_before_shop_loop’, ‘woocommerce_catalog_ordering’, 30); remove_action(‘woocommerce_before_shop_loop’, ‘woocommerce_result_count’, 20); remove_action(‘woocommerce_after_shop_loop’, ‘woocommerce_result_count’, 20);Continue reading
function g9_add_categories_related_products($related_posts, $product_id, $args) { if (empty($related_posts)) { $related_posts = get_posts(array( ‘post_type’ => ‘product’, ‘numberposts’ => 3, // Number of products to show ‘post_status’ => ‘publish’, ‘fields’ => ‘ids’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘slug’, ‘terms’…Continue reading
function g9_disable_shipping_calc_on_cart($show_shipping) { if (is_cart()) { return false; } return $show_shipping; } add_filter(‘woocommerce_cart_ready_to_calc_shipping’, ‘g9_disable_shipping_calc_on_cart’, 99);Continue reading
remove_action(‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’);Continue reading