Documentation

Learn how to set up, customize, and expand the functionality of WooCommerce

General Snippets


Documents

  • 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 if, for example, you want to include things like the ‘transaction key’ from PayPal orders. Alternatively, you can add the code snippet using Code Snippet plugin. Here is an example using […]

  • Allow shortcodes in product excerpts

    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 parent theme’s functions.php file as this will be wiped entirely when you update the theme.

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

    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 parent theme’s functions.php file as this will be wiped entirely when you update the theme. By default, WooCommerce blocks non-admin users from entering […]

  • Automatically add product to cart on visit

    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 parent theme’s functions.php file as this will be wiped entirely when you update the theme. If you want to automatically add a product […]

  • Change ‘Read More’ button text to ‘Sold Out’ for out of stock products

    This snippet changes the ‘Read More’ button text on standard add to cart buttons, such as on the shop / product catalog page for sold out products, to indicate that they are sold out without needing to click through. It does not affect variable products as separate variations may have different stock availability levels. Note: […]

  • Change email subject lines

    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 parent theme’s functions.php file as this will be wiped entirely when you update the theme.

  • Change the default cart session length

    When a visitor first adds a product to their cart a session is started that, by default, lasts for 48 hours. When it expires, the items added to the cart are forgotten, meaning the next time that visitor comes by, they’ll find their cart to be empty. The cart session is not related to the […]

  • Configuring Zeus Server Rewrite Rules

    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 = %{URL} # see if there are any queries in our URL match URL into $ with ^(.*)\?(.*)$ if matched then set SCRATCH:REQUEST_URI = $1 set […]

  • 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. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. Display product […]

  • 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 don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. Display WooCommerce product […]

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.