<?php

namespace Saswp;

function property_price_shortcode() {
	$settings           = new \Saswp\Settings();
	$property           = new \Saswp\Repository\PropertyRepository();
	$propertyDTO        = $property->get( $settings->get( 'sas_one_property_page_id' ) )->getProperty();
	$propertyPricingDTO = $property->get( $settings->get( 'sas_one_property_page_id' ) )->getPropertyPricing();
	if ( $propertyPricingDTO->base_price ) {
		return '<div class="price-box">Start at <span class="price">' . $propertyDTO->currency_code . '$' . esc_html( $propertyPricingDTO->base_price ) . '</span> / Night </div> ';
	}

	return '<div class="price-box" data-shortcode="property_price"></div>';
}

?>
