Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('woocommerce_sale_flash', 'woo_custom_hide_sales_flash');
- function woo_custom_hide_sales_flash()
- {
- if ( is_user_logged_in() ) {
- return true;
- }
- return false;
- }
- function sales_markup() {
- if(!is_admin()) {
- if(is_user_logged_in()) {
- // Instead of outputting add the markup that you want to show
- $output = '<div class="Sales_markup_here">
- </div>';
- return $output;
- }
- }
- }
- // use shortcode instead of action and then use shortcode anywhere you want to ouptut it
- add_shortcode( 'sales_markup', 'sales_markup' );
- add_filter( 'woocommerce_sale_flash', 'filter_sales_flash_callback', 100, 3 );
- function filter_sales_flash_callback( $output_html, $post, $product )
- {
- if ( ! is_user_logged_in() ) {
- $output_html = false;
- }
- return $output_html;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement