Add WooCommerce Product Category Dropdown to Shop & Archive Pages
WooCommerce has a Product Category dropdown list of available product categories which filter and refresh the page based on product selection. It is assigned via a Widget and easy enough to put in the sidebar. But what about adding it to the top of the main shop and archive pages.? Here is a way…
Read MoreAdjusting WooCommerce Price Description with ACF Custom Field
Using a simple ACF field you can adjust the WooCommerce pricing type per item with a dropdown selection that will display after the price in the product, shop, cart and checkout page. Create a select dropdown in ACF. This example the field is named product_price_type and has 3 values/choices (use as many as you like)…
Read MoreChange 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 MoreHide 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 View the code on Gist. On line 24 a ternary operator has been removed which displayed the quantity if greater…
Read MoreAdd WooCommerce Add to Cart Button to Menu with Offscreen content like Outfitter Pro
This is a guide to add a WooCommerce Add to Cart button icon to a main menu with a toggle effect that displays added shop items in a mini-cart in an overlay. This is offscreen content displayed and closed on click, this is how the new Outfitter Pro theme uses it, in this guide it is…
Read MoreAdd WooCommerce Styles to The Customizer in WordPress
Adding the WooCommerce styles to the Customizer in WordPress can help you quickly style and scaffold some common components of WooCommerce. This tutorial takes you through how to set that up in a WordPress starter theme using a child theme. This is an intermediate example and not all the code is explained in detail. First…
Read MoreChange the Intro Text on My Account Page in WooCommerce
Here is how to change the default intro text on login to my-account page in WooCommerce. Hello admin (not admin? Log out) From your account sidebar you can view your recent orders, manage your shipping and billing addresses and edit your password and account details. Make a woocommerce/myaccount folder structure in your theme if not…
Read MoreAdding Flexbox CSS to WooCommerce Shop and Products
You can add Flexbox to WooCommerce shop page, product category archives and related products rows and actual products with a few lines of CSS – this will ensure that the products will line up nicely aligned top to bottom. WooCommerce CSS itself will do a lot of the grunt work with row % widths based on…
Read MoreChange Status of WooCommerce Paypal Order from Processing to Complete
Using WooCommerce and Paypal, sometimes you may want the order to go from processing to complete on payment of the order at Paypal without manually having to set it to complete, this snippet as provided by WooCommerce fixes this issue. /** * Auto Complete all WooCommerce orders. * Add to theme functions.php file */ add_action(…
Read MoreTarget WooCommerce Products and Pages Using PHP Conditionals
WooCommerce comes with a number of pages and a custom post type named ‘products‘, sometimes you may want to just target some of these products or pages so you can add some PHP custom code in your functions.php file of your theme, this can target all or parts of WooCommerce using PHP conditional statements. All WooCommerce…
Read More