Woo | Developer Blog
  • Get started
  • Stay updated
    • Roadmap Insights
    • Changelog
    • Release downloads
    • Newsletter
    • WooCommerce Meetups
    • Join the Community Slack
  • Grow with Woo
    • Become a Woo agency partner
    • Become a Marketplace partner
    • Contribute to WooCommerce
  • Docs

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.woocommerce.com/docs.

  • Show product categories in WooFramework breadcrumbs

    Show product categories in WooFramework breadcrumbs

    Automattic Avatar
    Automattic

    |

    Jul 30, 2012


    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

  • Unhook/remove WooCommerce Emails

    Unhook/remove WooCommerce Emails

    Automattic Avatar
    Automattic

    |

    Jul 12, 2012


    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

  • Add/Modify States

    Add/Modify States

    Automattic Avatar
    Automattic

    |

    Jun 28, 2012


    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

  • Change the default state and country on the checkout

    Change the default state and country on the checkout

    Automattic Avatar
    Automattic

    |

    Jun 22, 2012


    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

  • Override loop template and show quantities next to add to cart buttons.

    Override loop template and show quantities next to add to cart buttons.

    Automattic Avatar
    Automattic

    |

    May 26, 2012


    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

  • Display product dimensions on archive pages

    Display product dimensions on archive pages

    Automattic Avatar
    Automattic

    |

    May 4, 2012


    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

  • Display product attribute archive links

    Display product attribute archive links

    Automattic Avatar
    Automattic

    |

    May 4, 2012


    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

  • Don’t allow PO BOX shipping

    Don’t allow PO BOX shipping

    Automattic Avatar
    Automattic

    |

    Apr 27, 2012


    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

  • Change add to cart button text

    Change add to cart button text

    Automattic Avatar
    Automattic

    |

    Apr 27, 2012


    Code Snippet 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 to your… Read more

  • Automatically add product to cart on visit

    Automatically add product to cart on visit

    Automattic Avatar
    Automattic

    |

    Apr 27, 2012


    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

  • Allow HTML in term (category, tag) descriptions

    Allow HTML in term (category, tag) descriptions

    Automattic Avatar
    Automattic

    |

    Apr 27, 2012


    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

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

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

    Automattic Avatar
    Automattic

    |

    Apr 27, 2012


    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 if, for example, you want… Read more

←Previous Page Next Page→

Updates

  • Changelog
  • Release Packages
  • Release Calendar
  • Newsletter
  • Status

Information

  • About
  • Contact Us

Community

  • Community Slack
  • WooCommerce Meetups
  • GitHub Discussions
  • Community Forum
  • Code of Conduct
  • Community Participation Guide

Grow with Woo

  • Become a Woo agency partner
  • Become a Marketplace partner
  • Contribute to WooCommerce

Never miss an update

This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form

Automattic Company Site

COPYRIGHT WOOCOMMERCE 2026
TERMS & CONDITIONS  PRIVACY POLICY  PRIVACY NOTICE FOR CALIFORNIA USERS
Do not sell or share my personal information.