1. Documentation
  2. Frontend Snippets

Frontend Snippets

Articles

  • Change Limit on Number of Variations for Dynamic Variable Product Dropdowns

    By default, if a Variable product has fewer than 30 variations, the dropdowns for selecting variations on the frontend will be dynamic. For example, with a T-shirt that has “Size” and “Color” attributes, after the customer selects a Size, the Color dropdown will be updated via AJAX to only display options that are available with […]

  • Scratch Coupon for WooCommerce

    Scratch Coupon for WooCommerce helps you convert abandoning visitors into customers by giving them last-minute offer to stay at the moment they intend to leave. Study shows that exit intent popups work really well in e-commerce industry. Installation Download the scratch-coupon-for-woocommerce.zip file from your WooCommerce account. Go to: WordPress Admin > Plugins > Add New […]

  • Apply a coupon for minimum cart total

    The code snippet below allows you to: Show a notice on the cart and checkout page, reminding customers that they get a discount if spending more than a minimum amount. Automatically apply a discount and show a notice that the discount was applied when the cart total is more than a minimum amount. Requirements: A coupon called […]

  • Add a message above the login / register form

    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. This code will add a custom […]

  • Customize the WooCommerce breadcrumb

    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 add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. Change the ‘Home’ text […]

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

    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. Add a percentage based surcharge to all transactions […]

  • Automatically Complete Orders

    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. You could also change the “Completed” status to […]

  • Remove product content based on category

    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 directly to your parent theme’s functions.php file, as this will be wiped entirely when you update the theme. The following code will remove product images […]

  • Hide sub-category product count in product archives

    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. This file contains bidirectional Unicode text […]

  • Editing product data tabs

    You need to add the 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. Removing Tabs Use […]

  • 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 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 […]

  • 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 to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. This file contains bidirectional Unicode text that may […]

  • 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: This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden […]

  • Allow HTML in term (category, tag) descriptions

    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, WordPress strips HTML from category descriptions. […]

  • Custom tracking code for the thanks page

    This snippet is for adding tracking for a separate piece of analytic software you may have installed. The order object contains all the order data you should need, including line items. 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 […]

  • Exclude products from a particular category on the shop page

    As ‘clothing’ is an example in the snippet below, be sure to use a product category slug that exists in your WooCommerce store. Note that this will only work when you have your “Shop Page Display” option set to ‘Show Products’ under your Customizers’ WooCommerce > Product catalog settings. You need to add this code […]

  • Set a custom add to cart URL to redirect to

    A snippet to set a custom add to cart redirect URL.

  • Custom sorting options (asc/desc)

    A snippet to add new sorting options to the catalog.

WooCommerce - the most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment