You may wish to hide certain sub menu items from your Shop Managers, WooCommerce Settings, Add-ons and the System Status report for example. The snippet below will do exactly that, but you can adjust as necessay by adding or removing submenu slugs from the `$remove` array. Add this snippet to your theme’s functions.php file or […]
Add Custom Subscription Length
By default, WooCommerce Subscriptions, provides a large number of subscription durations that should be sufficient for most users. However, some users may wish to provide custom subscription lengths. Fortunately WooCommerce Subscriptions provides a filter called woocommerce_subscription_lengths which can be leveraged to add custom subscription durations. Below is an example of how to implement this filter: […]
Get Full Country Name in CSV Export
The Order/Customer CSV Export extension is often used for forwarding orders to fulfillment services or for generating mailing labels for shipping products. If your shop is based in the U.S. and you are shipping products to overseas locations, the U.S. postal service requires the country name to be fully spelled out, but by default, the […]
Filter Sensei Content Drip Start Time
If you are using the Sensei Content Drip extension, the drip emails get scheduled for whatever time of day you happen to activate the extension. If you would like to assert some control over what time of day the emails get sent, you can use the WordPress provided filter named schedule_event to alter the timestamp that is […]
Add WooCommerce billing interval
Caution: be careful with this – if the payment gateway you are using does not support the interval that you are adding this may result in undesirable behaviour. If you need to add billing intervals to WooCommerce Subscriptions this can be done using the Subscriptions provided filter named woocommerce_subscription_period_interval_strings – a very basic example below adds “every 8th” to […]
How to Replace Sensei Course Archive Label Text
The default label text for Sensei course archives can be changed by implementing the sensei_archive_course_filter_by_options filter. Below is an example of how you might change the ‘All’ and ‘Featured’ labels: Not sure what to do with code snippets? See What Do I Do With These Code Snippets?
Programmatically Add Gravity Form to WooCommerce Product
The WooCommerce Gravity Forms Product Add-ons extension allows you to add some very powerful customization options to your WooCommerce products. However, the form must be added on a per-product basis. This works fine for most use-cases but there are cases where it may be desirable to attach the form to all products or to all products […]
Increase WooCommerce Variations per page in the Admin Product Screen
WooCommerce 2.4 made some performance improvements to the variable product interface. There’s an overview of the changes here: Improving the Variations Interface in 2.4 Where this helps most is in the case of products which have many variations – unfortunately, in some cases this may hinder re-ordering the variations due to the pagination. It is possible […]
Shortcode in WooCommerce Variation Description
WooCommerce 2.4 added the ability to add a description to each variation of a variable product. By default, that field does not support shortcodes (the value is stored in the postmeta table – not the post table) – but, what if you would like to use shortcodes in the variation description? It is possible with […]
Remove ‘today’ from ‘fully booked days’ in WooCommerce Bookings
WooCommerce Bookings will count ‘today’ as ‘fully booked’ if the product in question can no longer be booked (it’s too late in the day) or if today is not available due to availability rules. This is mostly done as a shortcut to save on system resources but it may cause confusion or even FOMO for […]