Using the 'Custom' location in Advanced Messages

This documentation is for the Advanced Messages for WooCommerce plugin.

A small warning ahead. The 'Custom' location feature requires a bit deeper understanding of WordPress (action hooks to be precise). We won't be able to search/provide custom locations for you within the support policy.

The Advanced Messages plugin by default allows for messages to be displayed by a vast amount of different locations. All the most important positions are covered, but that isn't always enough. Sometimes there's the need for a more more specific location, and that is where the 'Custom' location option can be used for.

At the bottom of the locations list there's the 'Custom' option. When selected a new text field will appear below the dropdown. This is where you can enter the custom location you want to display the message. It is possible to enter any WordPress / WooCommerce action hook in there.

Finding the right action hook

Read more about WordPress action hooks.

This is a difficult part of the documentation; everyone will have a different location (and thus action hook) they want to position the message at. Below I'll describe a couple ways you can find the right action hook for your requirements.

Documentation

WordPress and WooCommerce are both well documented. Here are a couple resources where you can find hooks for the platforms:

WooCommerce has all its hooks documented here: https://docs.woocommerce.com/wc-apidocs/hook-docs.html

WordPress hooks can be found here: https://codex.wordpress.org/Plugin_API#Hooks:_Actions_and_Filters

In the code

All action hooks are available in the code. If you know where you want to position the message you can try and find the related template file for it (tip: use the template hints plugin).

Browse to the file in the code and open the file.

Here's a example of a template file in WooCommerce where a action hook is available. All action hooks are created by using the add_action() function. The first argument in there is the string you're looking for.

In this example you'd be looking at the following code

<?php do_action( 'woocommerce_product_meta_end' ); ?>

Where 'woocommerce_product_meta_end' would be the string you can enter in the 'Custom' text field (without the quotes).

With help

As mentioned we are not able to provide you with custom locations based on your needs within the support scope. If you're uncomfortable with the above methods / can't find what you're looking for; it is recommended to contact your web-developer. Any WordPress plugin/theme/site developer should have the knowledge to help you find the right hook for your needs.

Still need help? Contact Us Contact Us