WooCommerce cart total count minus certain product category

Woocommerce Increment Quantities Cart

I have a client that sells boxes and units of a product – for the units they need to be sold in multiples of 6, for the boxes it doesn’t matter, so I need the cart total to be less…

Set WooCommerce cart product count total to be divisible by number

Number Of Products Woocommerce

You can set WooCommerce cart total product count to be divisible by a certain number, if it is not divisible by that number then do not allow the user to checkout. add_action( ‘woocommerce_check_cart_items’, ‘check_cart_items_conditionally’ ); /** * Check cart items…

Stop WooCommerce checkout fields auto-filling – leave blank

Woocommerce Empty Checkout

You can stop WooCommerce checkout fields from auto filling by using a Woo filter woocommerce_checkout_get_value, this could be useful in a situation when a logged in user is ordering on behalf of multiple customers.add_filter( ‘woocommerce_checkout_get_value’,’prefix_return_empty_checkout’, 1, 1 ); function prefix_return_empty_checkout(){…

Change WooCommerce SKU text to another label

Woocommerce Sku Label.peg

You can change WooCommerce SKU text to another label using the gettext filter add_filter(‘gettext’, ‘translate_woocommerce’, 10, 3); /** * Change SKU Label * @link https://gist.github.com/dannyconnolly/da6f1a2d95dc826ccdcd * @since 1.0.0 */ function translate_woocommerce($translation, $text, $domain) { if ($domain == ‘woocommerce’) { switch…

Show only free shipping option on WooCommerce cart and checkout pages

Woocommerce Free Shipping Option

By default WooCommerce will show all available shipping options on cart and checkout pages, if you have free shipping as an option you may just want that displayed by itself. The code snippet below which needs to be added to…

Filter WooCommerce orders by payment gateway

Filter Woo Commerce Payment Gateway

Here is how you can filter WooCommerce orders by payment gateway in the WordPress dashboard orders screen using a plugin from SkyVerge. Add the php file directly or in a folder in the /wp-content/plugins/ directory and then activate the plugin…

Hide the Description and Reviews Tabs in WooCommerce Products

hide-woocommerce-tabs

WooCommerce products by default show  ‘description’ and ‘reviews’ tabs below the product on a WordPress product page, you can hide these tabs from view as well as a third tab ‘additional information’ with a snippet of code that goes in your…

Add qty inputs next to add to cart button with and without Ajax reload on WooCommerce archives

Ajax Reload Woocommerce Qty Cart

Here is how you can add qty inputs next to add to cart with Ajax reload on WooCommerce archives. Without Ajax Reload add_filter( ‘woocommerce_loop_add_to_cart_link’, ‘quantity_inputs_for_woocommerce_loop_add_to_cart_link’, 10, 2 ); /** * Override loop template and show quantities next to add to…

Add a ‘Continue Shopping’ Button to Woo Commerce Checkout and Cart Page

By default WooCommerce Cart page does not have a ‘Continue Shopping’ or ‘Return to Store’ button. However if you go to the cart page when the cart is empty, there is a  ‘Return to Store’ button. We just need to add…

Add WooCommerce add to cart button and quantity field to Shop archive page

Add Products To Cart Archive

Here is how you can add WooCommerce add to cart button and quantity field/form to Shop archive page. You may have just a bunch of linked products on the shop page but want to add a quicker way for a…