Change WooCommerce Variation Dropdown Text
You can change the default text in the product variation dropdown from ‘Choose an option‘…. to something else with the ‘woocommerce_dropdown_variation_attribute_options_args‘ filter. Add in your functions.php add_filter( ‘woocommerce_dropdown_variation_attribute_options_args’, ‘bt_dropdown_choice’ ); // /** * Change the custom dropdown “Choose an option” text on the front end */ function bt_dropdown_choice( $args ){ if( is_product() ) { $args[‘show_option_none’] =…
Read MoreRemove WooCommerce SKU: N/A Category in Products
You can remove the WooCommerce sku line – SKU: N/A Category from products in WordPress by using the ‘wc_product_sku_enabled‘ filter. Just add in your theme’s functions.php file… add_filter( ‘wc_product_sku_enabled’, ‘__return_false’ ); This will remove the sku everywhere. Remove the SKU Item Conditionally You may want to keep the SKU info published on some categories or products only – you…
Read MoreAdd WooCommerce MyAccount Page Login/Logout to Menu
This code adds a login/logout link to your WordPress primary menu to log the user into the WooCommerce My Account page and then also log out to the same or different page. It differs from the referred article as that adds the WordPress default login/logout page. The menus need to be registered via register_nav_menu and positioned with theme_location,…
Read MoreStyling WooCommerce Default DropDown Sort Select Fields
The default dropdown select field form element is difficult to style in CSS alone – it needs a bit of jQuery love, here is a guide to add some cleaner styling to the WooCommerces default dropdown sort select field – which you can apply to any select field too. Then one with some jQuery…
Read MoreHide WooCommerce Product Categories on Shop Page or other Page
You can hide certain WooCommerce product categories from the shop page or other targetted pages, by using an action called woocommerce_product_query Add it in your theme via functions.php and it works like so… So the action is wrapped in a conditional statement that targets the pages you want the Product Categories to not display. Then…
Read MoreAdd Link to the Count in WooCommerce Product Category Menu
The WooCommerce product category menu can be manipulated by making a copy of the walker class it is defined in and editing it. The WC_Product_Cat_List_walker class lives in wooc0mmerce/includes/walkers/class-product-cat-list-walker.php, you can make a copy of this and include it in your child theme and include it. Best to create a classes subfolder in your child…
Read MoreFilter WooCommerce Order Received Thank You Text
You can filter the text on a WooCommerce order received after checkout, by default the text reads ‘Thank you. Your order has been received’, but you may want to add some further instruction, which you can do using the filter woocommerce_thankyou_order_received_text View the code on Gist. Above the original text is being replaced. Or below the…
Read MoreCustomize 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 View the code on Gist. This will just reproduce the form in it’s original…
Read MoreWooCommerce 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 MoreChange, Edit & Rename WooCommerce Endpoints in My Accounts Page
Here is how you can change, edit and rename WooCommerce Endpoints in My Accounts Page. Since the release of WooCommerce 2.6 Woo has a revamped My-Account page, it appears as a vertical menu of links that display the corresponding table of data to the right, similar to a tabbed layout. This certainly is a better user…
Read More