Skip to content

Code Snippets

Instructions on how to add code snippets can be found Here

Person-entering-laptop-2_S

Allow upload of AI files (Adobe Illustrator)

This snippet registers the AI file MIME type so that the site will allow .ai files to be uploaded to the WordPress Media Library. This should also allow Gravity Forms...
Person-entering-laptop-2_S

Allow upload of VCF files (aka vCards)

This snippet registers the VCF file MIME type so that the site will allow vcf files to be uploaded to the WordPress Media Library. This snippet should be added when...
Person-entering-laptop-2_S

Order Posts Alphabetically

Modifies the main query to sort posts alphabetically by title. Must be added to functions.php file of the Theme Customisations plugin.
Person-entering-laptop-2_S

Add a surcharge to cart and checkout – uses fees API

Person-entering-laptop-2_S

RETIRED – Show product categories in WooFramework breadcrumbs

Person-entering-laptop-2_S

Change number of upsells output

Person-entering-laptop-2_S

Change number of related products output

Please note that it does not work for all themes because of the way they’re coded.
Person-entering-laptop-2_S

Hide loop read more buttons for out of stock items

Person-entering-laptop-2_S

Hide other shipping methods when “Free Shipping” is available

Adding code Before adding snippets, clear your WooCommerce cache. Go to WooCommerce > System Status > Tools > WC Transients > Clear transients. Snippets for WC 3.0+ Hides everything but free_shipping if it’s available and is compatible...
Person-entering-laptop-2_S

Automatically add product to cart on visit

Person-entering-laptop-2_S

Add a custom field (in an order) to the emails

You can add any custom field to your order emails by hooking in and specifying the name of the custom field. This can be useful when used in conjunction with...
Person-entering-laptop-2_S

Adjust the quantity input values

Set the starting value, maximum value, minimum value and increment amount. The WooCommerce Min/Max Quantities extension is a slightly more powerful version of this code snippet.
Scroll To Top