Esempio n. 1
0
	<header class="entry-header">
		<?php 
if (is_single()) {
    the_title('<h1 class="entry-title">', '</h1>');
} else {
    the_title(sprintf('<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h2>');
}
?>
	</header><!-- .entry-header -->

	<div class="entry-content">
		<div class="property-overview">
			<dl>
				<?php 
$price = Realia_Price::get_property_price();
?>
				<?php 
if (!empty($price)) {
    ?>
					<dt><?php 
    echo __('Precio', 'realia');
    ?>
</dt><dd><?php 
    echo wp_kses($price, wp_kses_allowed_html('post'));
    ?>
</dd>
				<?php 
}
?>
Esempio n. 2
0
                    <strong><?php 
    echo esc_attr($type);
    ?>
</strong>
                </div><!-- /.property-box-meta-item -->
            <?php 
}
?>

            <?php 
if (!empty($price)) {
    ?>
                <div class="property-row-meta-item">
                    <span><i class="fa fa-money"></i></span>
                    <strong><?php 
    echo Realia_Price::get_property_price();
    ?>
</strong>
                </div><!-- /.property-box-meta-item -->
            <?php 
}
?>

            <?php 
if (!empty($area)) {
    ?>
            
                <div class="property-row-meta-item">
                    <span><i class="fa fa-arrows"></i></span>
                    <strong><?php 
    echo esc_attr($area);
Esempio n. 3
0
    ?>
		</tr>
		</thead>

		<tbody>
		<!-- PRICE -->
		<tr>
			<td class="compare-table-label"><?php 
    echo __('Precio', 'realia');
    ?>
</td>
			<?php 
    foreach ($query->posts as $post) {
        ?>
				<td class="compare-table-col"><?php 
        echo Realia_Price::get_property_price($post->ID);
        ?>
</td>
			<?php 
    }
    ?>
		</tr>
		<!-- TYPE -->
		<tr>
			<td class="compare-table-label"><?php 
    echo __('Tipo', 'realia');
    ?>
</td>
			<?php 
    foreach ($query->posts as $post) {
        ?>
 /**
  * Gets package formatted price
  *
  * @access public
  * @param $package_id
  * @return bool|string
  */
 public static function get_package_formatted_price($package_id)
 {
     $price = get_post_meta($package_id, REALIA_PACKAGE_PREFIX . 'price', true);
     return Realia_Price::format_price($price);
 }
Esempio n. 5
0
 /**
  * Prepares payment data
  *
  * @access public
  * @param $payment_type
  * @param $object_id
  * @return array|bool
  */
 public static function get_data($payment_type, $object_id)
 {
     $data = array();
     $post = get_post($object_id);
     $currencies = get_theme_mod('realia_currencies', array());
     if (!empty($currencies) && is_array($currencies)) {
         $currency = array_shift($currencies);
         $currency_code = $currency['code'];
         $currency_sign = $currency['symbol'];
     } else {
         $currency_code = 'USD';
         $currency_sign = '$';
     }
     switch ($payment_type) {
         case 'pay_for_featured':
             $price = get_theme_mod('realia_submission_featured_price');
             $data = array('title' => __('Feature property', 'realia'), 'description' => sprintf(__('Feature property %s', 'realia'), $post->post_title), 'price' => $price, 'price_formatted' => Realia_Price::format_price($price), 'currency_code' => $currency_code, 'currency_sign' => $currency_sign);
             break;
         case 'pay_for_sticky':
             $price = get_theme_mod('realia_submission_sticky_price');
             $data = array('title' => __('Sticky property', 'realia'), 'description' => sprintf(__('Sticky property %s', 'realia'), $post->post_title), 'price' => $price, 'price_formatted' => Realia_Price::format_price($price), 'currency_code' => $currency_code, 'currency_sign' => $currency_sign);
             break;
         case 'pay_per_post':
             $price = get_theme_mod('realia_submission_pay_per_post_price');
             $data = array('title' => __('Publish property', 'realia'), 'description' => sprintf(__('Publish property %s', 'realia'), $post->post_title), 'price' => $price, 'price_formatted' => Realia_Price::format_price($price), 'currency_code' => $currency_code, 'currency_sign' => $currency_sign);
             break;
         case 'package':
             $price = get_post_meta($object_id, REALIA_PACKAGE_PREFIX . 'price', true);
             $data = array('title' => __('Purchase package', 'realia'), 'description' => sprintf(__('Upgrade package to %s', 'realia'), $post->post_title), 'price' => $price, 'price_formatted' => Realia_Price::format_price($price), 'currency_code' => $currency_code, 'currency_sign' => $currency_sign);
             break;
         default:
             return false;
     }
     return $data;
 }
Esempio n. 6
0
										<form method="post" action="<?php 
                        echo get_permalink($payment_page_id);
                        ?>
">
											<input type="hidden" name="payment_type" value="pay_per_post">
											<input type="hidden" name="object_id" value="<?php 
                        the_ID();
                        ?>
">

											<button type="submit">
												<?php 
                        echo __('Publish', 'realia');
                        ?>
 <span class="label label-primary"><?php 
                        echo Realia_Price::format_price($price);
                        ?>
</span>
												<i class="fa fa-arrow-circle-o-right buy"></i>
											</button>
										</form>
									<?php 
                    }
                    ?>
								<?php 
                } elseif ($submission_type == 'packages') {
                    ?>

								<?php 
                }
                ?>
 /**
  * Custom admin columns implementation
  *
  * @access public
  * @param string $column
  * @return array
  */
 public static function custom_columns_manage($column)
 {
     switch ($column) {
         case 'thumbnail':
             if (has_post_thumbnail()) {
                 the_post_thumbnail('thumbnail', array('class' => 'attachment-thumbnail attachment-thumbnail-small'));
             } else {
                 echo '-';
             }
             break;
         case 'price':
             $price = Realia_Price::get_property_price(get_the_ID());
             if (!empty($price)) {
                 echo wp_kses($price, wp_kses_allowed_html('post'));
             } else {
                 echo '-';
             }
             break;
         case 'location':
             $terms = get_the_terms(get_the_ID(), 'locations');
             if (!empty($terms)) {
                 $location = array_shift($terms);
                 echo sprintf('<a href="?post_type=property&location=%s">%s</a>', $location->slug, $location->name);
             } else {
                 echo '-';
             }
             break;
         case 'type':
             $terms = get_the_terms(get_the_ID(), 'property_types');
             if (is_array($terms)) {
                 $property_type = array_shift($terms);
                 echo sprintf('<a href="?post_type=property&property_type=%s">%s</a>', $property_type->slug, $property_type->name);
             } else {
                 echo '-';
             }
             break;
         case 'contract':
             $terms = get_the_terms(get_the_ID(), 'contracts');
             if (!empty($terms)) {
                 $contract_type = array_shift($terms);
                 echo sprintf('<a href="?post_type=property&contract=%s">%s</a>', $contract_type->slug, $contract_type->name);
             } else {
                 echo '-';
             }
             break;
         case 'sticky':
             $sticky = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'sticky', true);
             if (!empty($sticky)) {
                 echo '<div class="dashicons-before dashicons-yes green"></div>';
             } else {
                 echo '<div class="dashicons-before dashicons-no red"></div>';
             }
             break;
         case 'featured':
             $featured = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'featured', true);
             if (!empty($featured)) {
                 echo '<div class="dashicons-before dashicons-yes green"></div>';
             } else {
                 echo '<div class="dashicons-before dashicons-no red"></div>';
             }
             break;
         case 'reduced':
             $featured = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'reduced', true);
             if (!empty($featured)) {
                 echo '<div class="dashicons-before dashicons-yes green"></div>';
             } else {
                 echo '<div class="dashicons-before dashicons-no red"></div>';
             }
             break;
         case 'views':
             echo __('Total', 'realia') . ': ' . Realia_Statistics::property_views_get_total() . '<br>';
             echo __('Weekly', 'realia') . ': ';
             $progress = Realia_Statistics::property_views_get_weekly_progress();
             if ($progress < 0) {
                 echo '<span class="red">' . $progress . '%</span>';
             } elseif ($progress > 0) {
                 echo '<span class="green">' . $progress . '%</span>';
             } else {
                 echo '<span>' . $progress . '%</span>';
             }
             break;
         case 'paid':
             $paid = Realia_Query::is_property_paid();
             if ($paid) {
                 echo '<div class="dashicons-before dashicons-yes green"></div>';
             } else {
                 echo '<div class="dashicons-before dashicons-no red"></div>';
             }
             break;
     }
 }
Esempio n. 8
0
	<?php 
} elseif ($payment_type == 'package') {
    ?>
		<?php 
    if (!empty($object_id)) {
        ?>
			<?php 
        $title = get_the_title($object_id);
        ?>
			<?php 
        $price = get_post_meta($object_id, REALIA_PACKAGE_PREFIX . 'price', true);
        ?>

			<div class="payment-info">
				<?php 
        echo sprintf(__('You are going to pay <strong>%s</strong> for package <strong>"%s"</strong>.', 'realia'), Realia_Price::format_price($price), $title);
        ?>
			</div><!-- /.payment-info -->
		<?php 
    } else {
        ?>
			<div class="payment-info">
				<?php 
        echo __('Missing package.', 'realia');
        ?>
			</div><!-- /.payment-info -->
		<?php 
    }
    ?>
	<?php 
} else {