Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chriswagoner/8ac8e443be5aec5d2ec6a24abf6e8771 to your computer and use it in GitHub Desktop.
Save chriswagoner/8ac8e443be5aec5d2ec6a24abf6e8771 to your computer and use it in GitHub Desktop.
Move the WooCommerce Notices on the Beaver Themer Singular Product Layout to Anywhere on the layout via a Custom Shortcode
/**
* First, remove WooCommerce Notices box from its default location on the page (somewhere at the top).
*/
remove_filter( 'fl_theme_builder_before_render_content', 'FLThemeBuilderWooCommerceSingular::before_render_content' );
/* You can now insert the store messages using the default WooCommerce shortcode -> [shop_messages] */
/**
* OPTIONAL NEW SHORTCODE
* Create this shortcode : [fl_woocommerce_notices]
* You can embed this anywhere on the Themer Layout via the HTML module.
*/
add_shortcode( 'fl_woocommerce_notices', function() {
ob_start();
if ( function_exists('wc_print_notices') ) {
?>
<div class="fl-theme-builder-woo-notices fl-row fl-row-fixed-width">
<?php wc_print_notices(); ?>
</div>
<?php
}
return ob_get_clean();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment