Show Start and End Promotional Dates
-
Hello,
I use the next code to show, the line below the price on product page, the start and end promotional dates (necessary in Europe):// MOSTRA AS DATAS DE PROMO??O NA PAGINA DE ARTIGO SIMPLES function preco_informa_data_promocao( $price, $product ) { if ( is_single() && $product->is_on_sale() ) { $data_inicio = $product->get_date_on_sale_from(); $data_fim = $product->get_date_on_sale_to(); if( ! empty($data_inicio) || ! empty($data_fim) ){ $data_de_inicio = $data_inicio->date( "j.m.Y"); $data_de_fim = $data_fim->date( "j.m.Y"); $sales_date = '<p class="desconto_produto">Promo??o válida de '.$data_de_inicio.' a '.$data_de_fim.'</p>'; } else { $sales_date = $data_de_inicio = $data_de_fim = ''; } $price = "<p class='price'>" . $price ."</p>" . "<p style='text-align:center'>" . $sales_date ."</p>"; } return $price; } add_filter( 'woocommerce_get_price_html', 'preco_informa_data_promocao', 100, 2 );
I would like to adapt this code to be used with this plugin. But I need the name of the variables that store the discount dates. Basically these two values:
$data_inicio = $product->get_date_on_sale_from(); $data_fim = $product->get_date_on_sale_to();
It’s possible ? Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Show Start and End Promotional Dates’ is closed to new replies.