Code Snippets
Dive into practical solutions with our collection of code snippets. These bite-sized pieces of code are your quick fixes and custom enhancements for WooCommerce projects. Discover more code snippets at developer.woo.com/docs.
-
Make price widget draggable on touch devices
Resources Grab this script and save it to the JS folder in your theme directory. Installation Add code to your child theme’s functions.php file or via a plugin that allows… Read more
by
|
-
Hide other shipping methods when “Free Shipping” is available
Overview By default, WooCommerce will show all shipping methods that match the customer and the cart contents. This means Free Shipping will also show along with Flat Rate and other… Read more
by
|
-
Show product categories in WooFramework breadcrumbs
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code… Read more
by
|
-
Unhook/remove WooCommerce Emails
This code allows you to unhook and remove the default WooCommerce emails. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to… Read more
by
|
-
Add/Modify States
Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly… Read more
by
|
-
Change the default state and country on the checkout
Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly… Read more
by
|
-
Override loop template and show quantities next to add to cart buttons.
To display quantity input fields for simple products within your shop archive pages, use the following code: https://gist.github.com/woogists/c5e5d73bb4d7d44f5642313b8094937c [box type=”note”]You will need to add this code to your child theme’s… Read more
by
|
-
Display product dimensions on archive pages
You need to add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please… Read more
by
|
-
Display product attribute archive links
You will need to add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin.… Read more
by
|
-
Don’t allow PO BOX shipping
You need to add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please… Read more
by
|