Customize WooCommerce Product Search Field


The WooCommerce Product Search field can be added via a widget and also via a template tag… get_product_search_form() Another option is a filter get_product_search_form() by which you can create your own custom search field including using an icon. The Original Markup <?php add_filter( ‘get_product_search_form’ , ‘me_custom_product_searchform’ ); /** * Filter WooCommerce Search Field * */…

Read More

WooCommerce Skip Cart, Go Straight to Checkout Page

WooCommerce workflow can be a little too long for simple products, you can provide a better user experience, here’s how to get the product to skip past the cart page and go straight to the checkout page. First, uncheck the cart options in WooCommerce Settings -> Products. Then add in your functions.php add_filter(‘woocommerce_add_to_cart_redirect’, ‘themeprefix_add_to_cart_redirect’); function…

Read More

Change WooCommerce Price to be by Weight


You can change the WooCommerce price to be by weight by appending some text after the actual price such as ‘per kg’, this can be done by manipulating 3 filters that display the price in the shop/product page, cart and checkout pages; woocommerce_get_price_html woocommerce_cart_item_price woocommerce_checkout_cart_item_quantity If all items were to be classified as ‘per kg‘…

Read More

Hide Amount of Items from Add to Cart Message in WooCommerce


Need to hide the amount of items added to the cart in the success message that appears after adding an item  in WooCommerce, the wc_add_to_cart_message_html filter has you covered. Add the below code snippet to your functions.php <?php //<~ don’t add me add_filter( ‘wc_add_to_cart_message_html’,’wb_custom_add_to_cart_message’, 10, 2 ); /** * Hide number of items added as to message…

Read More