<?php

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

$price_visible = 'no' !== get_post_meta( $wpcb_configuration_id, '_show_price', true );
if ( ! is_user_logged_in() && wpcb_get_option( 'wpcb_show_prices_logged_in_users' ) ) {
	$price_visible = false;
}

if ( $price_visible ) {
	$price_visible = 'no' !== get_post_meta( $wpcb_configuration_id, '_show_price_totals', true );

	if ( function_exists( 'wpcb_display_tiered_price_table_html' ) ) {
		wpcb_display_tiered_price_table_html( $wpcb_configuration_id );
	}
}

$totals_inline = wpcb_get_option( 'wpcb_show_price_totals_inline' );
if ( $price_visible && $totals_inline ) : 
	do_action( 'wpcb_before_configuration_form_total_price_table' );

	?>
	<div class="wpcb-price-table"<?php echo ' data-wpcb-id="' . esc_attr( $wpcb_configuration_id ) . '"'; ?>>
		<div class="wpcb-configurator-price-table-totals">
		</div>
	</div>
	<?php
	
	do_action( 'wpcb_after_configuration_form_total_price_table' );
endif;
