Ejemplo n.º 1
0
 /**
  * @param $price float Price to format.
  *
  * @return string Formatted price with currency symbol.
  */
 public static function formatPrice($price)
 {
     if ($price === 0.0) {
         return __('Free', 'jigoshop');
     }
     if ($price !== '') {
         return sprintf(Currency::format(), Currency::symbol(), Currency::code(), self::formatNumericPrice($price));
     }
     return __('Price not announced.', 'jigoshop');
 }
Ejemplo n.º 2
0
			<input type="hidden" id="min_price" name="min_price" value="0" />
			<?php 
\Jigoshop\Helper\Forms::printHiddenFields($fields, array('max_price', 'min_price'));
?>
		</div>
		<div class="clear"></div>
	</div>
</form>
<script type="text/javascript">
	/*<![CDATA[*/
	jQuery(document).ready(function($){
		// Price slider
		var min_price = parseInt($('.price_slider_amount #min_price').val());
		var max_price = parseInt($('.price_slider_amount #max_price').val());
		var html = '<?php 
echo sprintf(Currency::format(), Currency::symbol(), Currency::code(), '%s%');
?>
';
		var current_min_price, current_max_price;
		current_min_price = min_price;
		current_max_price = max_price;
		$('.price_slider').slider({
			range: true,
			min: min_price,
			max: max_price,
			values: [min_price, max_price],
			create: function(){
				$(".price_slider_amount span").html(html.replace(/%s%/g, min_price) + " - " + html.replace(/%s%/g, max_price));
				$(".price_slider_amount #min_price").val(current_min_price);
				$(".price_slider_amount #max_price").val(current_max_price);
			},