Skip to content
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

  • Apply a coupon for minimum cart total

    Apply a coupon for minimum cart total

    Automattic Avatar
    Automattic

    |

    Jan 21, 2019


    The code snippet below allows you to: Requirements: Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as… Read more

  • Hide trailing zeros on prices

    Hide trailing zeros on prices

    Automattic Avatar
    Automattic

    |

    Sep 25, 2018


    The option to show trailing zeros on your prices has been removed in favor of a filter, as of WooCommerce 2.2x. If you want to hide trailing zeros on your… Read more

  • Notify Admin When New Account Is Created

    Notify Admin When New Account Is Created

    Automattic Avatar
    Automattic

    |

    Mar 11, 2018


    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

  • Display product weight on archive pages

    Display product weight on archive pages

    Automattic Avatar
    Automattic

    |

    May 10, 2017


    To display WooCommerce product weight on archive pages, below the title of the product, add this code to your child theme’s functions.php file or via a plugin that allows custom functions to… Read more

  • Allowing customer access to WP Admin, and enabling the admin bar

    Allowing customer access to WP Admin, and enabling the admin bar

    Automattic Avatar
    Automattic

    |

    Mar 24, 2016


    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 message above the login / register form

    Add a message above the login / register form

    Automattic Avatar
    Automattic

    |

    Oct 1, 2013


    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 don’t add custom… Read more

  • Add a new country to countries list

    Add a new country to countries list

    Automattic Avatar
    Automattic

    |

    Aug 12, 2013


    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 don’t add custom… Read more

  • Adjust the quantity input values

    Adjust the quantity input values

    Automattic Avatar
    Automattic

    |

    Jul 23, 2013


    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

  • Send coupons used in an order by email

    Send coupons used in an order by email

    Automattic Avatar
    Automattic

    |

    Jul 10, 2013


    This snippet sends by email the list of coupons used in an order. You can customize the “$to” variable and define your own email address, and the “$message” to have… Read more

  • Customize the WooCommerce breadcrumb

    Customize the WooCommerce breadcrumb

    Automattic Avatar
    Automattic

    |

    Jun 24, 2013


    You need to 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. Please don’t… Read more

  • Add a surcharge to cart and checkout – uses fees API

    Add a surcharge to cart and checkout – uses fees API

    Automattic Avatar
    Automattic

    |

    Jun 13, 2013


    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

  • Configuring Zeus Server Rewrite Rules

    Configuring Zeus Server Rewrite Rules

    Automattic Avatar
    Automattic

    |

    Jun 10, 2013


    This rewrite.script has been configured for WordPress: RULE_0_START: # get the document root map path into SCRATCH:DOCROOT from / # initialize our variables set SCRATCH:ORIG_URL = %{URL} set SCRATCH:REQUEST_URI =… Read more

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

Subscribe to the Newsletter
An thingamajig

Terms and Conditions

Privacy policy

Privacy Notice for California Users