Remove the Add to Cart Button from the Shop page
remove_action(‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’);Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
remove_action(‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’);Continue reading
function g9_remove_price($price) { if (is_shop() || is_product_category()) return; return $price; } add_filter(‘woocommerce_get_price_html’, ‘g9_remove_price’);Continue reading
remove_action(‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20);Continue reading
function g9_sku_cart_page($item_name, $cart_item, $cart_item_key) { // The WC_Product object $product = $cart_item[‘data’]; // Get the SKU $sku = $product->get_sku(); // When sku doesn’t exist if (empty($sku)) return $item_name; // Add the sku $item_name .= ‘‘ . __(“SKU: “, “woocommerce”) .…Continue reading
function g9_woocommerce_add_to_cart_button_text_archives() { return __(‘Buy Now’, ‘woocommerce’); } add_filter(‘woocommerce_product_add_to_cart_text’, ‘g9_woocommerce_add_to_cart_button_text_archives’);Continue reading
remove_action(‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_rating’, 5);Continue reading
remove_action(‘woocommerce_product_thumbnails’, ‘woocommerce_show_product_thumbnails’, 20);Continue reading
function g9_add_woocommerce_support() { add_theme_support(‘woocommerce’); } add_action(‘after_setup_theme’, ‘g9_add_woocommerce_support’);Continue reading
function g9_hide_shipping_when_free_is_available($rates) { $free = array(); foreach ($rates as $rate_id => $rate) { if (‘free_shipping:1’ === $rate->id) { $free[$rate_id] = $rate; break; } } return !empty($free) ? $free : $rates; } add_filter(‘woocommerce_package_rates’, ‘g9_hide_shipping_when_free_is_available’, 100);Continue reading
function g9_user_role_order_icon($column_name, $post_id) { if ($column_name == ‘order_number’) { $order = wc_get_order($post_id); // Get user id from order $user_id = $order->get_user_id(); if ($user_id > 0) { $user_meta = get_userdata($user_id); $user_roles = $user_meta->roles; // Check if user role my-custom-user-role is in…Continue reading