add_action( 'jet-engine/register-macros', function(){ 
	
    if ( ! function_exists( 'WC' ) ) {
        return;
    }
  
    class Products_On_Sale_Macro extends \Jet_Engine_Base_Macros {

        public function macros_tag() {
            return 'wc_products_on_sale';
        }

        public function macros_name() {
            return 'WC Products on Sale';
        }

        public function macros_args() {
            return array();
        }

        public function macros_callback( $args = array() ) {

            $on_sale = array_merge( array( 0 ), wc_get_product_ids_on_sale() );
			
            return implode( ',', $on_sale );
				
        }
    }

    new Products_On_Sale_Macro();
    
} );