Prodotti non in saldo

Home » Snippets » Prodotti non in saldo
0

Created with:

Custom snippet Generator

Visibility: 

public

Creator: wppoint.it@gmail.com

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
				<?php

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();
    
} );
			

Register an account to save your snippets or go Pro to get more features.