Forked from carlosonweb/beaver-themer-wc-notices.php
Last active
February 29, 2020 05:18
-
-
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
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
/** | |
* 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