public function convert($price, $to)
 {
     $price = str_replace(get_jigoshop_currency_symbol(), "", $price);
     if (get_option('currency_rate_' . $to) != "") {
         return "<span class=\"currency-symbol\">" . $this->get_currency_symbol($to) . "</span>" . number_format($price * get_option('currency_rate_' . $to), 2);
     } else {
         return "<span>Unavailable</span>";
     }
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     /* installs our gateway options in the settings */
     $this->id = 'futurepay';
     $this->icon = jigoshop::assets_url() . '/assets/images/icons/futurepay.png';
     $this->has_fields = false;
     $this->enabled = Jigoshop_Base::get_options()->get('jigoshop_futurepay_enabled');
     $this->title = Jigoshop_Base::get_options()->get('jigoshop_futurepay_title');
     $this->description = Jigoshop_Base::get_options()->get('jigoshop_futurepay_description');
     $this->gmid = Jigoshop_Base::get_options()->get('jigoshop_futurepay_gmid');
     self::$request_url = Jigoshop_Base::get_options()->get('jigoshop_futurepay_mode') == 'no' ? self::FUTUREPAY_LIVE_URL : self::FUTUREPAY_SANDBOX_URL;
     add_action('init', array($this, 'check_response'));
     add_action('valid-futurepay-request', array($this, 'successful_request'), 10, 2);
     add_action('receipt_futurepay', array($this, 'receipt_page'));
     add_action('admin_notices', array($this, 'futurepay_notices'));
     add_action('wp_footer', array($this, 'futurepay_script'));
     $this->currency_symbol = get_jigoshop_currency_symbol();
     $this->shop_base_country = jigoshop_countries::get_base_country();
 }
Example #3
0
</td>
		</tr>
		<tr>
			<td data-export-label="Currency"><?php 
_e('Currency', 'jigoshop');
?>
</td>
			<td class="help"><?php 
echo '<a href="#" class="help_tip" data-tip="' . esc_attr__('What currency prices are listed at in the catalog and which currency gateways will take payments in.', 'jigoshop') . '">[?]</a>';
?>
</td>
			<td><?php 
echo $options->get('jigoshop_currency');
?>
 (<?php 
echo get_jigoshop_currency_symbol();
?>
)</td>
		</tr>
		<tr>
			<td data-export-label="Currency Position"><?php 
_e('Currency Position', 'jigoshop');
?>
</td>
			<td class="help"><?php 
echo '<a href="#" class="help_tip" data-tip="' . esc_attr__('The position of the currency symbol.', 'jigoshop') . '">[?]</a>';
?>
</td>
			<td><?php 
echo $options->get('jigoshop_currency_pos');
?>
Example #4
0
function jigoshop_price( $price, $args = array() ) {
	
	extract(shortcode_atts(array(
		'ex_tax_label' 	=> '0'
	), $args));
	
	$return = '';
	$num_decimals = (int) get_option('jigoshop_price_num_decimals');
	$currency_pos = get_option('jigoshop_currency_pos');
	$currency_symbol = get_jigoshop_currency_symbol();
	$price = number_format( (double) $price, $num_decimals, get_option('jigoshop_price_decimal_sep'), get_option('jigoshop_price_thousand_sep') );
	
	switch ($currency_pos) :
		case 'left' :
			$return = $currency_symbol . $price;
		break;
		case 'right' :
			$return = $price . $currency_symbol;
		break;
		case 'left_space' :
			$return = $currency_symbol . ' ' . $price;
		break;
		case 'right_space' :
			$return = $price . ' ' . $currency_symbol;
		break;
	endswitch;
	
	if ($ex_tax_label && get_option('jigoshop_calc_taxes')=='yes') $return .= __(' <small>(ex. tax)</small>', 'jigoshop');
	
	return $return;
}
Example #5
0
		if (isset($_SESSION['min_price'])) echo 'current_min_price = '.$_SESSION['min_price'].';'; else echo 'current_min_price = min_price;';
		if (isset($_SESSION['max_price'])) echo 'current_max_price = '.$_SESSION['max_price'].';'; else echo 'current_max_price = max_price;';
	?>
	
	jQuery('.price_slider').slider({
		range: true,
		min: min_price,
		max: max_price,
		values: [ current_min_price, current_max_price ],
		create : function( event, ui ) {
			jQuery( ".price_slider_amount span" ).html( "<?php echo get_jigoshop_currency_symbol(); ?>" + current_min_price + " - <?php echo get_jigoshop_currency_symbol(); ?>" + current_max_price );
			jQuery( ".price_slider_amount #min_price" ).val(current_min_price);
			jQuery( ".price_slider_amount #max_price" ).val(current_max_price);
		},
		slide: function( event, ui ) {
			jQuery( ".price_slider_amount span" ).html( "<?php echo get_jigoshop_currency_symbol(); ?>" + ui.values[ 0 ] + " - <?php echo get_jigoshop_currency_symbol(); ?>" + ui.values[ 1 ] );
			jQuery( "input#min_price" ).val(ui.values[ 0 ]);
			jQuery( "input#max_price" ).val(ui.values[ 1 ]);
		}
	});
			
	// Quantity buttons
	jQuery("div.quantity, td.quantity").append('<input type="button" value="+" id="add1" class="plus" />').prepend('<input type="button" value="-" id="minus1" class="minus" />');
	jQuery(".plus").click(function()
	{
	    var currentVal = parseInt(jQuery(this).prev(".qty").val());
	   
	    if (!currentVal || currentVal=="" || currentVal == "NaN") currentVal = 0;
	    
	    jQuery(this).prev(".qty").val(currentVal + 1); 
	});
Example #6
0
/**
 * Product data box
 *
 * Displays the product data box, tabbed, with several panels covering price, stock etc
 *
 * @since 		1.0
 */
function jigoshop_product_data_box()
{
    global $post, $wpdb, $thepostid;
    add_action('admin_footer', 'jigoshop_meta_scripts');
    wp_nonce_field('jigoshop_save_data', 'jigoshop_meta_nonce');
    $thepostid = $post->ID;
    // Product Type
    $terms = get_the_terms($thepostid, 'product_type');
    $product_type = $terms ? current($terms)->slug : 'simple';
    $product_type_selector = apply_filters('jigoshop_product_type_selector', array('simple' => __('Simple', 'jigoshop'), 'downloadable' => __('Downloadable', 'jigoshop'), 'grouped' => __('Grouped', 'jigoshop'), 'virtual' => __('Virtual', 'jigoshop'), 'variable' => __('Variable', 'jigoshop'), 'external' => __('External / Affiliate', 'jigoshop')));
    $product_type_select = '<div class="product-type-label">' . __('Product Type', 'jigoshop') . '</div><select id="product-type" name="product-type"><optgroup label="' . __('Product Type', 'jigoshop') . '">';
    foreach ($product_type_selector as $value => $label) {
        $product_type_select .= '<option value="' . $value . '" ' . selected($product_type, $value, false) . '>' . $label . '</option>';
    }
    $product_type_select .= '</optgroup></select><div class="clear"></div>';
    ?>

	<div class="panels">
		<span class="jigoshop_product_data_type"><?php 
    echo $product_type_select;
    ?>
</span>
		<ul class="product_data_tabs tabs" style="display:none;">
			<li class="general_tab active">
				<a href="#general"><?php 
    _e('General', 'jigoshop');
    ?>
</a>
			</li>

			<li class="advanced_tab">
				<a href="#tax"><?php 
    _e('Advanced', 'jigoshop');
    ?>
</a>
			</li>

			<?php 
    if (Jigoshop_Base::get_options()->get('jigoshop_manage_stock') == 'yes') {
        ?>
			<li class="inventory_tab">
				<a href="#inventory"><?php 
        _e('Inventory', 'jigoshop');
        ?>
</a>
			</li>
			<?php 
    }
    ?>

			<li class="attributes_tab">
				<a href="#attributes"><?php 
    _e('Attributes', 'jigoshop');
    ?>
</a>
			</li>

			<li class="grouped_tab">
				<a href="#grouped"><?php 
    _e('Grouping', 'jigoshop');
    ?>
</a>
			</li>

			<li class="file_tab">
				<a href="#files"><?php 
    _e('Download', 'jigoshop');
    ?>
</a>
			</li>

			<?php 
    do_action('jigoshop_product_write_panel_tabs');
    ?>
			<?php 
    do_action('product_write_panel_tabs');
    ?>
		</ul>

		<div id="general" class="panel jigoshop_options_panel">
			<fieldset>
			<?php 
    // Visibility
    $args = array('id' => 'product_visibility', 'label' => __('Visibility', 'jigoshop'), 'options' => array('visible' => __('Catalog & Search', 'jigoshop'), 'catalog' => __('Catalog Only', 'jigoshop'), 'search' => __('Search Only', 'jigoshop'), 'hidden' => __('Hidden', 'jigoshop')), 'selected' => get_post_meta($post->ID, 'visibility', true));
    echo Jigoshop_Forms::select($args);
    // Featured
    $args = array('id' => 'featured', 'label' => __('Featured?', 'jigoshop'), 'desc' => __('Enable this option to feature this product', 'jigoshop'), 'value' => false);
    echo Jigoshop_Forms::checkbox($args);
    ?>
			</fieldset>
			<fieldset>
			<?php 
    // SKU
    if (Jigoshop_Base::get_options()->get('jigoshop_enable_sku') !== 'no') {
        $args = array('id' => 'sku', 'label' => __('SKU', 'jigoshop'), 'placeholder' => $post->ID);
        echo Jigoshop_Forms::input($args);
    }
    //Brand
    if (Jigoshop_Base::get_options()->get('jigoshop_enable_brand') !== 'no') {
        $args = array('id' => 'brand', 'label' => __('Brand', 'jigoshop'));
        echo Jigoshop_Forms::input($args);
    }
    //GTIN
    if (Jigoshop_Base::get_options()->get('jigoshop_enable_gtin ') !== 'no') {
        $args = array('id' => 'gtin', 'label' => __('GTIN ', 'jigoshop'));
        echo Jigoshop_Forms::input($args);
    }
    //MPN
    if (Jigoshop_Base::get_options()->get('jigoshop_enable_mpn') !== 'no') {
        $args = array('id' => 'mpn', 'label' => __('MPN', 'jigoshop'));
        echo Jigoshop_Forms::input($args);
    }
    ?>
			</fieldset>

			<fieldset id="price_fieldset">
			<?php 
    // Regular Price
    $args = array('id' => 'regular_price', 'label' => __('Regular Price', 'jigoshop'), 'after_label' => ' (' . get_jigoshop_currency_symbol() . ')', 'type' => 'number', 'step' => 'any', 'placeholder' => __('Price Not Announced', 'jigoshop'));
    echo Jigoshop_Forms::input($args);
    // Sale Price
    $args = array('id' => 'sale_price', 'label' => __('Sale Price', 'jigoshop'), 'after_label' => ' (' . get_jigoshop_currency_symbol() . __(' or %', 'jigoshop') . ')', 'desc' => '<a href="#" class="sale_schedule">' . __('Schedule', 'jigoshop') . '</a>', 'placeholder' => __('15% or 19.99', 'jigoshop'));
    echo Jigoshop_Forms::input($args);
    // Sale Price date range
    // TODO: Convert this to a helper somehow?
    $field = array('id' => 'sale_price_dates', 'label' => __('On Sale Between', 'jigoshop'));
    $sale_price_dates_from = get_post_meta($thepostid, 'sale_price_dates_from', true);
    $sale_price_dates_to = get_post_meta($thepostid, 'sale_price_dates_to', true);
    echo '<p class="form-field sale_price_dates_fields">' . __('Current time:', 'jigoshop') . ' ' . current_time('Y-m-d H:i') . '</p>';
    echo '	<p class="form-field sale_price_dates_fields">
							<label for="' . esc_attr($field['id']) . '_from">' . $field['label'] . '</label>
							<input type="text" class="short date-pick" name="' . esc_attr($field['id']) . '_from" id="' . esc_attr($field['id']) . '_from" value="';
    if ($sale_price_dates_from) {
        echo date('Y-m-d H:i', $sale_price_dates_from);
    }
    echo '" placeholder="' . __('From', 'jigoshop') . ' (' . date('Y-m-d H:i') . ')" maxlength="16" />
							<input type="text" class="short date-pick" name="' . esc_attr($field['id']) . '_to" id="' . esc_attr($field['id']) . '_to" value="';
    if ($sale_price_dates_to) {
        echo date('Y-m-d H:i', $sale_price_dates_to);
    }
    echo '" placeholder="' . __('To', 'jigoshop') . ' (' . date('Y-m-d H:i') . ')" maxlength="16" />
							<a href="#" class="cancel_sale_schedule">' . __('Cancel', 'jigoshop') . '</a>
						</p>';
    ?>
			<?php 
    do_action('jigoshop_product_pricing_options');
    /* allow extensions like sales flash pro to add pricing options */
    ?>
			</fieldset>

			<fieldset>
			<?php 
    // External products
    $args = array('id' => 'external_url', 'label' => __('Product URL', 'jigoshop'), 'placeholder' => __('The URL of the external product (eg. http://www.google.com)', 'jigoshop'), 'extras' => array());
    echo Jigoshop_Forms::input($args);
    ?>
			</fieldset>
			<?php 
    do_action('jigoshop_product_general_panel');
    ?>
		</div>
		<div id="tax" class="panel jigoshop_options_panel">
			<fieldset id="tax_fieldset">
				<?php 
    // Tax Status
    $status = get_post_meta($post->ID, 'tax_status', true);
    if (empty($status)) {
        $status = Jigoshop_Base::get_options()->get('jigoshop_tax_defaults_status', 'taxable');
    }
    $args = array('id' => 'tax_status', 'label' => __('Tax Status', 'jigoshop'), 'options' => array('taxable' => __('Taxable', 'jigoshop'), 'shipping' => __('Shipping', 'jigoshop'), 'none' => __('None', 'jigoshop')), 'selected' => $status);
    echo Jigoshop_Forms::select($args);
    ?>
				<p class="form_field tax_classes_field">
					<label for="tax_classes"><?php 
    _e('Tax Classes', 'jigoshop');
    ?>
</label>
            <span class="multiselect short">
            <?php 
    $_tax = new jigoshop_tax();
    $tax_classes = $_tax->get_tax_classes();
    $selections = get_post_meta($post->ID, 'tax_classes', true);
    if (!is_array($selections)) {
        $selections = Jigoshop_Base::get_options()->get('jigoshop_tax_defaults_classes', array('*'));
    }
    $checked = checked(in_array('*', $selections), true, false);
    printf('<label %s><input type="checkbox" name="tax_classes[]" value="%s" %s/> %s</label>', !empty($checked) ? 'class="selected"' : '', '*', $checked, __('Standard', 'jigoshop'));
    if ($tax_classes) {
        foreach ($tax_classes as $tax_class) {
            $checked = checked(in_array(sanitize_title($tax_class), $selections), true, false);
            printf('<label %s><input type="checkbox" name="tax_classes[]" value="%s" %s/> %s</label>', !empty($checked) ? 'class="selected"' : '', sanitize_title($tax_class), $checked, __($tax_class, 'jigoshop'));
        }
    }
    ?>
            </span>
            <span class="multiselect-controls">
						<a class="check-all" href="#"><?php 
    _e('Check All', 'jigoshop');
    ?>
</a>&nbsp;|
						<a class="uncheck-all" href="#"><?php 
    _e('Uncheck All', 'jigoshop');
    ?>
</a>
					</span>
				</p>
			</fieldset>

			<?php 
    if (Jigoshop_Base::get_options()->get('jigoshop_enable_weight') !== 'no' || Jigoshop_Base::get_options()->get('jigoshop_enable_dimensions', true) !== 'no') {
        ?>
			<fieldset id="form_fieldset">
			<?php 
        // Weight
        if (Jigoshop_Base::get_options()->get('jigoshop_enable_weight') !== 'no') {
            $args = array('id' => 'weight', 'label' => __('Weight', 'jigoshop'), 'after_label' => ' (' . Jigoshop_Base::get_options()->get('jigoshop_weight_unit') . ')', 'type' => 'number', 'step' => 'any', 'placeholder' => '0.00');
            echo Jigoshop_Forms::input($args);
        }
        // Dimensions
        if (Jigoshop_Base::get_options()->get('jigoshop_enable_dimensions', true) !== 'no') {
            echo '
					<p class="form-field dimensions_field">
						<label for"product_length">' . __('Dimensions', 'jigoshop') . ' (' . Jigoshop_Base::get_options()->get('jigoshop_dimension_unit') . ')' . '</label>
						<input type="number" step="any" name="length" class="short" value="' . get_post_meta($thepostid, 'length', true) . '" placeholder="' . __('Length', 'jigoshop') . '" />
						<input type="number" step="any" name="width" class="short" value="' . get_post_meta($thepostid, 'width', true) . '" placeholder="' . __('Width', 'jigoshop') . '" />
						<input type="number" step="any" name="height" class="short" value="' . get_post_meta($thepostid, 'height', true) . '" placeholder="' . __('Height', 'jigoshop') . '" />
					</p>
					';
        }
        ?>
			</fieldset>
			<?php 
    }
    ?>

			<fieldset>
			<?php 
    // Customizable
    $args = array('id' => 'product_customize', 'label' => __('Can be personalized', 'jigoshop'), 'options' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop')), 'selected' => get_post_meta($post->ID, 'customizable', true));
    echo Jigoshop_Forms::select($args);
    // Customizable length
    $args = array('id' => 'customized_length', 'label' => __('Personalized Characters', 'jigoshop'), 'type' => 'number', 'value' => get_post_meta($post->ID, 'customized_length', true), 'placeholder' => __('Leave blank for unlimited', 'jigoshop'));
    echo Jigoshop_Forms::input($args);
    ?>
			</fieldset>
			<?php 
    do_action('jigoshop_product_tax_panel');
    ?>

		</div>

		<?php 
    if (Jigoshop_Base::get_options()->get('jigoshop_manage_stock') == 'yes') {
        ?>
		<div id="inventory" class="panel jigoshop_options_panel">
			<fieldset>
			<?php 
        // manage stock
        $args = array('id' => 'manage_stock', 'label' => __('Manage Stock?', 'jigoshop'), 'desc' => __('Handle stock for me', 'jigoshop'), 'value' => false);
        echo Jigoshop_Forms::checkbox($args);
        ?>
			</fieldset>
			<fieldset>
			<?php 
        // Stock Status
        // TODO: These values should be true/false
        $args = array('id' => 'stock_status', 'label' => __('Stock Status', 'jigoshop'), 'options' => array('instock' => __('In Stock', 'jigoshop'), 'outofstock' => __('Out of Stock', 'jigoshop')));
        echo Jigoshop_Forms::select($args);
        echo '<div class="stock_fields">';
        // Stock
        // TODO: Missing default value of 0
        $args = array('id' => 'stock', 'label' => __('Stock Quantity', 'jigoshop'), 'type' => 'number');
        echo Jigoshop_Forms::input($args);
        // Backorders
        $args = array('id' => 'backorders', 'label' => __('Allow Backorders?', 'jigoshop'), 'options' => array('no' => __('Do not allow', 'jigoshop'), 'notify' => __('Allow, but notify customer', 'jigoshop'), 'yes' => __('Allow', 'jigoshop')));
        echo Jigoshop_Forms::select($args);
        echo '</div>';
        ?>
			</fieldset>
			<?php 
        do_action('jigoshop_product_inventory_panel');
        ?>
		</div>
		<?php 
    }
    ?>

		<div id="attributes" class="panel">
			<?php 
    do_action('jigoshop_attributes_display');
    ?>
		</div>

		<div id="grouped" class="panel jigoshop_options_panel">
			<?php 
    // Grouped Products
    // TODO: Needs refactoring & a bit of love
    $posts_in = (array) get_objects_in_term(get_term_by('slug', 'grouped', 'product_type')->term_id, 'product_type');
    $posts_in = array_unique($posts_in);
    if ((bool) $posts_in) {
        $args = array('post_type' => 'product', 'post_status' => 'publish', 'numberposts' => -1, 'orderby' => 'title', 'order' => 'asc', 'post_parent' => 0, 'include' => $posts_in);
        $grouped_products = get_posts($args);
        $options = array(null => '&ndash; Pick a Product Group &ndash;');
        if ($grouped_products) {
            foreach ($grouped_products as $product) {
                if ($product->ID == $post->ID) {
                    continue;
                }
                $options[$product->ID] = $product->post_title;
            }
        }
        // Only echo the form if we have grouped products
        $args = array('id' => 'parent_id', 'label' => __('Product Group', 'jigoshop'), 'options' => $options, 'selected' => $post->post_parent);
        echo Jigoshop_Forms::select($args);
    }
    // Ordering
    $args = array('id' => 'menu_order', 'label' => __('Sort Order', 'jigoshop'), 'type' => 'number', 'value' => $post->menu_order);
    echo Jigoshop_Forms::input($args);
    $args = array('id' => 'variation_order', 'label' => __('Variation Order', 'jigoshop'), 'options' => array('asort' => __('By name ascending', 'jigoshop'), 'arsort' => __('By name descending', 'jigoshop'), 'ksort' => __('From first to last key', 'jigoshop'), 'krsort' => __('From last to first key', 'jigoshop'), 'shuffle' => __('Random', 'jigoshop')), 'selected' => get_post_meta($post->ID, 'variation_order', true));
    echo Jigoshop_Forms::select($args);
    ?>
			<?php 
    do_action('jigoshop_product_grouped_panel');
    ?>
		</div>

		<div id="files" class="panel jigoshop_options_panel">
			<fieldset>
			<?php 
    // DOWNLOADABLE OPTIONS
    // File URL
    // TODO: Refactor this into a helper
    $file_path = get_post_meta($post->ID, 'file_path', true);
    $field = array('id' => 'file_path', 'label' => __('File Path', 'jigoshop'));
    echo '<p class="form-field"><label for="' . esc_attr($field['id']) . '">' . $field['label'] . ':</label>
				<input type="text" class="file_path" name="' . esc_attr($field['id']) . '" id="' . esc_attr($field['id']) . '" value="' . esc_attr($file_path) . '" placeholder="' . site_url() . '" />
				<input type="button"  class="upload_file_button button" data-postid="' . esc_attr($post->ID) . '" value="' . __('Upload a file', 'jigoshop') . '" />
			</p>';
    // Download Limit
    $args = array('id' => 'download_limit', 'label' => __('Download Limit', 'jigoshop'), 'type' => 'number', 'desc' => __('Leave blank for unlimited re-downloads', 'jigoshop'));
    echo Jigoshop_Forms::input($args);
    do_action('additional_downloadable_product_type_options');
    ?>
			</fieldset>
			<?php 
    do_action('jigoshop_product_files_panel');
    ?>
		</div>

		<?php 
    do_action('jigoshop_product_write_panels');
    ?>
		<?php 
    do_action('product_write_panels');
    ?>
	</div>
	<?php 
}
/**
 * $jigoshop_options_settings variable contains all the options used on the Jigoshop settings page
 *
 * DISCLAIMER
 *
 * Do not edit or add directly to this file if you wish to upgrade Jigoshop to newer
 * versions in the future. If you wish to customise Jigoshop core for your needs,
 * please use our GitHub repository to publish essential changes for consideration.
 *
 * @package             Jigoshop
 * @category            Admin
 * @author              Jigoshop
 * @copyright           Copyright © 2011-2014 Jigoshop.
 * @license             GNU General Public License v3
 */
/***********************    NOTE:   AS OF JIGOSHOP 1.3, THIS FILE IS NO LONGER IN USE       ************************/
_deprecated_file(__FILE__, '1.3', 'Jigoshop_Base::get_options()');
/**
 * options_settings
 *
 * This variable contains all the options used on the jigoshop settings page
 *
 * @since 		1.0
 * @category 	Admin
 * @usedby 		jigoshop_settings(), jigoshop_default_options()
 */
global $jigoshop_options_settings;
$jigoshop_options_settings = apply_filters('jigoshop_options_settings', array(array('type' => 'tab', 'tabname' => __('General', 'jigoshop')), array('name' => __('General Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Send Jigoshop emails from', 'jigoshop'), 'desc' => '', 'tip' => __('The email used to send all Jigoshop related emails, such as order confirmations and notices.', 'jigoshop'), 'id' => 'jigoshop_email', 'css' => 'width:250px;', 'type' => 'text', 'std' => get_option('admin_email')), array('name' => __('Base Country/Region', 'jigoshop'), 'desc' => '', 'tip' => __('This is the base country for your business. Tax rates will be based on this country.', 'jigoshop'), 'id' => 'jigoshop_default_country', 'css' => '', 'std' => 'GB', 'type' => 'single_select_country'), array('name' => __('Allowed Countries', 'jigoshop'), 'desc' => '', 'tip' => __('These are countries that you are willing to ship to.', 'jigoshop'), 'id' => 'jigoshop_allowed_countries', 'css' => 'min-width:100px;', 'std' => 'all', 'type' => 'select', 'options' => array('all' => __('All Countries', 'jigoshop'), 'specific' => __('Specific Countries', 'jigoshop'))), array('name' => __('Specific Countries', 'jigoshop'), 'desc' => '', 'tip' => '', 'id' => 'jigoshop_specific_allowed_countries', 'css' => '', 'std' => '', 'type' => 'multi_select_countries'), array('name' => __('After adding product to cart', 'jigoshop'), 'desc' => '', 'tip' => __('Define what should happen when a user clicks on &#34;Add to Cart&#34; on any product or page.', 'jigoshop'), 'id' => 'jigoshop_redirect_add_to_cart', 'css' => 'min-width:100px;', 'std' => 'same_page', 'type' => 'select', 'options' => array('same_page' => __('Stay on the same page', 'jigoshop'), 'to_checkout' => __('Redirect to Checkout', 'jigoshop'), 'to_cart' => __('Redirect to Cart', 'jigoshop'))), array('name' => __('Downloads', 'jigoshop'), 'desc' => __('Enforce login for downloads', 'jigoshop'), 'tip' => __('If a guest purchases a download, the guest can still download a link without logging in. We recommend disabling guest purchases if you enable this option.', 'jigoshop'), 'id' => 'jigoshop_downloads_require_login', 'std' => 'no', 'type' => 'checkbox'), array('name' => __('Styles and scripts', 'jigoshop'), 'desc' => __('Demo store banner', 'jigoshop'), 'tip' => __('Enable this option to show a banner at the top of every page stating this shop is currently in testing mode.', 'jigoshop'), 'id' => 'jigoshop_demo_store', 'std' => 'no', 'type' => 'checkbox'), array('desc' => __('Disable Jigoshop frontend.css', 'jigoshop'), 'tip' => __('Useful if you want to disable Jigoshop styles and theme it yourself via your theme.', 'jigoshop'), 'id' => 'jigoshop_disable_css', 'std' => 'no', 'type' => 'checkbox'), array('desc' => __('Disable bundled PrettyPhoto', 'jigoshop'), 'tip' => __('Useful if or one of your plugin already loads the PrettyPhoto script and css. But be careful, Jigoshop will still try to open product images using Fancybox.', 'jigoshop'), 'id' => 'jigoshop_disable_fancybox', 'std' => 'no', 'type' => 'checkbox'), array('name' => __('Checkout page', 'jigoshop'), 'desc' => __('Allow guest purchases', 'jigoshop'), 'tip' => __('Setting this to Yes will allow users to checkout without registering or signing up. Otherwise, users must be signed in or must sign up to checkout.', 'jigoshop'), 'id' => 'jigoshop_enable_guest_checkout', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Show login form', 'jigoshop'), 'id' => 'jigoshop_enable_guest_login', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Allow registration', 'jigoshop'), 'id' => 'jigoshop_enable_signup_form', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Force SSL on checkout', 'jigoshop'), 'tip' => __('Forcing SSL is recommended. This will load your checkout page with https://. An SSL certificate is <strong>required</strong> if you choose yes. Contact your hosting provider for more information on SSL Certs.', 'jigoshop'), 'id' => 'jigoshop_force_ssl_checkout', 'std' => 'no', 'type' => 'checkbox'), array('name' => __('Beta testing', 'jigoshop'), 'desc' => __('Use beta versions', 'jigoshop'), 'tip' => __('Only beta plugin updates will be shown for Jigoshop. Beta updates will display normally in the Wordpress plugin manager.', 'jigoshop'), 'id' => 'jigoshop_use_beta_version', 'std' => 'no', 'type' => 'checkbox'), array('desc' => __('Check for update now', 'jigoshop'), 'tip' => __('Manually check if a beta update is available.', 'jigoshop'), 'id' => 'jigoshop_check_beta_now', 'type' => 'button', 'href' => is_multisite() ? admin_url() . 'network/' : '' . 'admin.php?page=jigoshop_settings&amp;action=jigoshop_beta_check&amp;_wpnonce=' . wp_create_nonce('jigoshop_check_beta_' . get_current_user_id() . '_wpnonce')), array('name' => __('Invoicing', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Company Name', 'jigoshop'), 'desc' => '', 'tip' => __('Setting your company name will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_company_name', 'css' => 'width:300px;', 'type' => 'text', 'std' => ''), array('name' => __('Tax Registration Number', 'jigoshop'), 'desc' => 'Add your tax registration label before the registration number and it will be printed as well. eg. <code>VAT Number: 88888888</code>', 'tip' => __('Setting your tax number will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_tax_number', 'css' => 'width:300px;', 'type' => 'text', 'std' => ''), array('name' => __('Address Line1', 'jigoshop'), 'desc' => '', 'tip' => __('Setting your address will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_address_line1', 'css' => 'width:300px;', 'type' => 'text', 'std' => ''), array('name' => __('Address Line2', 'jigoshop'), 'desc' => '', 'tip' => __('If address line1 is not set, address line2 will not display even if you put a value in it. Setting your address will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_address_line2', 'css' => 'width:300px;', 'type' => 'text', 'std' => ''), array('name' => __('Company Phone', 'jigoshop'), 'desc' => '', 'tip' => __('Setting your company phone number will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_company_phone', 'css' => 'width:300px;', 'type' => 'text', 'std' => ''), array('name' => __('Company Email', 'jigoshop'), 'desc' => '', 'tip' => __('Setting your company email will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_company_email', 'css' => 'width:300px;', 'type' => 'text', 'std' => ''), array('name' => __('Integration', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('ShareThis Publisher ID', 'jigoshop'), 'desc' => __("Enter your <a href='http://sharethis.com/account/'>ShareThis publisher ID</a> to show ShareThis on product pages.", 'jigoshop'), 'tip' => __('ShareThis is a small social sharing widget for posting links on popular sites such as Twitter and Facebook.', 'jigoshop'), 'id' => 'jigoshop_sharethis', 'css' => 'width:300px;', 'type' => 'text', 'std' => ''), array('name' => __('Google Analytics ID', 'jigoshop'), 'desc' => __('Log into your Google Analytics account to find your ID. e.g. <code>UA-XXXXXXX-X</code>', 'jigoshop'), 'id' => 'jigoshop_ga_id', 'type' => 'text', 'css' => 'min-width:300px;'), array('name' => __('Enable Google eCommerce', 'jigoshop'), 'tip' => __('Add Google Analytics eCommerce tracking code upon successful orders', 'jigoshop'), 'desc' => __('<a href="//support.google.com/analytics/bin/answer.py?hl=en&answer=1009612" target="_TOP">Learn how to enable</a> eCommerce tracking for your Google Analytics account.', 'jigoshop'), 'id' => 'jigoshop_ga_ecommerce_tracking_enabled', 'type' => 'checkbox'), array('type' => 'tabend'), array('type' => 'tab', 'tabname' => __('Pages', 'jigoshop')), array('name' => __('Permalinks', 'jigoshop'), 'type' => 'title', 'desc' => '', 'id' => ''), array('name' => __('Prepend options', 'jigoshop'), 'desc' => __('Prepend shop categories / tags with base page', 'jigoshop'), 'tip' => __('This will only apply to tags &amp; categories.<br/>Enabled: http://yoursite.com / product_category / YourCategory<br/>Disabled: http://yoursite.com / base_page / product_category / YourCategory', 'jigoshop'), 'id' => 'jigoshop_prepend_shop_page_to_urls', 'std' => 'no', 'type' => 'checkbox'), array('desc' => __('Prepend product permalinks with shop base page', 'jigoshop'), 'id' => 'jigoshop_prepend_shop_page_to_product', 'std' => 'no', 'type' => 'checkbox'), array('desc' => __('Prepend product permalinks with product category', 'jigoshop'), 'id' => 'jigoshop_prepend_category_to_product', 'std' => 'no', 'type' => 'checkbox'), array('name' => __('Slug variables', 'jigoshop'), 'desc' => 'Product category slug', 'tip' => __('Slug displayed in product category URLs. Leave blank to use default "product-category"', 'jigoshop'), 'id' => 'jigoshop_product_category_slug', 'std' => 'product-category', 'css' => 'width:130px;', 'type' => 'text', 'group' => true), array('desc' => __('Product tag slug', 'jigoshop'), 'tip' => __('Slug displayed in product tag URLs. Leave blank to use default "product-tag"', 'jigoshop'), 'id' => 'jigoshop_product_tag_slug', 'std' => 'product-tag', 'css' => 'width:130px;', 'type' => 'text', 'group' => true), array('name' => __('Shop page configuration', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Cart Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_cart]</code>', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_cart_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('Checkout Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_checkout]</code>', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_checkout_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('Pay Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_pay]</code><br/>Default parent page: Checkout', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_pay_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('Thanks Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_thankyou]</code><br/>Default parent page: Checkout', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_thanks_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('My Account Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_my_account]</code>', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_myaccount_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('Edit Address Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_edit_address]</code><br/>Default parent page: My Account', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_edit_address_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('View Order Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_view_order]</code><br/>Default parent page: My Account', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_view_order_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('Change Password Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_change_password]</code><br/>Default parent page: My Account', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_change_password_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('Track Order Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_order_tracking]</code>', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_track_order_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('Terms Page', 'jigoshop'), 'desc' => __('If you define a &#34;Terms&#34; page the customer will be asked to accept it before allowing them to place their order.', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_terms_page_id', 'css' => 'min-width:50px;', 'std' => '', 'type' => 'single_select_page', 'args' => 'show_option_none=' . __('None', 'jigoshop')), array('type' => 'tabend'), array('type' => 'tab', 'tabname' => __('Catalog &amp; Pricing', 'jigoshop')), array('name' => __('Catalog Options', 'jigoshop'), 'type' => 'title', 'desc' => '', 'id' => ''), array('name' => __('Catalog base page', 'jigoshop'), 'desc' => '', 'tip' => __('This sets the base page of your shop. You should not change this value once you have launched your site otherwise you risk breaking urls of other sites pointing to yours, etc.', 'jigoshop'), 'id' => 'jigoshop_shop_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('Shop redirection page', 'jigoshop'), 'desc' => '', 'tip' => __('This will point users to the page you set for buttons like `Return to shop` or `Continue Shopping`.', 'jigoshop'), 'id' => 'jigoshop_shop_redirect_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => ''), array('name' => __('Sort products in catalog by', 'jigoshop'), 'desc' => '', 'tip' => __('Determines the display sort order of products for the Shop, Categories, and Tag pages.', 'jigoshop'), 'id' => 'jigoshop_catalog_sort_orderby', 'std' => 'post_date', 'type' => 'radio', 'options' => array('post_date' => __('Creation Date', 'jigoshop'), 'title' => __('Product Title', 'jigoshop'), 'menu_order' => __('Product Post Order', 'jigoshop'))), array('name' => __('Catalog sort direction', 'jigoshop'), 'desc' => '', 'tip' => __('Determines whether the catalog sort orderby is ascending or descending.', 'jigoshop'), 'id' => 'jigoshop_catalog_sort_direction', 'std' => 'asc', 'type' => 'radio', 'options' => array('asc' => __('Ascending', 'jigoshop'), 'desc' => __('Descending', 'jigoshop'))), array('name' => __('Catalog products display', 'jigoshop'), 'desc' => __('Per row', 'jigoshop'), 'tip' => __('Determines how many products to show on one display row for Shop, Category and Tag pages. Default = 3.', 'jigoshop'), 'id' => 'jigoshop_catalog_columns', 'css' => 'width:60px;', 'std' => '3', 'type' => 'number', 'restrict' => array('min' => 0), 'group' => true), array('desc' => __('Per page', 'jigoshop'), 'tip' => __('Determines how many products to display on Shop, Category and Tag pages before needing next and previous page navigation. Default = 12.', 'jigoshop'), 'id' => 'jigoshop_catalog_per_page', 'css' => 'width:60px;', 'std' => '12', 'type' => 'number', 'restrict' => array('min' => 0), 'group' => true), array('name' => __('Pricing Options', 'jigoshop'), 'type' => 'title', 'desc' => '', 'id' => ''), array('name' => __('Currency', 'jigoshop'), 'desc' => sprintf(__("This controls what currency prices are listed at in the catalog, and which currency PayPal, and other gateways, will take payments in. See the list of supported <a target='_new' href='%s'>PayPal currencies</a>.", 'jigoshop'), 'https://www.paypal.com/cgi-bin/webscr?cmd=p/sell/mc/mc_intro-outside'), 'tip' => '', 'id' => 'jigoshop_currency', 'css' => 'min-width:200px;', 'std' => 'GBP', 'type' => 'select', 'options' => apply_filters('jigoshop_currencies', array('AED' => __('United Arab Emirates dirham (&#1583;&#46;&#1573;)', 'jigoshop'), 'AUD' => __('Australian Dollar (&#36;)', 'jigoshop'), 'BRL' => __('Brazilian Real (&#82;&#36;)', 'jigoshop'), 'CAD' => __('Canadian Dollar (&#36;)', 'jigoshop'), 'CHF' => __('Swiss Franc (SFr.)', 'jigoshop'), 'CNY' => __('Chinese yuan (&#165;)', 'jigoshop'), 'CZK' => __('Czech Koruna (&#75;&#269;)', 'jigoshop'), 'DKK' => __('Danish Krone (kr)', 'jigoshop'), 'EUR' => __('Euro (&euro;)', 'jigoshop'), 'GBP' => __('Pounds Sterling (&pound;)', 'jigoshop'), 'HKD' => __('Hong Kong Dollar (&#36;)', 'jigoshop'), 'HRK' => __('Croatian Kuna (&#107;&#110;)', 'jigoshop'), 'HUF' => __('Hungarian Forint (&#70;&#116;)', 'jigoshop'), 'IDR' => __('Indonesia Rupiah (&#82;&#112;)', 'jigoshop'), 'ILS' => __('Israeli Shekel (&#8362;)', 'jigoshop'), 'INR' => __('Indian Rupee (&#8360;)', 'jigoshop'), 'JPY' => __('Japanese Yen (&yen;)', 'jigoshop'), 'MXN' => __('Mexican Peso (&#36;)', 'jigoshop'), 'MYR' => __('Malaysian Ringgits (RM)', 'jigoshop'), 'NGN' => __('Nigerian Naira (&#8358;)', 'jigoshop'), 'NOK' => __('Norwegian Krone (kr)', 'jigoshop'), 'NZD' => __('New Zealand Dollar (&#36;)', 'jigoshop'), 'PHP' => __('Philippine Pesos (&#8369;)', 'jigoshop'), 'PLN' => __('Polish Zloty (&#122;&#322;)', 'jigoshop'), 'RON' => __('Romanian New Leu (&#108;&#101;&#105;)', 'jigoshop'), 'RUB' => __('Russian Ruble (&#1088;&#1091;&#1073;)', 'jigoshop'), 'SEK' => __('Swedish Krona (kr)', 'jigoshop'), 'SGD' => __('Singapore Dollar (&#36;)', 'jigoshop'), 'THB' => __('Thai Baht (&#3647;)', 'jigoshop'), 'TRY' => __('Turkish Lira (&#8356;)', 'jigoshop'), 'TWD' => __('Taiwan New Dollar (&#36;)', 'jigoshop'), 'USD' => __('US Dollar (&#36;)', 'jigoshop'), 'ZAR' => __('South African rand (R)', 'jigoshop')))), array('name' => __('Currency display', 'jigoshop'), 'desc' => __("This controls the display of the currency symbol and currency code.", 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_currency_pos', 'css' => 'min-width:200px;', 'std' => 'left', 'type' => 'select', 'options' => array('left' => __(get_jigoshop_currency_symbol() . '0' . get_option('jigoshop_price_decimal_sep') . '00', 'jigoshop'), 'left_space' => __(get_jigoshop_currency_symbol() . ' 0' . get_option('jigoshop_price_decimal_sep') . '00', 'jigoshop'), 'right' => __('0' . get_option('jigoshop_price_decimal_sep') . '00' . get_jigoshop_currency_symbol(), 'jigoshop'), 'right_space' => __('0' . get_option('jigoshop_price_decimal_sep') . '00 ' . get_jigoshop_currency_symbol(), 'jigoshop'), 'left_code' => __(get_option('jigoshop_currency') . '0' . get_option('jigoshop_price_decimal_sep') . '00', 'jigoshop'), 'left_code_space' => __(get_option('jigoshop_currency') . ' 0' . get_option('jigoshop_price_decimal_sep') . '00', 'jigoshop'), 'right_code' => __('0' . get_option('jigoshop_price_decimal_sep') . '00' . get_option('jigoshop_currency'), 'jigoshop'), 'right_code_space' => __('0' . get_option('jigoshop_price_decimal_sep') . '00 ' . get_option('jigoshop_currency'), 'jigoshop'), 'symbol_code' => __(get_jigoshop_currency_symbol() . '0' . get_option('jigoshop_price_decimal_sep') . '00' . get_option('jigoshop_currency'), 'jigoshop'), 'symbol_code_space' => __(get_jigoshop_currency_symbol() . ' 0' . get_option('jigoshop_price_decimal_sep') . '00 ' . get_option('jigoshop_currency'), 'jigoshop'), 'code_symbol' => __(get_option('jigoshop_currency') . '0' . get_option('jigoshop_price_decimal_sep') . '00' . get_jigoshop_currency_symbol(), 'jigoshop'), 'code_symbol_space' => __(get_option('jigoshop_currency') . ' 0' . get_option('jigoshop_price_decimal_sep') . '00 ' . get_jigoshop_currency_symbol(), 'jigoshop'))), array('name' => __('Price Separators', 'jigoshop'), 'desc' => __('Thousand separator', 'jigoshop'), 'id' => 'jigoshop_price_thousand_sep', 'css' => 'width:30px;', 'std' => ',', 'type' => 'text', 'group' => true), array('desc' => __('Decimal separator', 'jigoshop'), 'id' => 'jigoshop_price_decimal_sep', 'css' => 'width:30px;', 'std' => '.', 'type' => 'text', 'group' => true), array('desc' => __('Number of decimals', 'jigoshop'), 'id' => 'jigoshop_price_num_decimals', 'css' => 'width:30px;', 'std' => '2', 'type' => 'number', 'restrict' => array('min' => 0), 'group' => true), array('type' => 'tabend'), array('type' => 'tab', 'tabname' => __('Images', 'jigoshop')), array('name' => __('Image Options', 'jigoshop'), 'type' => 'title', 'desc' => sprintf(__('<p>Changing any of these settings will affect the dimensions of images used in your Shop. After changing these settings you may need to <a href="%s">regenerate your thumbnails</a>.</p>
																										<p>Crop: Leave unchecked to set the image size by resizing the image proportionally (that is, without distorting it). Leave checked to set the image size by hard cropping the image (either from the sides, or from the top and bottom).</p>
																										<p><strong>Note:</strong> Your images may not display in the size you choose below. This is because they may still be affected by CSS styles, that is, your theme.', 'jigoshop'), 'http://wordpress.org/extend/plugins/regenerate-thumbnails/'), 'id' => ''), array('name' => __('Tiny Images', 'jigoshop'), 'desc' => __('Cart, Checkout, Orders and Widgets', 'jigoshop'), 'id' => 'jigoshop_shop_tiny', 'type' => 'image_size', 'std' => 36, 'placeholder' => 36), array('name' => __('Thumbnail Images', 'jigoshop'), 'desc' => __('Single Product page extra images.', 'jigoshop'), 'id' => 'jigoshop_shop_thumbnail', 'type' => 'image_size', 'std' => 90, 'placeholder' => 90), array('name' => __('Catalog Images', 'jigoshop'), 'desc' => __('Shop, Categories, Tags, and Related Products.', 'jigoshop'), 'id' => 'jigoshop_shop_small', 'type' => 'image_size', 'std' => 150, 'placeholder' => 150), array('name' => __('Large Images', 'jigoshop'), 'desc' => __('Single Product pages', 'jigoshop'), 'id' => 'jigoshop_shop_large', 'type' => 'image_size', 'std' => 300, 'placeholder' => 300), array('type' => 'tabend'), array('type' => 'tab', 'tabname' => __('Coupons', 'jigoshop')), array('name' => __('Coupon Information', 'jigoshop'), 'type' => 'title', 'desc' => __('<div>Coupons allow you to give your customers special offers and discounts. </div>', 'jigoshop')), array('name' => __('Coupons', 'jigoshop'), 'desc' => __('All fields are required.', 'jigoshop'), 'id' => 'jigoshop_coupons', 'css' => 'min-width:50px;', 'type' => 'coupons', 'std' => ''), array('type' => 'tabend'), array('type' => 'tab', 'tabname' => __('Products &amp; Inventory', 'jigoshop')), array('name' => __('Product Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Product fields', 'jigoshop'), 'desc' => __('Enable SKU', 'jigoshop'), 'tip' => __('Turning off the SKU field will give products an SKU of their post id.', 'jigoshop'), 'id' => 'jigoshop_enable_sku', 'std' => 'no', 'type' => 'checkbox'), array('desc' => __('Enable weight', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_enable_weight', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Enable product dimensions', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_enable_dimensions', 'std' => 'yes', 'type' => 'checkbox'), array('name' => __('Weight Unit', 'jigoshop'), 'tip' => __("This controls what unit you will define weights in.", 'jigoshop'), 'id' => 'jigoshop_weight_unit', 'std' => 'kg', 'type' => 'radio', 'options' => array('kg' => __('Kilograms', 'jigoshop'), 'lbs' => __('Pounds', 'jigoshop'))), array('name' => __('Dimensions Unit', 'jigoshop'), 'tip' => __("This controls what unit you will define dimensions in.", 'jigoshop'), 'id' => 'jigoshop_dimension_unit', 'std' => 'cm', 'type' => 'radio', 'options' => array('cm' => __('centimeters', 'jigoshop'), 'in' => __('inches', 'jigoshop'))), array('name' => __('Show related products', 'jigoshop'), 'desc' => '', 'tip' => __('To show or hide the related products section on a single product page.', 'jigoshop'), 'id' => 'jigoshop_enable_related_products', 'std' => 'yes', 'type' => 'checkbox'), array('name' => __('Inventory Options', 'jigoshop'), 'type' => 'title', 'desc' => '', 'id' => ''), array('name' => __('General inventory options', 'jigoshop'), 'desc' => __('Enable product stock', 'jigoshop'), 'tip' => __('If you are not managing stock, turn it off here to disable it in admin and on the front-end. You can manage stock on a per-item basis if you leave this option on.', 'jigoshop'), 'id' => 'jigoshop_manage_stock', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Show stock amounts', 'jigoshop'), 'tip' => __('Set to yes to allow customers to view the amount of stock available for a product.', 'jigoshop'), 'id' => 'jigoshop_show_stock', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Hide out of stock products', 'jigoshop'), 'tip' => 'When enabled: When the Out of Stock Threshold (above) is reached, the product visibility will be set to hidden so that it will not appear on the Catalog or Shop product lists.', 'id' => 'jigoshop_hide_no_stock_product', 'std' => 'no', 'type' => 'checkbox'), array('name' => __('Notifications', 'jigoshop'), 'desc' => __('Notify on low stock', 'jigoshop'), 'id' => 'jigoshop_notify_low_stock', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Low stock threshold', 'jigoshop'), 'tip' => __('You will receive a notification as soon this threshold is hit (if notifications are turned on).', 'jigoshop'), 'id' => 'jigoshop_notify_low_stock_amount', 'css' => 'width:50px;', 'type' => 'number', 'restrict' => array('min' => 0), 'std' => '2', 'group' => true), array('desc' => __('Notify on out of stock', 'jigoshop'), 'id' => 'jigoshop_notify_no_stock', 'std' => 'yes', 'type' => 'checkbox', 'group' => true), array('desc' => __('Out of stock threshold', 'jigoshop'), 'tip' => __('You will receive a notification as soon this threshold is hit (if notifications are turned on).', 'jigoshop'), 'id' => 'jigoshop_notify_no_stock_amount', 'css' => 'width:50px;', 'type' => 'number', 'restrict' => array('min' => 0), 'std' => '0', 'group' => true), array('type' => 'tabend'), array('type' => 'tab', 'tabname' => __('Shipping', 'jigoshop')), array('name' => __('Shipping Options', 'jigoshop'), 'type' => 'title', 'desc' => '', 'id' => ''), array('name' => __('General shipping settings', 'jigoshop'), 'desc' => __('Calculate shipping', 'jigoshop'), 'tip' => __('Only set this to no if you are not shipping items, or items have shipping costs included. If you are not calculating shipping then you can ignore all other tax options.', 'jigoshop'), 'id' => 'jigoshop_calc_shipping', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Enable shipping calculator on cart', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_enable_shipping_calc', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Only ship to billing address?', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_ship_to_billing_address_only', 'std' => 'no', 'type' => 'checkbox'), array('type' => 'shipping_options'), array('type' => 'tabend'), array('type' => 'tab', 'tabname' => __('Tax', 'jigoshop')), array('name' => __('Tax Options', 'jigoshop'), 'type' => 'title', 'desc' => '', 'id' => ''), array('name' => __('General tax options', 'jigoshop'), 'desc' => __('Enable tax calculation', 'jigoshop'), 'tip' => __('Only disable this if you are exclusively selling non-taxable items. If you are not calculating taxes then you can ignore all other tax options.', 'jigoshop'), 'id' => 'jigoshop_calc_taxes', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Apply Taxes After Coupon', 'jigoshop'), 'tip' => __('If yes, taxes get applied after coupons. When no, taxes get applied before coupons.', 'jigoshop'), 'id' => 'jigoshop_tax_after_coupon', 'std' => 'yes', 'type' => 'checkbox'), array('desc' => __('Catalog Prices include tax?', 'jigoshop'), 'tip' => __('If prices include tax then tax calculations will work backwards.', 'jigoshop'), 'id' => 'jigoshop_prices_include_tax', 'std' => 'yes', 'type' => 'checkbox'), array('name' => __('Cart total displays', 'jigoshop'), 'desc' => '', 'tip' => __('Should the subtotal be shown including or excluding tax on the frontend?', 'jigoshop'), 'id' => 'jigoshop_display_totals_tax', 'std' => 'excluding', 'type' => 'radio', 'options' => array('including' => __('price including tax', 'jigoshop'), 'excluding' => __('price excluding tax', 'jigoshop'))), array('name' => __('Additional Tax classes', 'jigoshop'), 'desc' => __('List 1 per line. This is in addition to the default <em>Standard Rate</em>.', 'jigoshop'), 'tip' => __('List product and shipping tax classes here, e.g. Zero Tax, Reduced Rate.', 'jigoshop'), 'id' => 'jigoshop_tax_classes', 'css' => 'width:100%; height: 75px;', 'type' => 'textarea', 'std' => sprintf(__('Reduced Rate%sZero Rate', 'jigoshop'), PHP_EOL)), array('name' => __('Tax rates', 'jigoshop'), 'desc' => __('All fields are required.', 'jigoshop'), 'tip' => __('To avoid rounding errors, insert tax rates with 4 decimal places.', 'jigoshop'), 'id' => 'jigoshop_tax_rates', 'css' => 'min-width:50px;', 'type' => 'tax_rates', 'std' => ''), array('type' => 'tabend'), array('type' => 'tab', 'tabname' => __('Payment Gateways', 'jigoshop')), array('type' => 'gateway_options'), array('type' => 'tabend')));
Example #8
0
    function nav_menu_meta_box()
    {
        ?>

	<div class="prices">        
		<input type="hidden" name="jigoshop_currency" id="jigoshop_currency" value="<?php 
        echo get_jigoshop_currency_symbol(get_option('jigoshop_currency'));
        ?>
" />
		<input type="hidden" name="jigoshop_shop_url" id="jigoshop_shop_url" value="<?php 
        echo get_option('permalink_structure') == '' ? site_url() . '/?post_type=product' : get_permalink(get_option('jigoshop_shop_page_id'));
        ?>
" />
		<input type="hidden" name="menu-item[-1][menu-item-url]" value="" />
		<input type="hidden" name="menu-item[-1][menu-item-title]" value="" />
		<input type="hidden" name="menu-item[-1][menu-item-type]" value="custom" />
		
		<p>
		    <?php 
        _e(sprintf('The values are already expressed in %s', get_jigoshop_currency_symbol(get_option('jigoshop_currency'))), 'yiw');
        ?>

		</p>
		
		<p>
			<label class="howto" for="prices_filter_from">
				<span><?php 
        _e('From');
        ?>
</span>
				<input id="prices_filter_from" name="prices_filter_from" type="text" class="regular-text menu-item-textbox input-with-default-title" title="<?php 
        esc_attr_e('From');
        ?>
" />
			</label>
		</p>

		<p style="display: block; margin: 1em 0; clear: both;">
			<label class="howto" for="prices_filter_to">
				<span><?php 
        _e('To');
        ?>
</span>
				<input id="prices_filter_to" name="prices_filter_to" type="text" class="regular-text menu-item-textbox input-with-default-title" title="<?php 
        esc_attr_e('To');
        ?>
" />
			</label>
		</p>

		<p class="button-controls">
			<span class="add-to-menu">
				<img class="waiting" src="<?php 
        echo esc_url(admin_url('images/wpspin_light.gif'));
        ?>
" alt="" />
				<input type="submit" class="button-secondary submit-add-to-menu" value="<?php 
        esc_attr_e('Add to Menu');
        ?>
" name="add-custom-menu-item" />
			</span>
		</p>

	</div>
<?php 
    }
Example #9
0
 /**
  * Return currency tooltip JS based on jigoshop currency position settings.
  *
  * @return string
  */
 public function get_currency_tooltip()
 {
     $options = Jigoshop_Base::get_options();
     switch ($options->get('jigoshop_currency_pos')) {
         case 'right':
             $currency_tooltip = 'append_tooltip: "' . get_jigoshop_currency_symbol() . '"';
             break;
         case 'right_space':
             $currency_tooltip = 'append_tooltip: "&nbsp;' . get_jigoshop_currency_symbol() . '"';
             break;
         case 'left':
             $currency_tooltip = 'prepend_tooltip: "' . get_jigoshop_currency_symbol() . '"';
             break;
         case 'left_space':
         default:
             $currency_tooltip = 'prepend_tooltip: "' . get_jigoshop_currency_symbol() . '&nbsp;"';
             break;
     }
     return $currency_tooltip;
 }
 /**
  * Sets the Jigoshop default options
  *
  * This will create the default options array. Extensions may install options of the same format into this.
  *
  * @param   none
  * @return  Void
  *
  * @since	1.3
  *
  */
 private function set_default_options()
 {
     $symbols = jigoshop::currency_symbols();
     $countries = jigoshop::currency_countries();
     $currencies = array();
     foreach ($countries as $key => $country) {
         $currencies[$key] = $country . ' (' . $symbols[$key] . ')';
     }
     $currencies = apply_filters('jigoshop_currencies', $currencies);
     $cSymbol = '';
     if (function_exists('get_jigoshop_currency_symbol')) {
         $cSymbol = get_jigoshop_currency_symbol();
     }
     $cCode = $this->get('jigoshop_currency') ? $this->get('jigoshop_currency') : 'GBP';
     $cSep = $this->get('jigoshop_price_decimal_sep') ? $this->get('jigoshop_price_decimal_sep') : '.';
     self::$default_options = array(array('type' => 'tab', 'name' => __('Shop', 'jigoshop')), array('name' => __('Shop Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Base Country/Region', 'jigoshop'), 'desc' => '', 'tip' => __('This is the base country for your business. Tax rates will be based on this country.', 'jigoshop'), 'id' => 'jigoshop_default_country', 'type' => 'single_select_country'), array('name' => __('Default Country/Region for customer', 'jigoshop'), 'desc' => '', 'tip' => __('This is the country for your clients with new accounts.', 'jigoshop'), 'id' => 'jigoshop_default_country_for_customer', 'std' => $this->get('jigoshop_default_country'), 'type' => 'single_select_country', 'options' => array('add_empty' => true)), array('name' => __('Currency', 'jigoshop'), 'desc' => '', 'tip' => __('This controls what currency the prices are listed with in the Catalog, and which currency PayPal, and other gateways, will take payments in.', 'jigoshop'), 'id' => 'jigoshop_currency', 'type' => 'select', 'choices' => $currencies), array('name' => __('Allowed Countries', 'jigoshop'), 'desc' => '', 'tip' => __('These are countries that you are willing to ship to.', 'jigoshop'), 'id' => 'jigoshop_allowed_countries', 'type' => 'select', 'choices' => array('all' => __('All Countries', 'jigoshop'), 'specific' => __('Specific Countries', 'jigoshop'))), array('name' => __('Specific Countries', 'jigoshop'), 'desc' => '', 'tip' => '', 'id' => 'jigoshop_specific_allowed_countries', 'type' => 'multi_select_countries'), array('name' => __('Demo store', 'jigoshop'), 'desc' => '', 'tip' => __('Enable this option to show a banner at the top of every page stating this shop is currently in testing mode.', 'jigoshop'), 'id' => 'jigoshop_demo_store', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Invoicing', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Company Name', 'jigoshop'), 'desc' => '', 'tip' => __('Setting your company name will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_company_name', 'type' => 'text'), array('name' => __('Tax Registration Number', 'jigoshop'), 'desc' => __('Add your tax registration label before the registration number and it will be printed as well. eg. <code>VAT Number: 88888888</code>', 'jigoshop'), 'tip' => __('Setting your tax number will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_tax_number', 'type' => 'text'), array('name' => __('Address Line1', 'jigoshop'), 'desc' => '', 'tip' => __('Setting your address will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_address_1', 'type' => 'longtext'), array('name' => __('Address Line2', 'jigoshop'), 'desc' => '', 'tip' => __('If address line1 is not set, address line2 will not display even if you put a value in it. Setting your address will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_address_2', 'type' => 'longtext'), array('name' => __('Company Phone', 'jigoshop'), 'desc' => '', 'tip' => __('Setting your company phone number will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_company_phone', 'type' => 'text'), array('name' => __('Company Email', 'jigoshop'), 'desc' => '', 'tip' => __('Setting your company email will enable us to print it out on your invoice emails. Leave blank to disable.', 'jigoshop'), 'id' => 'jigoshop_company_email', 'type' => 'email'), array('name' => __('Permalinks', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Prepend shop categories and tags with base page', 'jigoshop'), 'desc' => '', 'tip' => __('This will only apply to tags &amp; categories.<br/>Enabled: http://yoursite.com / product_category / YourCategory<br/>Disabled: http://yoursite.com / base_page / product_category / YourCategory', 'jigoshop'), 'id' => 'jigoshop_prepend_shop_page_to_urls', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Prepend product permalinks with shop base page', 'jigoshop'), 'desc' => '', 'tip' => '', 'id' => 'jigoshop_prepend_shop_page_to_product', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Prepend product permalinks with product category', 'jigoshop'), 'desc' => '', 'tip' => '', 'id' => 'jigoshop_prepend_category_to_product', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Product category slug', 'jigoshop'), 'desc' => '', 'tip' => __('Slug displayed in product category URLs. Leave blank to use default "product-category"', 'jigoshop'), 'id' => 'jigoshop_product_category_slug', 'type' => 'text'), array('name' => __('Product tag slug', 'jigoshop'), 'desc' => '', 'tip' => __('Slug displayed in product tag URLs. Leave blank to use default "product-tag"', 'jigoshop'), 'id' => 'jigoshop_product_tag_slug', 'type' => 'text'), array('type' => 'tab', 'name' => __('General', 'jigoshop')), array('name' => __('General Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Cart shows "Return to Shop" button', 'jigoshop'), 'desc' => '', 'tip' => __('Enabling this setting will display a "Return to Shop" button on the Cart page along with the "Continue to Checkout" button.', 'jigoshop'), 'id' => 'jigoshop_cart_shows_shop_button', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('After adding product to cart', 'jigoshop'), 'desc' => '', 'tip' => __('Define what should happen when a user clicks on &#34;Add to Cart&#34; on any product or page.', 'jigoshop'), 'id' => 'jigoshop_redirect_add_to_cart', 'type' => 'radio', 'extra' => array('vertical'), 'choices' => array('same_page' => __('Stay on the same page', 'jigoshop'), 'to_checkout' => __('Redirect to Checkout', 'jigoshop'), 'to_cart' => __('Redirect to Cart', 'jigoshop'))), array('name' => __('Cart status after login', 'jigoshop'), 'desc' => __('Current cart <b>always</b> will be loaded if customer logs in checkout page.', 'jigoshop'), 'tip' => __("Define what should happen with shopping cart if customer added items to shopping cart as guest and than he logs in to your shop.", 'jigoshop'), 'id' => 'jigoshop_cart_after_login', 'type' => 'select', 'choices' => array('load_saved' => __('Load saved cart', 'jigoshop'), 'load_current' => __('Load current cart', 'jigoshop'), 'merge' => __('Merge saved and current carts', 'jigoshop'))), array('name' => __('Reset pending Orders', 'jigoshop'), 'desc' => __("Change all 'Pending' Orders older than one month to 'On Hold'", 'jigoshop'), 'tip' => __("For customers that have not completed the Checkout process or haven't paid for an Order after a period of time, this will reset the Order to On Hold allowing the Shop owner to take action.  WARNING: For the first use on an existing Shop this setting <em>can</em> generate a <strong>lot</strong> of email!", 'jigoshop'), 'id' => 'jigoshop_reset_pending_orders', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Complete processing Orders', 'jigoshop'), 'desc' => __("Change all 'Processing' Orders older than one month to 'Completed'", 'jigoshop'), 'tip' => __("For orders that have been completed but the status is still set to 'processing'.  This will move them to a 'completed' status without sending an email out to all the customers.", 'jigoshop'), 'id' => 'jigoshop_complete_processing_orders', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Enforce login for downloads', 'jigoshop'), 'desc' => '', 'tip' => __('If a guest purchases a download, the guest can still download a link without logging in. We recommend disabling guest purchases if you enable this option.', 'jigoshop'), 'id' => 'jigoshop_downloads_require_login', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Disable Jigoshop frontend.css', 'jigoshop'), 'desc' => __('(The next option below will have no effect if this one is disabled)', 'jigoshop'), 'tip' => __('Useful if you want to disable Jigoshop styles and theme it yourself via your theme.', 'jigoshop'), 'id' => 'jigoshop_disable_css', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Include extra theme styles with Jigoshop frontend.css', 'jigoshop'), 'desc' => '', 'tip' => __("With this option <em>on</em>, Jigoshop's default frontend.css will still load, and any extra bits found in 'theme/jigoshop/style.css' for over-rides will also be loaded.", 'jigoshop'), 'id' => 'jigoshop_frontend_with_theme_css', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Disable bundled Lightbox', 'jigoshop'), 'desc' => __('Product galleries and images as well as the Add Review form will open in a lightbox.', 'jigoshop'), 'tip' => __('Useful if your theme or other plugin already loads our Lightbox script and css (prettyPhoto), or you want to use a different one.', 'jigoshop'), 'id' => 'jigoshop_disable_fancybox', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Use custom product category order', 'jigoshop'), 'desc' => '', 'tip' => __('This option allows to make custom product category order, by drag and drop method.', 'jigoshop'), 'id' => 'jigoshop_enable_draggable_categories', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Jigoshop messages', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Message disappear time', 'jigoshop'), 'desc' => __('How long message is displayed before disappearing (in ms). Set to 0 to keep it displayed.', 'jigoshop'), 'id' => 'jigoshop_message_disappear_time', 'type' => 'natural'), array('name' => __('Error disappear time', 'jigoshop'), 'desc' => __('How long error is displayed before disappearing (in ms). Set to 0 to keep it displayed.', 'jigoshop'), 'id' => 'jigoshop_error_disappear_time', 'type' => 'natural'), array('name' => __('Email Details', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Jigoshop email address', 'jigoshop'), 'desc' => '', 'tip' => __('The email address used to send all Jigoshop related emails, such as order confirmations and notices.  This may be different than your Company email address on "Shop Tab -> Invoicing".', 'jigoshop'), 'id' => 'jigoshop_email', 'type' => 'email'), array('name' => __('Email from name', 'jigoshop'), 'desc' => '', 'tip' => __('', 'jigoshop'), 'id' => 'jigoshop_email_from_name', 'type' => 'text'), array('name' => __('Email footer', 'jigoshop'), 'desc' => '', 'tip' => __('The email footer used in all jigoshop emails.', 'jigoshop'), 'id' => 'jigoshop_email_footer', 'type' => 'textarea'), array('name' => __('Use HTML emails', 'jigoshop'), 'desc' => '', 'tip' => __('This option enables HTML email templates.', 'jigoshop'), 'id' => 'jigoshop_enable_html_emails', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Generate default emails', 'jigoshop'), 'desc' => '', 'tip' => '', 'id' => 'jigoshop_email_generete_defaults', 'type' => 'user_defined', 'display' => array($this, 'generate_defaults_emails')), array('name' => __('Checkout page', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Validate postal/zip codes', 'jigoshop'), 'desc' => '', 'tip' => __('Enabling this setting will force proper postcodes to be entered by a customer for a country.', 'jigoshop'), 'id' => 'jigoshop_enable_postcode_validating', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Show verify information message', 'jigoshop'), 'desc' => '', 'tip' => __('Enabling this setting will display a message at the bottom of the Checkout asking customers to verify all their informatioin is correctly entered before placing their Order.  This is useful in particular for Countries that have states to ensure the correct shipping state is selected.', 'jigoshop'), 'id' => 'jigoshop_verify_checkout_info_message', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Show EU VAT reduction message', 'jigoshop'), 'desc' => __('This will only apply to EU Union based Shops.', 'jigoshop'), 'tip' => __('Enabling this setting will display a message at the bottom of the Checkout informing the customer that EU VAT will not be removed until the Order is placed and only if they have provided a valid EU VAT Number.', 'jigoshop'), 'id' => 'jigoshop_eu_vat_reduction_message', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Allow guest purchases', 'jigoshop'), 'desc' => '', 'tip' => __('Enabling this setting will allow users to checkout without registering or signing up. Otherwise, users must be signed in or must sign up to checkout.', 'jigoshop'), 'id' => 'jigoshop_enable_guest_checkout', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Show login form', 'jigoshop'), 'desc' => '', 'id' => 'jigoshop_enable_guest_login', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Allow registration', 'jigoshop'), 'desc' => '', 'id' => 'jigoshop_enable_signup_form', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Force SSL on checkout', 'jigoshop'), 'desc' => '', 'tip' => __('This will load your checkout page with https://. An SSL certificate is <strong>required</strong> if you choose yes. Contact your hosting provider for more information on SSL Certs.', 'jigoshop'), 'id' => 'jigoshop_force_ssl_checkout', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Integration', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('ShareThis Publisher ID', 'jigoshop'), 'desc' => __("Enter your <a href='http://sharethis.com/account/'>ShareThis publisher ID</a> to show ShareThis on product pages.", 'jigoshop'), 'tip' => __('ShareThis is a small social sharing widget for posting links on popular sites such as Twitter and Facebook.', 'jigoshop'), 'id' => 'jigoshop_sharethis', 'type' => 'text'), array('name' => __('Google Analytics ID', 'jigoshop'), 'desc' => __('Log into your Google Analytics account to find your ID. e.g. <code>UA-XXXXXXX-X</code>', 'jigoshop'), 'id' => 'jigoshop_ga_id', 'type' => 'text'), array('name' => __('Enable eCommerce Tracking', 'jigoshop'), 'tip' => __('Add Google Analytics eCommerce tracking code upon successful orders', 'jigoshop'), 'desc' => __('<a href="//support.google.com/analytics/bin/answer.py?hl=en&answer=1009612">Learn how to enable</a> eCommerce tracking for your Google Analytics account.', 'jigoshop'), 'id' => 'jigoshop_ga_ecommerce_tracking_enabled', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('type' => 'tab', 'name' => __('Pages', 'jigoshop')), array('name' => __('Page configurations', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Cart Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_cart]</code>', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_cart_page_id', 'type' => 'single_select_page'), array('name' => __('Checkout Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_checkout]</code>', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_checkout_page_id', 'type' => 'single_select_page'), array('name' => __('Pay Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_pay]</code><br/>Default parent page: Checkout', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_pay_page_id', 'type' => 'single_select_page'), array('name' => __('Thanks Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_thankyou]</code><br/>Default parent page: Checkout', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_thanks_page_id', 'type' => 'single_select_page'), array('name' => __('My Account Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_my_account]</code>', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_myaccount_page_id', 'type' => 'single_select_page'), array('name' => __('Edit Address Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_edit_address]</code><br/>Default parent page: My Account', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_edit_address_page_id', 'type' => 'single_select_page'), array('name' => __('View Order Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_view_order]</code><br/>Default parent page: My Account', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_view_order_page_id', 'type' => 'single_select_page'), array('name' => __('Change Password Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_change_password]</code><br/>Default parent page: My Account', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_change_password_page_id', 'type' => 'single_select_page'), array('name' => __('Track Order Page', 'jigoshop'), 'desc' => __('Shortcode to place on page: <code>[jigoshop_order_tracking]</code>', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_track_order_page_id', 'type' => 'single_select_page'), array('name' => __('Terms Page', 'jigoshop'), 'desc' => __('If you define a &#34;Terms&#34; page the customer will be asked to accept it before allowing them to place their order.', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_terms_page_id', 'type' => 'single_select_page', 'extra' => 'show_option_none=' . __('None', 'jigoshop')), array('type' => 'tab', 'name' => __('Catalog &amp; Pricing', 'jigoshop')), array('name' => __('Catalog Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Catalog base page', 'jigoshop'), 'desc' => '', 'tip' => __('This sets the base page of your shop. You should not change this value once you have launched your site otherwise you risk breaking urls of other sites pointing to yours, etc.', 'jigoshop'), 'id' => 'jigoshop_shop_page_id', 'type' => 'single_select_page'), array('name' => __('Shop redirection page', 'jigoshop'), 'desc' => '', 'tip' => __('This will point users to the page you set for buttons like `Return to shop` or `Continue Shopping`.', 'jigoshop'), 'id' => 'jigoshop_shop_redirect_page_id', 'type' => 'single_select_page'), array('name' => __('Catalog product buttons show', 'jigoshop'), 'desc' => '', 'tip' => __('This will determine the type of button and the action it will use when clicked on the Shop and Category product listings.  You can also set it to use no button.', 'jigoshop'), 'id' => 'jigoshop_catalog_product_button', 'type' => 'radio', 'choices' => array('add' => __('Add to Cart', 'jigoshop'), 'view' => __('View Product', 'jigoshop'), 'none' => __('No Button', 'jigoshop'))), array('name' => __('Sort products in catalog by', 'jigoshop'), 'desc' => '', 'tip' => __('Determines the display sort order of products for the Shop, Categories, and Tag pages.', 'jigoshop'), 'id' => 'jigoshop_catalog_sort_orderby', 'type' => 'radio', 'choices' => array('post_date' => __('Creation Date', 'jigoshop'), 'title' => __('Product Title', 'jigoshop'), 'menu_order' => __('Product Post Order', 'jigoshop'))), array('name' => __('Catalog sort direction', 'jigoshop'), 'desc' => '', 'tip' => __('Determines whether the catalog sort orderby is ascending or descending.', 'jigoshop'), 'id' => 'jigoshop_catalog_sort_direction', 'type' => 'radio', 'choices' => array('asc' => __('Ascending', 'jigoshop'), 'desc' => __('Descending', 'jigoshop'))), array('name' => __('Catalog products per row', 'jigoshop'), 'desc' => __('Default = 3', 'jigoshop'), 'tip' => __('Determines how many products to show on one display row for Shop, Category and Tag pages.', 'jigoshop'), 'id' => 'jigoshop_catalog_columns', 'type' => 'number', 'extra' => array('min' => 1, 'max' => 10, 'step' => 1)), array('name' => __('Catalog products per page', 'jigoshop'), 'desc' => __('Default = 12', 'jigoshop'), 'tip' => __('Determines how many products to display on Shop, Category and Tag pages before needing next and previous page navigation.', 'jigoshop'), 'id' => 'jigoshop_catalog_per_page', 'type' => 'number', 'extra' => array('min' => 1, 'max' => 100, 'step' => 1)), array('name' => __('Pricing Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Show prices with tax', 'jigoshop'), 'desc' => __("This controls the display of the product price in cart and checkout page.", 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_show_prices_with_tax', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Currency display', 'jigoshop'), 'desc' => __("This controls the display of the currency symbol and currency code.", 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_currency_pos', 'type' => 'select', 'choices' => array('left' => sprintf('%1$s0%2$s00', $cSymbol, $cSep), 'left_space' => sprintf('%1$s0 %2$s00', $cSymbol, $cSep), 'right' => sprintf('0%2$s00%1$s', $cSymbol, $cSep), 'right_space' => sprintf('0%2$s00 %1$s', $cSymbol, $cSep), 'left_code' => sprintf('%1$s0%2$s00', $cCode, $cSep), 'left_code_space' => sprintf('%1$s 0%2$s00', $cCode, $cSep), 'right_code' => sprintf('0%2$s00%1$s', $cCode, $cSep), 'right_code_space' => sprintf('0%2$s00 %1$s', $cCode, $cSep), 'symbol_code' => sprintf('%1$s0%2$s00%3$s', $cSymbol, $cSep, $cCode), 'symbol_code_space' => sprintf('%1$s 0%2$s00 %3$s', $cSymbol, $cSep, $cCode), 'code_symbol' => sprintf('%3$s0%2$s00%1$s', $cSymbol, $cSep, $cCode), 'code_symbol_space' => sprintf('%3$s 0%2$s00 %1$s', $cSymbol, $cSep, $cCode))), array('name' => __('Thousand separator', 'jigoshop'), 'desc' => __('This sets the thousand separator of displayed prices.', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_price_thousand_sep', 'type' => 'text'), array('name' => __('Decimal separator', 'jigoshop'), 'desc' => __('This sets the decimal separator of displayed prices.', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_price_decimal_sep', 'type' => 'text'), array('name' => __('Number of decimals', 'jigoshop'), 'desc' => __('This sets the number of decimal points shown in displayed prices.', 'jigoshop'), 'tip' => '', 'id' => 'jigoshop_price_num_decimals', 'type' => 'natural'), array('type' => 'tab', 'name' => __('Images', 'jigoshop')), array('name' => __('Image Options', 'jigoshop'), 'type' => 'title', 'desc' => sprintf(__('<p>Changing any of these settings will affect the dimensions of images used in your Shop. After changing these settings you may need to <a href="%s">regenerate your thumbnails</a>.</p><p>Crop: Leave unchecked to set the image size by resizing the image proportionally (that is, without distorting it). Leave checked to set the image size by hard cropping the image (either from the sides, or from the top and bottom).</p><p><strong>Note:</strong> Your images may not display in the size you choose below. This is because they may still be affected by CSS styles in your theme.', 'jigoshop'), 'https://wordpress.org/plugins/regenerate-thumbnails/')), array('name' => __('Cropping Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Crop Tiny images', 'jigoshop'), 'desc' => '', 'tip' => __('Use No to set the image size by resizing the image proportionally (that is, without distorting it).<br />Use Yes to set the image size by hard cropping the image (either from the sides, or from the top and bottom).', 'jigoshop'), 'id' => 'jigoshop_use_wordpress_tiny_crop', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Crop Thumbnail images', 'jigoshop'), 'desc' => '', 'tip' => __('Use No to set the image size by resizing the image proportionally (that is, without distorting it).<br />Use Yes to set the image size by hard cropping the image (either from the sides, or from the top and bottom).', 'jigoshop'), 'id' => 'jigoshop_use_wordpress_thumbnail_crop', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Crop Catalog images', 'jigoshop'), 'desc' => '', 'tip' => __('Use No to set the image size by resizing the image proportionally (that is, without distorting it).<br />Use Yes to set the image size by hard cropping the image (either from the sides, or from the top and bottom).', 'jigoshop'), 'id' => 'jigoshop_use_wordpress_catalog_crop', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Crop Large images', 'jigoshop'), 'desc' => '', 'tip' => __('Use No to set the image size by resizing the image proportionally (that is, without distorting it).<br />Use Yes to set the image size by hard cropping the image (either from the sides, or from the top and bottom).', 'jigoshop'), 'id' => 'jigoshop_use_wordpress_featured_crop', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Image Sizes', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Tiny Image Width', 'jigoshop'), 'desc' => __('Default = 36px', 'jigoshop'), 'tip' => __('Set the width of the small image used in the Cart, Checkout, Orders and Widgets.', 'jigoshop'), 'id' => 'jigoshop_shop_tiny_w', 'type' => 'natural'), array('name' => __('Tiny Image Height', 'jigoshop'), 'desc' => __('Default = 36px', 'jigoshop'), 'tip' => __('Set the height of the small image used in the Cart, Checkout, Orders and Widgets.', 'jigoshop'), 'id' => 'jigoshop_shop_tiny_h', 'type' => 'natural'), array('name' => __('Thumbnail Image Width', 'jigoshop'), 'desc' => __('Default = 90px', 'jigoshop'), 'tip' => __('Set the width of the thumbnail image for Single Product page extra images.', 'jigoshop'), 'id' => 'jigoshop_shop_thumbnail_w', 'type' => 'natural'), array('name' => __('Thumbnail Image Height', 'jigoshop'), 'desc' => __('Default = 90px', 'jigoshop'), 'tip' => __('Set the height of the thumbnail image for Single Product page extra images.', 'jigoshop'), 'id' => 'jigoshop_shop_thumbnail_h', 'type' => 'natural'), array('name' => __('Catalog Image Width', 'jigoshop'), 'desc' => __('Default = 150px', 'jigoshop'), 'tip' => __('Set the width of the catalog image for Shop, Categories, Tags, and Related Products.', 'jigoshop'), 'id' => 'jigoshop_shop_small_w', 'type' => 'natural'), array('name' => __('Catalog Image Height', 'jigoshop'), 'desc' => __('Default = 150px', 'jigoshop'), 'tip' => __('Set the height of the catalog image for Shop, Categories, Tags, and Related Products.', 'jigoshop'), 'id' => 'jigoshop_shop_small_h', 'type' => 'natural'), array('name' => __('Large Image Width', 'jigoshop'), 'desc' => __('Default = 300px', 'jigoshop'), 'tip' => __('Set the width of the Single Product page large or Featured image.', 'jigoshop'), 'id' => 'jigoshop_shop_large_w', 'type' => 'natural'), array('name' => __('Large Image Height', 'jigoshop'), 'desc' => __('Default = 300px', 'jigoshop'), 'tip' => __('Set the height of the Single Product page large or Featured image.', 'jigoshop'), 'id' => 'jigoshop_shop_large_h', 'type' => 'natural'), array('type' => 'tab', 'name' => __('Products & Inventory', 'jigoshop')), array('name' => __('Product Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Enable SKU field', 'jigoshop'), 'desc' => '', 'tip' => __('Turning off the SKU field will give products an SKU of their post id.', 'jigoshop'), 'id' => 'jigoshop_enable_sku', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Enable weight field', 'jigoshop'), 'desc' => '', 'tip' => '', 'id' => 'jigoshop_enable_weight', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Weight Unit', 'jigoshop'), 'desc' => '', 'tip' => __("This controls what unit you will define weights in.", 'jigoshop'), 'id' => 'jigoshop_weight_unit', 'type' => 'radio', 'choices' => array('kg' => __('Kilograms', 'jigoshop'), 'lbs' => __('Pounds', 'jigoshop'))), array('name' => __('Enable product dimensions', 'jigoshop'), 'desc' => '', 'tip' => '', 'id' => 'jigoshop_enable_dimensions', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Dimensions Unit', 'jigoshop'), 'desc' => '', 'tip' => __('This controls what unit you will define dimensions in.', 'jigoshop'), 'id' => 'jigoshop_dimension_unit', 'type' => 'radio', 'choices' => array('cm' => __('centimeters', 'jigoshop'), 'in' => __('inches', 'jigoshop'))), array('name' => __('Product thumbnail images per row', 'jigoshop'), 'desc' => __('Default = 3', 'jigoshop'), 'tip' => __('Determines how many extra product thumbnail images attached to a product to show on one row for the Single Product page.', 'jigoshop'), 'id' => 'jigoshop_product_thumbnail_columns', 'type' => 'number', 'extra' => array('min' => 1, 'max' => 10, 'step' => 1)), array('name' => __('Show related products', 'jigoshop'), 'desc' => '', 'tip' => __('To show or hide the related products section on a single product page.', 'jigoshop'), 'id' => 'jigoshop_enable_related_products', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Inventory Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Manage stock', 'jigoshop'), 'desc' => __('If you are not managing stock, turn it off here to disable it in admin and on the front-end.', 'jigoshop'), 'tip' => __('You can manage stock on a per-item basis if you leave this option on.', 'jigoshop'), 'id' => 'jigoshop_manage_stock', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Show stock amounts', 'jigoshop'), 'desc' => '', 'tip' => __('Set to yes to allow customers to view the amount of stock available for a product.', 'jigoshop'), 'id' => 'jigoshop_show_stock', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Notify on low stock', 'jigoshop'), 'desc' => '', 'id' => 'jigoshop_notify_low_stock', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Low stock threshold', 'jigoshop'), 'desc' => '', 'tip' => __('You will receive a notification as soon this threshold is hit (if notifications are turned on).', 'jigoshop'), 'id' => 'jigoshop_notify_low_stock_amount', 'type' => 'natural', 'std' => '2'), array('name' => __('Notify on out of stock', 'jigoshop'), 'desc' => '', 'id' => 'jigoshop_notify_no_stock', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Out of stock threshold', 'jigoshop'), 'desc' => '', 'tip' => __('You will receive a notification as soon this threshold is hit (if notifications are turned on).', 'jigoshop'), 'id' => 'jigoshop_notify_no_stock_amount', 'type' => 'natural'), array('name' => __('Hide out of stock products', 'jigoshop'), 'desc' => '', 'tip' => __('For Yes: When the Out of Stock Threshold (above) is reached, the product visibility will be set to hidden so that it will not appear on the Catalog or Shop product lists.', 'jigoshop'), 'id' => 'jigoshop_hide_no_stock_product', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('type' => 'tab', 'name' => __('Tax', 'jigoshop')), array('name' => __('Tax Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Calculate Taxes', 'jigoshop'), 'desc' => __('Only turn this off if you are exclusively selling non-taxable items.', 'jigoshop'), 'tip' => __('If you are not calculating taxes then you can ignore all other tax options.', 'jigoshop'), 'id' => 'jigoshop_calc_taxes', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Apply Taxes After Coupon', 'jigoshop'), 'desc' => __('This will have no effect if Calculate Taxes is turned off.', 'jigoshop'), 'tip' => __('If yes, taxes get applied after coupons. When no, taxes get applied before coupons.', 'jigoshop'), 'id' => 'jigoshop_tax_after_coupon', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Catalog Prices include tax?', 'jigoshop'), 'desc' => __('This will only apply to the Shop, Category and Product pages.', 'jigoshop'), 'tip' => __('This will have no effect on the Cart, Checkout, Emails, or final Orders; prices are always shown with tax out.', 'jigoshop'), 'id' => 'jigoshop_prices_include_tax', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Country to base taxes on', 'jigoshop'), 'desc' => __('This option defines whether to use billing or shipping address to calculate taxes.', 'jigoshop'), 'id' => 'jigoshop_country_base_tax', 'type' => 'select', 'choices' => array('billing_country' => __('Billing', 'jigoshop'), 'shipping_country' => __('Shipping', 'jigoshop'))), array('name' => __('Additional Tax classes', 'jigoshop'), 'desc' => __('List 1 per line. This is in addition to the default <em>Standard Rate</em>.', 'jigoshop'), 'tip' => __('List product and shipping tax classes here, e.g. Zero Tax, Reduced Rate.', 'jigoshop'), 'id' => 'jigoshop_tax_classes', 'type' => 'textarea'), array('name' => __('Tax rates', 'jigoshop'), 'desc' => '', 'tip' => __('To avoid rounding errors, insert tax rates with 4 decimal places.', 'jigoshop'), 'id' => 'jigoshop_tax_rates', 'type' => 'tax_rates'), array('name' => __('Default options for new products', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Tax status', 'jigoshop'), 'tip' => __('Whether new products should be taxable by default.', 'jigoshop'), 'id' => 'jigoshop_tax_defaults_status', 'type' => 'select', 'std' => 'taxable', 'choices' => array('taxable' => __('Taxable', 'jigoshop'), 'shipping' => __('Shipping', 'jigoshop'), 'none' => __('None', 'jigoshop'))), array('name' => __('Tax classes', 'jigoshop'), 'tip' => __('List of tax classes added by default to new products.', 'jigoshop'), 'id' => 'jigoshop_tax_defaults_classes', 'type' => 'user_defined', 'display' => array($this, 'display_default_tax_classes'), 'update' => array($this, 'update_default_tax_classes')), array('type' => 'tab', 'name' => __('Shipping', 'jigoshop')), array('name' => __('Shipping Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Enable Shipping', 'jigoshop'), 'desc' => __('Only turn this off if you are <strong>not</strong> shipping items, or items have shipping costs included.', 'jigoshop'), 'tip' => __('If turned off, this will also remove shipping address fields on the Checkout.', 'jigoshop'), 'id' => 'jigoshop_calc_shipping', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Enable shipping calculator on cart', 'jigoshop'), 'desc' => '', 'tip' => '', 'id' => 'jigoshop_enable_shipping_calc', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Only ship to billing address?', 'jigoshop'), 'desc' => '', 'tip' => __('When activated, Shipping address fields will not appear on the Checkout.', 'jigoshop'), 'id' => 'jigoshop_ship_to_billing_address_only', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Checkout always shows Shipping fields?', 'jigoshop'), 'desc' => __('This will have no effect if "Only ship to billing address" is activated.', 'jigoshop'), 'tip' => __('When activated, Shipping address fields will appear by default on the Checkout.', 'jigoshop'), 'id' => 'jigoshop_show_checkout_shipping_fields', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'jigoshop'), 'yes' => __('Yes', 'jigoshop'))), array('name' => __('Available Shipping Methods', 'jigoshop'), 'type' => 'title', 'desc' => __('Please enable all of the Shipping Methods you wish to make available to your customers.', 'jigoshop')), array('type' => 'tab', 'name' => __('Payment Gateways', 'jigoshop')), array('name' => __('Gateway Options', 'jigoshop'), 'type' => 'title', 'desc' => ''), array('name' => __('Default Gateway', 'jigoshop'), 'desc' => __('Only enabled gateways will appear in this list.', 'jigoshop'), 'tip' => __('This will determine which gateway appears first in the Payment Methods list on the Checkout.', 'jigoshop'), 'id' => 'jigoshop_default_gateway', 'type' => 'default_gateway', 'choices' => apply_filters('jigoshop_available_payment_gateways', array())), array('name' => __('Available gateways', 'jigoshop'), 'type' => 'title', 'desc' => __('Please enable all of the Payment Gateways you wish to make available to your customers.', 'jigoshop')));
 }
Example #11
0
    /**
     * Get the main chart
     *
     * @return string
     */
    public function get_main_chart()
    {
        global $wp_locale;
        // Prepare data for report
        $order_counts = $this->prepare_chart_data($this->report_data->order_counts, 'post_date', 'count', $this->chart_interval, $this->start_date, $this->chart_groupby);
        $order_item_counts = $this->prepare_chart_data($this->report_data->order_items, 'post_date', 'order_item_count', $this->chart_interval, $this->start_date, $this->chart_groupby);
        $order_amounts = $this->prepare_chart_data($this->report_data->orders, 'post_date', 'total_sales', $this->chart_interval, $this->start_date, $this->chart_groupby);
        $coupon_amounts = $this->prepare_chart_data($this->report_data->coupons, 'post_date', 'discount_amount', $this->chart_interval, $this->start_date, $this->chart_groupby);
        $shipping_amounts = $this->prepare_chart_data($this->report_data->orders, 'post_date', 'total_shipping', $this->chart_interval, $this->start_date, $this->chart_groupby);
        $shipping_tax_amounts = $this->prepare_chart_data($this->report_data->orders, 'post_date', 'total_shipping_tax', $this->chart_interval, $this->start_date, $this->chart_groupby);
        $tax_amounts = $this->prepare_chart_data($this->report_data->orders, 'post_date', 'total_tax', $this->chart_interval, $this->start_date, $this->chart_groupby);
        $net_order_amounts = array();
        foreach ($order_amounts as $order_amount_key => $order_amount_value) {
            $net_order_amounts[$order_amount_key] = $order_amount_value;
            $net_order_amounts[$order_amount_key][1] = $net_order_amounts[$order_amount_key][1] - $shipping_amounts[$order_amount_key][1] - $shipping_tax_amounts[$order_amount_key][1] - $tax_amounts[$order_amount_key][1];
        }
        // Encode in json format
        $chart_data = json_encode(array('order_counts' => array_values($order_counts), 'order_item_counts' => array_values($order_item_counts), 'order_amounts' => array_map(array($this, 'round_chart_totals'), array_values($order_amounts)), 'net_order_amounts' => array_map(array($this, 'round_chart_totals'), array_values($net_order_amounts)), 'shipping_amounts' => array_map(array($this, 'round_chart_totals'), array_values($shipping_amounts)), 'coupon_amounts' => array_map(array($this, 'round_chart_totals'), array_values($coupon_amounts))));
        ?>
		<div class="chart-container">
			<div class="chart-placeholder main"></div>
		</div>
		<script type="text/javascript">
			var main_chart;
			jQuery(function(){
				var order_data = jQuery.parseJSON('<?php 
        echo $chart_data;
        ?>
');
				var drawGraph = function(highlight){
					var series = [
						{
							label: "<?php 
        echo esc_js(__('Number of items sold', 'jigoshop'));
        ?>
",
							data: order_data.order_item_counts,
							color: '<?php 
        echo $this->chart_colours['item_count'];
        ?>
',
							bars: {
								fillColor: '<?php 
        echo $this->chart_colours['item_count'];
        ?>
',
								fill: true,
								show: true,
								lineWidth: 0,
								align: 'left',
								barWidth: 0<?php 
        echo $this->barwidth;
        ?>
 * 0.25
							},
							shadowSize: 0,
							hoverable: false
						},
						{
							label: "<?php 
        echo esc_js(__('Number of orders', 'jigoshop'));
        ?>
",
							data: order_data.order_counts,
							color: '<?php 
        echo $this->chart_colours['order_count'];
        ?>
',
							bars: {
								fillColor: '<?php 
        echo $this->chart_colours['order_count'];
        ?>
',
								fill: true,
								show: true,
								lineWidth: 0,
								align: 'right',
								barWidth: 0<?php 
        echo $this->barwidth;
        ?>
 * 0.25
							},
							shadowSize: 0,
							hoverable: false
						},
						{
							label: "<?php 
        echo esc_js(__('Average sales amount', 'jigoshop'));
        ?>
",
							data: [[<?php 
        echo min(array_keys($order_amounts));
        ?>
, <?php 
        echo $this->report_data->average_sales;
        ?>
], [<?php 
        echo max(array_keys($order_amounts));
        ?>
, <?php 
        echo $this->report_data->average_sales;
        ?>
]],
							yaxis: 2,
							color: '<?php 
        echo $this->chart_colours['average'];
        ?>
',
							points: {show: false},
							lines: {show: true, lineWidth: 2, fill: false},
							shadowSize: 0,
							hoverable: false
						},
						{
							label: "<?php 
        echo esc_js(__('Coupon amount', 'jigoshop'));
        ?>
",
							data: order_data.coupon_amounts,
							yaxis: 2,
							color: '<?php 
        echo $this->chart_colours['coupon_amount'];
        ?>
',
							points: {show: true, radius: 5, lineWidth: 2, fillColor: '#fff', fill: true},
							lines: {show: true, lineWidth: 2, fill: false},
							shadowSize: 0,
							<?php 
        echo $this->get_currency_tooltip();
        ?>
						},
						{
							label: "<?php 
        echo esc_js(__('Shipping amount', 'jigoshop'));
        ?>
",
							data: order_data.shipping_amounts,
							yaxis: 2,
							color: '<?php 
        echo $this->chart_colours['shipping_amount'];
        ?>
',
							points: {show: true, radius: 5, lineWidth: 2, fillColor: '#fff', fill: true},
							lines: {show: true, lineWidth: 2, fill: false},
							shadowSize: 0,
							prepend_tooltip: "<?php 
        echo get_jigoshop_currency_symbol();
        ?>
"
						},
						{
							label: "<?php 
        echo esc_js(__('Gross Sales amount', 'jigoshop'));
        ?>
",
							data: order_data.order_amounts,
							yaxis: 2,
							color: '<?php 
        echo $this->chart_colours['sales_amount'];
        ?>
',
							points: {show: true, radius: 5, lineWidth: 2, fillColor: '#fff', fill: true},
							lines: {show: true, lineWidth: 2, fill: false},
							shadowSize: 0,
							<?php 
        echo $this->get_currency_tooltip();
        ?>
						},
						{
							label: "<?php 
        echo esc_js(__('Net Sales amount', 'jigoshop'));
        ?>
",
							data: order_data.net_order_amounts,
							yaxis: 2,
							color: '<?php 
        echo $this->chart_colours['net_sales_amount'];
        ?>
',
							points: {show: true, radius: 6, lineWidth: 4, fillColor: '#fff', fill: true},
							lines: {show: true, lineWidth: 5, fill: false},
							shadowSize: 0,
							<?php 
        echo $this->get_currency_tooltip();
        ?>
						}
					];
					if(highlight !== 'undefined' && series[highlight]){
						highlight_series = series[highlight];
						highlight_series.color = '#98c242';
						if(highlight_series.bars)
							highlight_series.bars.fillColor = '#98c242';
						if(highlight_series.lines){
							highlight_series.lines.lineWidth = 5;
						}
					}
					main_chart = jQuery.plot(
						jQuery('.chart-placeholder.main'),
						series,
						{
							legend: {
								show: false
							},
							grid: {
								color: '#aaa',
								borderColor: 'transparent',
								borderWidth: 0,
								hoverable: true
							},
							xaxes: [{
								color: '#aaa',
								position: "bottom",
								tickColor: 'transparent',
								mode: "time",
								timeformat: "<?php 
        if ($this->chart_groupby == 'hour') {
            echo '%H';
        } elseif ($this->chart_groupby == 'day') {
            echo '%d %b';
        } else {
            echo '%b';
        }
        ?>
",
								<?php 
        if ($this->chart_groupby == 'hour') {
            ?>
								min: 0,
								max: 24*3600000,
								<?php 
        }
        ?>
								monthNames: <?php 
        echo json_encode(array_values($wp_locale->month_abbrev));
        ?>
,
								tickLength: 1,
								minTickSize: [1, "<?php 
        echo $this->chart_groupby;
        ?>
"],
								font: {
									color: "#aaa"
								}
							}],
							yaxes: [
								{
									min: 0,
									minTickSize: 1,
									tickDecimals: 0,
									color: '#d4d9dc',
									font: {color: "#aaa"}
								},
								{
									position: "right",
									min: 0,
									tickDecimals: 2,
									alignTicksWithAxis: 1,
									autoscaleMargin: 0,
									color: 'transparent',
									font: {color: "#aaa"}
								}
							]
						}
					);
					jQuery('.chart-placeholder').resize();
				};

				drawGraph();
				jQuery('.highlight_series').hover(
					function(){
						drawGraph(jQuery(this).data('series'));
					},
					function(){
						drawGraph();
					}
				);
			});
		</script>
	<?php 
    }
Example #12
0
function jigoshop_price($price, $args = array())
{
    $options = Jigoshop_Base::get_options();
    $ex_tax_label = 0;
    $with_currency = true;
    extract(shortcode_atts(array('ex_tax_label' => 0, 'with_currency' => true), $args));
    if ($ex_tax_label === 1) {
        $tax_label = __(' <small>(ex. tax)</small>', 'jigoshop');
    } else {
        if ($ex_tax_label === 2) {
            $tax_label = __(' <small>(inc. tax)</small>', 'jigoshop');
        } else {
            $tax_label = '';
        }
    }
    $price = number_format((double) $price, (int) $options->get('jigoshop_price_num_decimals'), $options->get('jigoshop_price_decimal_sep'), $options->get('jigoshop_price_thousand_sep'));
    $return = $price;
    if ($with_currency) {
        $currency_pos = $options->get('jigoshop_currency_pos');
        $currency_symbol = get_jigoshop_currency_symbol();
        $currency_code = $options->get('jigoshop_currency');
        switch ($currency_pos) {
            case 'left':
                $return = $currency_symbol . $price;
                break;
            case 'left_space':
                $return = $currency_symbol . ' ' . $price;
                break;
            case 'right':
                $return = $price . $currency_symbol;
                break;
            case 'right_space':
                $return = $price . ' ' . $currency_symbol;
                break;
            case 'left_code':
                $return = $currency_code . $price;
                break;
            case 'left_code_space':
                $return = $currency_code . ' ' . $price;
                break;
            case 'right_code':
                $return = $price . $currency_code;
                break;
            case 'right_code_space':
                $return = $price . ' ' . $currency_code;
                break;
            case 'code_symbol':
                $return = $currency_code . $price . $currency_symbol;
                break;
            case 'code_symbol_space':
                $return = $currency_code . ' ' . $price . ' ' . $currency_symbol;
                break;
            case 'symbol_code':
                $return = $currency_symbol . $price . $currency_code;
                break;
            case 'symbol_code_space':
                $return = $currency_symbol . ' ' . $price . ' ' . $currency_code;
                break;
        }
        // only show tax label (ex. tax) if we are going to show the price with currency as well. Otherwise we just want the formatted price
        if ($options->get('jigoshop_calc_taxes') == 'yes') {
            $return .= $tax_label;
        }
    }
    return apply_filters('jigoshop_price_display_filter', $return);
}
Example #13
0
/**
 * Product data box
 * 
 * Displays the product data box, tabbed, with several panels covering price, stock etc
 *
 * @since 		1.0
 */
function jigoshop_product_data_box() {
	global $post, $wpdb, $thepostid;
	add_action('admin_footer', 'jigoshop_meta_scripts');
	
	wp_nonce_field( 'jigoshop_save_data', 'jigoshop_meta_nonce' );
	
	$data = (array) maybe_unserialize( get_post_meta($post->ID, 'product_data', true) );
	$featured = (string) get_post_meta( $post->ID, 'featured', true );
	$visibility = (string) get_post_meta( $post->ID, 'visibility', true);
	
	if (!isset($data['weight'])) $data['weight'] = '';
	if (!isset($data['regular_price'])) $data['regular_price'] = '';
	if (!isset($data['sale_price'])) $data['sale_price'] = '';
	
	$thepostid = $post->ID;
	
	?>
	<div class="panel-wrap product_data">
	
		<ul class="product_data_tabs tabs" style="display:none;">
			<li class="active"><a href="#general_product_data"><?php _e('General', 'jigoshop'); ?></a></li>
			<li class="pricing_tab"><a href="#pricing_product_data"><?php _e('Pricing', 'jigoshop'); ?></a></li>
			<?php if (get_option('jigoshop_manage_stock')=='yes') : ?><li class="inventory_tab"><a href="#inventory_product_data"><?php _e('Inventory', 'jigoshop'); ?></a></li><?php endif; ?>
			<li><a href="#jigoshop_attributes"><?php _e('Attributes', 'jigoshop'); ?></a></li>
			
			<?php do_action('product_write_panel_tabs'); ?>

		</ul>
		<div id="general_product_data" class="panel jigoshop_options_panel"><?php
			
			// Product Type
			if ($terms = wp_get_object_terms( $thepostid, 'product_type' )) $product_type = current($terms)->slug; else $product_type = 'simple';
			$field = array( 'id' => 'product-type', 'label' => __('Product Type', 'jigoshop') );
			echo '<p class="form-field"><label for="'.$field['id'].'">'.$field['label'].' <em class="req" title="'.__('Required', 'jigoshop') . '">*</em></label><select id="'.$field['id'].'" name="'.$field['id'].'">';

			echo '<option value="simple" '; if ($product_type=='simple') echo 'selected="selected"'; echo '>'.__('Simple','jigoshop').'</option>';
			
			do_action('product_type_selector', $product_type);

			echo '</select></p>';
			
			// Summary
			echo '<p class="form-field"><label for="excerpt">' . __('Summary', 'jigoshop') . ':</label>
			<textarea name="excerpt" id="excerpt" placeholder="' . __('Add a summary for your product &ndash; this is a quick description to encourage users to view the product.', 'jigoshop') . '">'.esc_html( $post->post_excerpt ).'</textarea></p>';
			
			// SKU
			$field = array( 'id' => 'sku', 'label' => __('SKU', 'jigoshop') );
			$SKU = get_post_meta($thepostid, 'SKU', true);
			
			if( get_option('jigoshop_enable_sku', true) !== 'no' ) :
				echo '<p class="form-field">
					<label for="'.$field['id'].'">'.$field['label'].':</label>
					<input type="text" class="short" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$SKU.'" /> <span class="description">' . __('Leave blank to use product ID', 'jigoshop') . '</span></p>';
			else:
				echo '<input type="hidden" name="'.$field['id'].'" value="'.$SKU.'" />';
			endif;
			
			// Weight
			$field = array( 'id' => 'weight', 'label' => __('Weight', 'jigoshop') . ' ('.get_option('jigoshop_weight_unit').'):' );
			 
			if( get_option('jigoshop_enable_weight', true) !== 'no' ) :
				echo '<p class="form-field">
					<label for="'.$field['id'].'">'.$field['label'].'</label>
					<input type="text" class="short" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$data[$field['id']].'" placeholder="0.00" /></p>';
			else:
				echo '<input type="hidden" name="'.$field['id'].'" value="'.$data[$field['id']].'" />';
			endif;
			
			// Featured
			$field = array( 'id' => 'featured', 'label' => __('Featured?', 'jigoshop') );
			echo '<p class="form-field"><label for="'.$field['id'].'">'.$field['label'].'</label><select name="'.$field['id'].'">';
			echo '<option value="no" '; if (isset($featured) && $featured=='no') echo 'selected="selected"'; echo '>' . __('No', 'jigoshop') . '</option>';
			echo '<option value="yes" '; if (isset($featured) && $featured=='yes') echo 'selected="selected"'; echo '>' . __('Yes', 'jigoshop') . '</option>';
			echo '</select></p>';
			
			// Visibility
			$field = array( 'id' => 'visibility', 'label' => __('Visibility', 'jigoshop') );
			echo '<p class="form-field"><label for="'.$field['id'].'">'.$field['label'].':</label><select name="'.$field['id'].'">';
			echo '<option value="visible" '; if (isset($visibility) && $visibility=='visible') echo 'selected="selected"'; echo '>' . __('Catalog &amp; Search', 'jigoshop') . '</option>';
			echo '<option value="catalog" '; if (isset($visibility) && $visibility=='catalog') echo 'selected="selected"'; echo '>' . __('Catalog', 'jigoshop') . '</option>';
			echo '<option value="search" '; if (isset($visibility) && $visibility=='search') echo 'selected="selected"'; echo '>' . __('Search', 'jigoshop') . '</option>';
			echo '<option value="hidden" '; if (isset($visibility) && $visibility=='hidden') echo 'selected="selected"'; echo '>' . __('Hidden', 'jigoshop') . '</option>';
			echo '</select></p>';
			?>
		</div>
		<div id="pricing_product_data" class="panel jigoshop_options_panel">
			
			<?php 
			// Price
			$field = array( 'id' => 'regular_price', 'label' => __('Regular Price', 'jigoshop') . ' ('.get_jigoshop_currency_symbol().'):' );
			echo '	<p class="form-field">
						<label for="'.$field['id'].'">'.$field['label'].'</label>
						<input type="text" class="short" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$data[$field['id']].'" placeholder="0.00" /></p>';
			
			// Special Price
			$field = array( 'id' => 'sale_price', 'label' => __('Sale Price', 'jigoshop') . ' ('.get_jigoshop_currency_symbol().'):' );
			echo '	<p class="form-field">
						<label for="'.$field['id'].'">'.$field['label'].'</label>
						<input type="text" class="short" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$data[$field['id']].'" placeholder="0.00" /></p>';
					
			// Special Price date range
			$field = array( 'id' => 'sale_price_dates', 'label' => __('Sale Price Dates', 'jigoshop') );
			
			$sale_price_dates_from = get_post_meta($thepostid, 'sale_price_dates_from', true);
			$sale_price_dates_to = get_post_meta($thepostid, 'sale_price_dates_to', true);
			
			echo '	<p class="form-field">
						<label for="'.$field['id'].'_from">'.$field['label'].':</label>
						<input type="text" class="short date-pick" name="'.$field['id'].'_from" id="'.$field['id'].'_from" value="';
			if ($sale_price_dates_from) echo date('Y-m-d', $sale_price_dates_from);
			echo '" placeholder="' . __('From&hellip;', 'jigoshop') . '" maxlength="10" />
						<input type="text" class="short date-pick" name="'.$field['id'].'_to" id="'.$field['id'].'_to" value="';
			if ($sale_price_dates_to) echo date('Y-m-d', $sale_price_dates_to);
			echo '" placeholder="' . __('To&hellip;', 'jigoshop') . '" maxlength="10" />
						<span class="description">' . __('Date format', 'jigoshop') . ': <code>YYYY-MM-DD</code></span>
					</p>';
					
			// Tax
			$_tax = new jigoshop_tax();
			
			$field = array( 'id' => 'tax_status', 'label' => __('Tax Status', 'jigoshop') );
			echo '<p class="form-field"><label for="'.$field['id'].'">'.$field['label'].':</label><select name="'.$field['id'].'">';
			echo '<option value="taxable" '; if (isset($data[$field['id']]) && $data[$field['id']]=='taxable') echo 'selected="selected"'; echo '>' . __('Taxable', 'jigoshop') . '</option>';
			echo '<option value="shipping" '; if (isset($data[$field['id']]) && $data[$field['id']]=='shipping') echo 'selected="selected"'; echo '>' . __('Shipping only', 'jigoshop') . '</option>';
			echo '<option value="none" '; if (isset($data[$field['id']]) && $data[$field['id']]=='none') echo 'selected="selected"'; echo '>' . __('None', 'jigoshop') . '</option>';
			echo '</select></p>';
			
			$field = array( 'id' => 'tax_class', 'label' => __('Tax Class', 'jigoshop') );
			echo '<p class="form-field"><label for="'.$field['id'].'">'.$field['label'].':</label><select name="'.$field['id'].'">';
			echo '<option value="" '; if (isset($data[$field['id']]) && $data[$field['id']]=='') echo 'selected="selected"'; echo '>'.__('Standard', 'jigoshop').'</option>';
			$tax_classes = $_tax->get_tax_classes();
    		if ($tax_classes) foreach ($tax_classes as $class) :
    			echo '<option value="'.sanitize_title($class).'" '; if (isset($data[$field['id']]) && $data[$field['id']]==sanitize_title($class)) echo 'selected="selected"'; echo '>'.$class.'</option>';
    		endforeach;
			echo '</select></p>';
			?>
			
		</div>
		<?php if (get_option('jigoshop_manage_stock')=='yes') : ?>
		<div id="inventory_product_data" class="panel jigoshop_options_panel">
			
			<?php
			// manage stock
			$field = array( 'id' => 'manage_stock', 'label' => __('Manage stock?', 'jigoshop') );
			echo '<p class="form-field"><label for="'.$field['id'].'">'.$field['label'].' <em class="req" title="' .__('Required', 'jigoshop') . '">*</em></label><input type="checkbox" class="checkbox" name="'.$field['id'].'" id="'.$field['id'].'"';
			if (isset($data[$field['id']]) && $data[$field['id']]=='yes') echo 'checked="checked"';
			echo ' /></p>';
			
			// Stock status
			$field = array( 'id' => 'stock_status', 'label' => 'Stock status:' );
			echo '<p class="form-field"><label for="'.$field['id'].'">'.$field['label'].' <em class="req" title="'.__('Required', 'jigoshop') . '">*</em></label><select name="'.$field['id'].'">';
			echo '<option value="instock" '; if (isset($data[$field['id']]) && $data[$field['id']]=='instock') echo 'selected="selected"'; echo '>In stock</option>';
			echo '<option value="outofstock" '; if (isset($data[$field['id']]) && $data[$field['id']]=='outofstock') echo 'selected="selected"'; echo '>Out of stock</option>';
			echo '</select></p>';
			
			echo '<div class="stock_fields">';
			
			// Stock
			$field = array( 'id' => 'stock', 'label' => __('Stock Qty', 'jigoshop') );
			echo '	<p class="form-field">
						<label for="'.$field['id'].'">'.$field['label'].': <em class="req" title="'.__('Required', 'jigoshop') . '">*</em></label>
						<input type="text" class="short" name="'.$field['id'].'" id="'.$field['id'].'" value="';
			
			$stock = get_post_meta($post->ID, 'stock', true);
    		if (!$stock) $stock = 0;
    		echo $stock;
						
			echo '" />
					</p>';

			// Backorders?
			$field = array( 'id' => 'backorders', 'label' => __('Allow Backorders?', 'jigoshop') );
			echo '<p class="form-field"><label for="'.$field['id'].'">'.$field['label'].' <em class="req" title="'.__('Required', 'jigoshop') . '">*</em></label><select name="'.$field['id'].'">';
			echo '<option value="no" '; if (isset($data[$field['id']]) && $data[$field['id']]=='no') echo 'selected="selected"'; echo '>' . __('Do not allow', 'jigoshop') . '</option>';
			echo '<option value="notify" '; if (isset($data[$field['id']]) && $data[$field['id']]=='notify') echo 'selected="selected"'; echo '>' . __('Allow, but notify customer', 'jigoshop') . '</option>';
			echo '<option value="yes" '; if (isset($data[$field['id']]) && $data[$field['id']]=='yes') echo 'selected="selected"'; echo '>' . __('Allow', 'jigoshop') . '</option>';
			echo '</select></p>';
			
			echo '</div>';
			?>			
			
		</div>
		<?php endif; ?>
		<div id="jigoshop_attributes" class="panel">
		
			<div class="jigoshop_attributes_wrapper">
				<table cellpadding="0" cellspacing="0" class="jigoshop_attributes">
					<thead>
						<tr>
							<th class="center" width="60"><?php _e('Order', 'jigoshop'); ?></th>
							<th width="180"><?php _e('Name', 'jigoshop'); ?></th>
							<th><?php _e('Value', 'jigoshop'); ?></th>
							<th class="center" width="1%"><?php _e('Visible?', 'jigoshop'); ?></th>
							<!--th class="center" width="1%"><?php _e('Variation?', 'jigoshop'); ?></th-->
							<th class="center" width="1%"><?php _e('Remove', 'jigoshop'); ?></th>
						</tr>
					</thead>
					<tbody id="attributes_list">	
						<?php
							$attribute_taxonomies = jigoshop::$attribute_taxonomies;
							$attributes = maybe_unserialize( get_post_meta($post->ID, 'product_attributes', true) );

							$i = -1;
							
							// Taxonomies
							if ( $attribute_taxonomies ) :
						    	foreach ($attribute_taxonomies as $tax) : $i++;
						    							    	
						    		$attribute_nicename = strtolower(sanitize_title($tax->attribute_name));
						    		if (isset($attributes[$attribute_nicename])) $attribute = $attributes[$attribute_nicename];
						    		if (isset($attribute['visible']) && $attribute['visible']=='yes') $checked = 'checked="checked"'; else $checked = '';
						    		if (isset($attribute['variation']) && $attribute['variation']=='yes') $checked2 = 'checked="checked"'; else $checked2 = '';
						    		
						    		$values = wp_get_post_terms( $thepostid, 'pa_'.strtolower(sanitize_title($tax->attribute_name)) );
						    		$value = array();
						    		if (!is_wp_error($values) && $values) :
						    			foreach ($values as $v) :
						    				$value[] = $v->slug;
						    			endforeach;
						    		endif;
						    		
						    		?><tr class="taxonomy <?php echo strtolower(sanitize_title($tax->attribute_name)); ?>" rel="<?php if (isset($attribute['position'])) echo $attribute['position']; else echo '0'; ?>" <?php if (!$value || sizeof($value)==0) echo 'style="display:none"'; ?>>
										<td class="center">
											<button type="button" class="move_up button">&uarr;</button><button type="button" class="move_down button">&darr;</button>
											<input type="hidden" name="attribute_position[<?php echo $i; ?>]" class="attribute_position" value="<?php if (isset($attribute['position'])) echo $attribute['position']; else echo '0'; ?>" />
										</td>
										<td class="name">
											<?php echo $tax->attribute_name; ?> 
											<input type="hidden" name="attribute_names[<?php echo $i; ?>]" value="<?php echo $tax->attribute_name; ?>" />
											<input type="hidden" name="attribute_is_taxonomy[<?php echo $i; ?>]" value="1" />
										</td>
										<td>
										<?php if ($tax->attribute_type=="select" || $tax->attribute_type=="multiselect") : ?>
											<select <?php if ($tax->attribute_type=="multiselect") echo 'multiple="multiple" class="multiselect" name="attribute_values['.$i.'][]"'; else echo 'name="attribute_values['.$i.']"'; ?>>
												<?php if ($tax->attribute_type=="select") : ?><option value=""><?php _e('Choose an option&hellip;', 'jigoshop'); ?></option><?php endif; ?>
												<?php
												if (taxonomy_exists('pa_'.strtolower(sanitize_title($tax->attribute_name)))) :
					        						$terms = get_terms( 'pa_'.strtolower(sanitize_title($tax->attribute_name)), 'orderby=name&hide_empty=0' );
					        						if ($terms) :
						        						foreach ($terms as $term) :
						        							echo '<option value="'.$term->name.'" ';
						        							if (in_array($term->slug, $value)) echo 'selected="selected"';
						        							echo '>'.$term->name.'</option>';
														endforeach;
													endif;
												endif;
												?>			
											</select>
										<?php elseif ($tax->attribute_type=="text") : ?>
											<input type="text" name="attribute_values[<?php echo $i; ?>]" value="<?php if (isset($attribute['value'])) echo $attribute['value']; ?>" placeholder="<?php _e('Comma separate terms', 'jigoshop'); ?>" />
										<?php endif; ?>
										</td>
										<td class="center"><input type="checkbox" <?php echo $checked; ?> name="attribute_visibility[<?php echo $i; ?>]" value="1" /></td>
										<!--td class="center"><input type="checkbox" <?php echo $checked2; ?> name="attribute_variation[<?php echo $i; ?>]" value="1" /></td-->
										<td class="center"><button type="button" class="hide_row button">&times;</button></td>
									</tr><?php
						    	endforeach;
						    endif;
							
							// Attributes
							if ($attributes && sizeof($attributes)>0) foreach ($attributes as $attribute) : 
								if (isset($attribute['is_taxonomy']) && $attribute['is_taxonomy']=='yes') continue;
								
								$i++; 
								
								if (isset($attribute['visible']) && $attribute['visible']=='yes') $checked = 'checked="checked"'; else $checked = '';
								if (isset($attribute['variation']) && $attribute['variation']=='yes') $checked2 = 'checked="checked"'; else $checked2 = '';
								
								?><tr rel="<?php if (isset($attribute['position'])) echo $attribute['position']; else echo '0'; ?>">
									<td class="center">
										<button type="button" class="move_up button">&uarr;</button><button type="button" class="move_down button">&darr;</button>
										<input type="hidden" name="attribute_position[<?php echo $i; ?>]" class="attribute_position" value="<?php if (isset($attribute['position'])) echo $attribute['position']; else echo '0'; ?>" />
									</td>
									<td>
										<input type="text" name="attribute_names[<?php echo $i; ?>]" value="<?php echo $attribute['name']; ?>" />
										<input type="hidden" name="attribute_is_taxonomy[<?php echo $i; ?>]" value="0" />
									</td>
									<td><input type="text" name="attribute_values[<?php echo $i; ?>]" value="<?php echo $attribute['value']; ?>" /></td>
									<td class="center"><input type="checkbox" <?php echo $checked; ?> name="attribute_visibility[<?php echo $i; ?>]" value="1" /></td>
									<!--td class="center"><input type="checkbox" <?php echo $checked2; ?> name="attribute_variation[<?php echo $i; ?>]" value="1" /></td-->
									<td class="center"><button type="button" class="remove_row button">&times;</button></td>
								</tr><?php
							endforeach;
						?>			
					</tbody>
				</table>
			</div>
			<button type="button" class="button button-primary add_attribute"><?php _e('Add', 'jigoshop'); ?></button>
			<select name="attribute_taxonomy" class="attribute_taxonomy">
				<option value=""><?php _e('Custom product attribute', 'jigoshop'); ?></option>
				<?php
					if ( $attribute_taxonomies ) :
				    	foreach ($attribute_taxonomies as $tax) :
				    		echo '<option value="'.strtolower(sanitize_title($tax->attribute_name)).'">'.$tax->attribute_name.'</option>';
				    	endforeach;
				    endif;
				?>
			</select>
			<div class="clear"></div>
		</div>	
		
		<?php do_action('product_write_panels'); ?>
		
	</div>
	<?php
}
/**
 * Function for showing the dashboard
 * 
 * The dashboard shows widget for things such as:
 *		- Products
 *		- Sales
 *		- Recent reviews
 *
 * @since 		1.0
 * @usedby 		jigoshop_admin_menu()
 */
function jigoshop_dashboard() { ?>
	<div class="wrap jigoshop">
        <div class="icon32 jigoshop_icon"><br/></div>
		<h2><?php _e('Jigoshop Dashboard','jigoshop'); ?></h2>
		<div id="jigoshop_dashboard">
			
			<div id="dashboard-widgets" class="metabox-holder">
			
				<div class="postbox-container" style="width:49%;">
				
					<div id="jigoshop_right_now" class="jigoshop_right_now postbox">
						<h3><?php _e('Right Now', 'jigoshop') ?></h3>
						<div class="inside">

							<div class="table table_content">
								<p class="sub"><?php _e('Shop Content', 'jigoshop'); ?></p>
								<table>
									<tbody>
										<tr class="first">
											<td class="first b"><a href="edit.php?post_type=product"><?php
												$num_posts = wp_count_posts( 'product' );
												$num = number_format_i18n( $num_posts->publish );
												echo $num;
											?></a></td>
											<td class="t"><a href="edit.php?post_type=product"><?php _e('Products', 'jigoshop'); ?></a></td>
										</tr>
										<tr>
											<td class="first b"><a href="edit-tags.php?taxonomy=product_cat&post_type=product"><?php
												echo wp_count_terms('product_cat');
											?></a></td>
											<td class="t"><a href="edit-tags.php?taxonomy=product_cat&post_type=product"><?php _e('Product Categories', 'jigoshop'); ?></a></td>
										</tr>
										<tr>
											<td class="first b"><a href="edit-tags.php?taxonomy=product_tag&post_type=product"><?php
												echo wp_count_terms('product_tag');
											?></a></td>
											<td class="t"><a href="edit-tags.php?taxonomy=product_tag&post_type=product"><?php _e('Product Tag', 'jigoshop'); ?></a></td>
										</tr>
										<tr>
											<td class="first b"><a href="admin.php?page=attributes"><?php 
												echo sizeof(jigoshop::$attribute_taxonomies);
											?></a></td>
											<td class="t"><a href="admin.php?page=attributes"><?php _e('Attribute taxonomies', 'jigoshop'); ?></a></td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="table table_discussion">
								<p class="sub"><?php _e('Orders', 'jigoshop'); ?></p>
								<table>
									<tbody>
										<?php $jigoshop_orders = &new jigoshop_orders(); ?>
										<tr class="first">
											<td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=pending"><span class="total-count"><?php echo $jigoshop_orders->pending_count; ?></span></a></td>
											<td class="last t"><a class="pending" href="edit.php?post_type=shop_order&shop_order_status=pending"><?php _e('Pending', 'jigoshop'); ?></a></td>
										</tr>
										<tr>
											<td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=on-hold"><span class="total-count"><?php echo $jigoshop_orders->on_hold_count; ?></span></a></td>
											<td class="last t"><a class="onhold" href="edit.php?post_type=shop_order&shop_order_status=on-hold"><?php _e('On-Hold', 'jigoshop'); ?></a></td>
										</tr>
										<tr>
											<td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=processing"><span class="total-count"><?php echo $jigoshop_orders->processing_count; ?></span></a></td>
											<td class="last t"><a class="processing" href="edit.php?post_type=shop_order&shop_order_status=processing"><?php _e('Processing', 'jigoshop'); ?></a></td>
										</tr>
										<tr>
											<td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=completed"><span class="total-count"><?php echo $jigoshop_orders->completed_count; ?></span></a></td>
											<td class="last t"><a class="complete" href="edit.php?post_type=shop_order&shop_order_status=completed"><?php _e('Completed', 'jigoshop'); ?></a></td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="versions">
								<p id="wp-version-message"><?php _e('You are using', 'jigoshop'); ?> <strong>JigoShop <?php echo JIGOSHOP_VERSION; ?>.</strong></p>
							</div>
							<div class="clear"></div>
						</div>
					
					</div><!-- postbox end -->

					<div class="postbox">
						<h3 class="hndle" id="poststuff"><span><?php _e('Recent Orders', 'jigoshop') ?></span></h3>
						<div class="inside">
							<?php
								$args = array(
								    'numberposts'     => 10,
								    'orderby'         => 'post_date',
								    'order'           => 'DESC',
								    'post_type'       => 'shop_order',
								    'post_status'     => 'publish' 
								);
								$orders = get_posts( $args );
								if ($orders) :
									echo '<ul class="recent-orders">';
									foreach ($orders as $order) :
										
										$this_order = &new jigoshop_order( $order->ID );
										
										echo '
										<li>
											<span class="order-status '.sanitize_title($this_order->status).'">'.ucwords($this_order->status).'</span> <a href="'.admin_url('post.php?post='.$order->ID).'&action=edit">'.date_i18n('l jS \of F Y h:i:s A', strtotime($this_order->order_date)).'</a><br />
											<small>'.sizeof($this_order->items).' '._n('item', 'items', sizeof($this_order->items), 'jigoshop').' <span class="order-cost">'.__('Total: ', 'jigoshop').jigoshop_price($this_order->order_total).'</span></small>
										</li>';

									endforeach;
									echo '</ul>';
								endif;
							?>
						</div>
					</div><!-- postbox end -->	
					
					<?php if (get_option('jigoshop_manage_stock')=='yes') : ?>
					<div class="postbox jigoshop_right_now">
						<h3 class="hndle" id="poststuff"><span><?php _e('Stock Report', 'jigoshop') ?></span></h3>
						<div class="inside">
							
							<?php
							
							$lowstockamount = get_option('jigoshop_notify_low_stock_amount');
							if (!$lowstockamount) $lowstockamount = 1;
							
							$nostockamount = get_option('jigoshop_notify_no_stock_amount');
							if (!$nostockamount) $nostockamount = 1;
							
							$outofstock = array();
							$lowinstock = array();
							$args = array(
								'post_type'	=> 'product',
								'post_status' => 'publish',
								'ignore_sticky_posts'	=> 1,
								'posts_per_page' => -1
							);
							$my_query = new WP_Query($args);
							if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); 
								
								$_product = &new jigoshop_product( $my_query->post->ID );
								if (!$_product->managing_stock()) continue;

								$thisitem = '<tr class="first">
									<td class="first b"><a href="post.php?post='.$my_query->post->ID.'&action=edit">'.$_product->stock.'</a></td>
									<td class="t"><a href="post.php?post='.$my_query->post->ID.'&action=edit">'.$my_query->post->post_title.'</a></td>
								</tr>';
								
								if ($_product->stock<=$nostockamount) :
									$outofstock[] = $thisitem;
									continue;
								endif;
								
								if ($_product->stock<=$lowstockamount) $lowinstock[] = $thisitem;

							endwhile; endif;
							wp_reset_query();
							
							if (sizeof($lowinstock)==0) :
								$lowinstock[] = '<tr><td colspan="2">'.__('No products are low in stock.', 'jigoshop').'</td></tr>';
							endif;
							if (sizeof($outofstock)==0) :
								$outofstock[] = '<tr><td colspan="2">'.__('No products are out of stock.', 'jigoshop').'</td></tr>';
							endif;
							?>
										
							<div class="table table_content">
								<p class="sub"><?php _e('Low Stock', 'jigoshop'); ?></p>
								<table>
									<tbody>
										<?php echo implode('', $lowinstock); ?>
									</tbody>
								</table>
							</div>
							<div class="table table_discussion">
								<p class="sub"><?php _e('Out of Stock/Backorders', 'jigoshop'); ?></p>
								<table>
									<tbody>
										<?php echo implode('', $outofstock); ?>
									</tbody>
								</table>
							</div>
							<div class="clear"></div>
							
						</div>
					</div><!-- postbox end -->
					<?php endif; ?>
					
				
				</div>
				<div class="postbox-container" style="width:49%; float:right;">
					
					<?php
						global $current_month_offset;
						
						$current_month_offset = (int) date('m');
						
						if (isset($_GET['month'])) $current_month_offset = (int) $_GET['month'];
					?>
					<div class="postbox stats" id="jigoshop-stats">
						<h3 class="hndle" id="poststuff">
							<?php if ($current_month_offset!=date('m')) : ?><a href="admin.php?page=jigoshop&amp;month=<?php echo $current_month_offset+1; ?>" class="next">Next Month &rarr;</a><?php endif; ?>
							<a href="admin.php?page=jigoshop&amp;month=<?php echo $current_month_offset-1; ?>" class="previous">&larr; Previous Month</a>
							<span><?php _e('Monthly Sales', 'jigoshop') ?></span></h3>
						<div class="inside">
							<div id="placeholder" style="width:100%; height:300px; position:relative;"></div>
							<script type="text/javascript">
								/* <![CDATA[ */

								jQuery(function(){
									
									function weekendAreas(axes) {
								        var markings = [];
								        var d = new Date(axes.xaxis.min);
								        // go to the first Saturday
								        d.setUTCDate(d.getUTCDate() - ((d.getUTCDay() + 1) % 7))
								        d.setUTCSeconds(0);
								        d.setUTCMinutes(0);
								        d.setUTCHours(0);
								        var i = d.getTime();
								        do {
								            // when we don't set yaxis, the rectangle automatically
								            // extends to infinity upwards and downwards
								            markings.push({ xaxis: { from: i, to: i + 2 * 24 * 60 * 60 * 1000 } });
								            i += 7 * 24 * 60 * 60 * 1000;
								        } while (i < axes.xaxis.max);
								 
								        return markings;
								    }
								    
								    <?php
			    
								    	function orders_this_month( $where = '' ) {
								    		global $current_month_offset;
								    		
								    		$month = $current_month_offset;
								    		$year = (int) date('Y');
								    		
								    		$first_day = strtotime("{$year}-{$month}-01");
								    		$last_day = strtotime('-1 second', strtotime('+1 month', $first_day));
								    		
								    		$after = date('Y-m-d', $first_day);
								    		$before = date('Y-m-d', $last_day);
								    		
											$where .= " AND post_date > '$after'";
											$where .= " AND post_date < '$before'";
											
											return $where;
										}
										add_filter( 'posts_where', 'orders_this_month' );

										$args = array(
										    'numberposts'     => -1,
										    'orderby'         => 'post_date',
										    'order'           => 'DESC',
										    'post_type'       => 'shop_order',
										    'post_status'     => 'publish' ,
										    'suppress_filters' => false
										);
										$orders = get_posts( $args );
										
										$order_counts = array();
										$order_amounts = array();
											
										// Blank date ranges to begin
										$month = $current_month_offset;
							    		$year = (int) date('Y');
							    		
							    		$first_day = strtotime("{$year}-{$month}-01");
							    		$last_day = strtotime('-1 second', strtotime('+1 month', $first_day));
		
										if ((date('m') - $current_month_offset)==0) :
											$up_to = date('d', strtotime('NOW'));
										else :
											$up_to = date('d', $last_day);
										endif;
										$count = 0;
										
										while ($count < $up_to) :
											
											$time = strtotime(date('Ymd', strtotime('+ '.$count.' DAY', $first_day))).'000';
											
											$order_counts[$time] = 0;
											$order_amounts[$time] = 0;

											$count++;
										endwhile;
										
										if ($orders) :
											foreach ($orders as $order) :
												
												$order_data = &new jigoshop_order($order->ID);
												
												if ($order_data->status=='cancelled' || $order_data->status=='refunded') continue;
												
												$time = strtotime(date('Ymd', strtotime($order->post_date))).'000';
												
												if (isset($order_counts[$time])) :
													$order_counts[$time]++;
												else :
													$order_counts[$time] = 1;
												endif;
												
												if (isset($order_amounts[$time])) :
													$order_amounts[$time] = $order_amounts[$time] + $order_data->order_total;
												else :
													$order_amounts[$time] = (float) $order_data->order_total;
												endif;
												
											endforeach;
										endif;
										
										remove_filter( 'posts_where', 'orders_this_month' );
									?>
										
								    var d = [
								    	<?php
								    		$values = array();
								    		foreach ($order_counts as $key => $value) $values[] = "[$key, $value]";
								    		echo implode(',', $values);
								    	?>
									];
							    	
							    	for (var i = 0; i < d.length; ++i) d[i][0] += 60 * 60 * 1000;
							    	
							    	var d2 = [
								    	<?php
								    		$values = array();
								    		foreach ($order_amounts as $key => $value) $values[] = "[$key, $value]";
								    		echo implode(',', $values);
								    	?>
							    	];
								    
								    for (var i = 0; i < d2.length; ++i) d2[i][0] += 60 * 60 * 1000;

									var plot = jQuery.plot(jQuery("#placeholder"), [ { label: "Number of sales", data: d }, { label: "Sales amount", data: d2, yaxis: 2 } ], {
										series: {
											lines: { show: true },
											points: { show: true }
										},
										grid: {
											show: true,
											aboveData: false,
											color: '#ccc',
											backgroundColor: '#fff',
											borderWidth: 2,
											borderColor: '#ccc',
											clickable: false,
											hoverable: true,
											markings: weekendAreas
										},
										xaxis: { 
											mode: "time",
											timeformat: "%d %b", 
											tickLength: 1,
											minTickSize: [1, "day"]
										},
    									yaxes: [ { min: 0, tickSize: 1, tickDecimals: 0 }, { position: "right", min: 0, tickDecimals: 2 } ],
					               		colors: ["#21759B", "#ed8432"]
					             	});
						             
									function showTooltip(x, y, contents) {
								        jQuery('<div id="tooltip">' + contents + '</div>').css( {
								            position: 'absolute',
								            display: 'none',
								            top: y + 5,
								            left: x + 5,
								            border: '1px solid #fdd',
								            padding: '2px',
								            'background-color': '#fee',
								            opacity: 0.80
								        }).appendTo("body").fadeIn(200);
								    }
								 
								    var previousPoint = null;
								    jQuery("#placeholder").bind("plothover", function (event, pos, item) {
							            if (item) {
							                if (previousPoint != item.dataIndex) {
							                    previousPoint = item.dataIndex;
							                    
							                    jQuery("#tooltip").remove();
							                    
							                    if (item.series.label=="Number of sales") {
							                    	
							                    	var y = item.datapoint[1];
							                    	showTooltip(item.pageX, item.pageY, item.series.label + " - " + y);
							                    	
							                    } else {
							                    	
							                    	var y = item.datapoint[1].toFixed(2);
							                    	showTooltip(item.pageX, item.pageY, item.series.label + " - <?php echo get_jigoshop_currency_symbol(); ?>" + y);
							                    
							                    }
			
							                }
							            }
							            else {
							                jQuery("#tooltip").remove();
							                previousPoint = null;            
							            }
								    });
									
								});
								
								/* ]]> */
							</script>
						</div>
					</div><!-- postbox end -->	
					
					<div class="postbox">
						<h3 class="hndle" id="poststuff"><span><?php _e('Recent Product Reviews', 'jigoshop') ?></span></h3>
						<div class="inside jigoshop-reviews-widget">
							<?php
								global $wpdb;
								$comments = $wpdb->get_results("SELECT *, SUBSTRING(comment_content,1,100) AS comment_excerpt
								FROM $wpdb->comments
								LEFT JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID)
								WHERE comment_approved = '1' 
								AND comment_type = '' 
								AND post_password = ''
								AND post_type = 'product'
								ORDER BY comment_date_gmt DESC
								LIMIT 5" );
								
								if ($comments) : 
									echo '<ul>';
									foreach ($comments as $comment) :
										
										echo '<li>';
										
										echo get_avatar($comment->comment_author, '32');
										
										$rating = get_comment_meta( $comment->comment_ID, 'rating', true );
										
										echo '<div class="star-rating" title="'.$rating.'">
											<span style="width:'.($rating*16).'px">'.$rating.' '.__('out of 5', 'jigoshop').'</span></div>';
											
										echo '<h4 class="meta"><a href="'.get_permalink($comment->ID).'#comment-'.$comment->comment_ID .'">'.$comment->post_title.'</a> reviewed by ' .strip_tags($comment->comment_author) .'</h4>';
										echo '<blockquote>'.strip_tags($comment->comment_excerpt).' [...]</blockquote></li>';
										
									endforeach;
									echo '</ul>';
								else :
									echo '<p>'.__('There are no product reviews yet.', 'jigoshop').'</p>';
								endif;
							?>
						</div>
					</div><!-- postbox end -->	

					<div class="postbox">
						<h3 class="hndle" id="poststuff"><span><?php _e('Latest News', 'jigoshop') ?></span></h3>
						<div class="inside jigoshop-rss-widget">
				     		<?php
				    			if (file_exists(ABSPATH.WPINC.'/class-simplepie.php')) {
					    			
					    			include_once(ABSPATH.WPINC.'/class-simplepie.php');
					    			
									$rss = fetch_feed('http://jigoshop.com/feed');
									
									if (!is_wp_error( $rss ) ) :
									
										$maxitems = $rss->get_item_quantity(5); 
										$rss_items = $rss->get_items(0, $maxitems); 					
									
										if ( $maxitems > 0 ) :
										
											echo '<ul>';
										
												foreach ( $rss_items as $item ) :
											
												$title = wptexturize($item->get_title(), ENT_QUOTES, "UTF-8");
				
												$link = $item->get_permalink();
															
							  					$date = $item->get_date('U');
							  
												if ( ( abs( time() - $date) ) < 86400 ) : // 1 Day
													$human_date = sprintf(__('%s ago','jigoshop'), human_time_diff($date));
												else :
													$human_date = date(__('F jS Y','jigoshop'), $date);
												endif;
							
												echo '<li><a href="'.$link.'">'.$title.'</a> &ndash; <span class="rss-date">'.$human_date.'</span></li>';
										
											endforeach;
										
											echo '</ul>';
											
										else :
											echo '<ul><li>'.__('No items found.','jigoshop').'</li></ul>';
										endif;
									
									else :
										echo '<ul><li>'.__('No items found.','jigoshop').'</li></ul>';
									endif;
								
								}
				    		?>
						</div>
					</div><!-- postbox end -->
					
					<div class="postbox">
						<h3 class="hndle" id="poststuff"><span><?php _e('Useful Links', 'jigoshop') ?></span></h3>
						<div class="inside jigoshop-links-widget">
				     		<ul class="links">
				     			<li><a href="http://jigoshop.com/"><?php _e('Jigoshop', 'jigoshop'); ?></a> &ndash; <?php _e('Learn more about the Jigoshop plugin', 'jigoshop'); ?></li>
				     			<li><a href="http://jigoshop.com/tour/"><?php _e('Tour', 'jigoshop'); ?></a> &ndash; <?php _e('Take a tour of the plugin', 'jigoshop'); ?></li>
				     			<li><a href="http://jigoshop.com/user-guide/"><?php _e('Documentation', 'jigoshop'); ?></a> &ndash; <?php _e('Stuck? Read the plugin\'s documentation.', 'jigoshop'); ?></li>
				     			<li><a href="http://jigoshop.com/forums/"><?php _e('Forums', 'jigoshop'); ?></a> &ndash; <?php _e('Help from the community or our dedicated support team.', 'jigoshop'); ?></li>
				     			<li><a href="http://jigoshop.com/extend/extensions/"><?php _e('Jigoshop Extensions', 'jigoshop'); ?></a> &ndash; <?php _e('Extend Jigoshop with extra plugins and modules.', 'jigoshop'); ?></li>
				     			<li><a href="http://jigoshop.com/extend/themes/"><?php _e('Jigoshop Themes', 'jigoshop'); ?></a> &ndash; <?php _e('Extend Jigoshop with themes.', 'jigoshop'); ?></li>
				     			<li><a href="http://twitter.com/#!/jigoshop"><?php _e('@Jigoshop', 'jigoshop'); ?></a> &ndash; <?php _e('Follow us on Twitter.', 'jigoshop'); ?></li>
				     			<li><a href="https://github.com/jigoshop/Jigoshop"><?php _e('Jigoshop on Github', 'jigoshop'); ?></a> &ndash; <?php _e('Help extend Jigoshop.', 'jigoshop'); ?></li>
				     			<li><a href="http://wordpress.org/extend/plugins/jigoshop/"><?php _e('Jigoshop on WordPress.org', 'jigoshop'); ?></a> &ndash; <?php _e('Leave us a rating!', 'jigoshop'); ?></li>
				     		</ul>
				     		<div class="social">
				     			
				     			<h4 class="first"><?php _e('Jigoshop Project', 'jigoshop') ?></h4>
				     			<p><?php _e('Join our growing developer community today, contribute to the jigoshop project via GitHub.') ?></p>
				     			
				     			<p><a href="https://github.com/jigoshop/Jigoshop" class="gitforked-button gitforked-forks gitforked-watchers">Fork</a></p>
				     			<script src="http://gitforked.com/api/1.1/button.js" type="text/javascript"></script>
				     			
				     			<h4><?php _e('Jigoshop Social', 'jigoshop'); ?></h4>
				     			
				     			<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://jigoshop.com" send="true" layout="button_count" width="250" show_faces="true" action="like" font="arial"></fb:like>
								
				     			<p><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://jigoshop.com/" data-text="Jigoshop: A WordPress eCommerce solution that works" data-count="horizontal" data-via="jigoshop" data-related="Jigowatt:Creators">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></p>
				     			
				     			<p><g:plusone size="medium" href="http://jigoshop.com/"></g:plusone><script type="text/javascript" src="https://apis.google.com/js/plusone.js">{lang: 'en-GB'}</script></p>
				     			
				     			<h4><?php _e('Brought to you by', 'jigoshop'); ?></h4>

				     			<p><a href="http://jigowatt.co.uk/" title="Jigoshop is brought to you by Jigowatt"><img src="<?php echo jigoshop::plugin_url(); ?>/assets/images/jigowatt.png" alt="Jigowatt" /></a></p>
				     			
				     			<p><?php _e('From design to deployment Jigowatt delivers expert solutions to enterprise customers using Magento & WordPress open source platforms.') ?></p>
				     			
				     		</div>
				     		<div class="clear"></div>
						</div>
					</div><!-- postbox end -->	
					
				</div>
			</div>
		</div>
	</div>
<?php } ?>
    /**
     * Monthly Report
     */
    function jigoshop_dash_monthly_report()
    {
        global $current_month_offset;
        $current_month_offset = (int) date('m');
        if (isset($_GET['month'])) {
            $current_month_offset = (int) $_GET['month'];
        }
        ?>
		<div class="stats" id="jigoshop-stats">
			<p>
				<?php 
        if ($current_month_offset != date('m')) {
            ?>
					<a href="admin.php?page=jigoshop&amp;month=<?php 
            echo $current_month_offset + 1;
            ?>
" class="next"><?php 
            _e('Next Month &rarr;', 'jigoshop');
            ?>
</a>
				<?php 
        }
        ?>
				<a href="admin.php?page=jigoshop&amp;month=<?php 
        echo $current_month_offset - 1;
        ?>
" class="previous"><?php 
        _e('&larr; Previous Month', 'jigoshop');
        ?>
</a>
			</p>

			<div class="inside">
				<div id="placeholder" style="width:100%; height:300px; position:relative;"></div>
				<script type="text/javascript">
					/* <![CDATA[ */
					jQuery(function(){
						function weekendAreas(axes){
							var markings = [];
							var d = new Date(axes.xaxis.min);
							// go to the first Saturday
							d.setUTCDate(d.getUTCDate() - ((d.getUTCDay() + 1) % 7))
							d.setUTCSeconds(0);
							d.setUTCMinutes(0);
							d.setUTCHours(0);
							var i = d.getTime();
							do {
								// when we don't set yaxis, the rectangle automatically
								// extends to infinity upwards and downwards
								markings.push({ xaxis: { from: i, to: i + 2 * 24 * 60 * 60 * 1000 } });
								i += 7 * 24 * 60 * 60 * 1000;
							} while(i < axes.xaxis.max);
							return markings;
						}

						<?php 
        function orders_this_month($where = '')
        {
            global $current_month_offset;
            $month = $current_month_offset;
            $year = (int) date('Y');
            $first_day = strtotime("{$year}-{$month}-01");
            $last_day = strtotime('-1 second', strtotime('+1 month', $first_day));
            $after = date('Y-m-d H:i:s', $first_day);
            $before = date('Y-m-d H:i:s', $last_day);
            $where .= " AND post_date >= '{$after}'";
            $where .= " AND post_date <= '{$before}'";
            return $where;
        }
        add_filter('posts_where', 'orders_this_month');
        $args = array('numberposts' => -1, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'shop_order', 'post_status' => 'publish', 'suppress_filters' => false);
        $orders = get_posts($args);
        $order_counts = array();
        $order_amounts = array();
        // Blank date ranges to begin
        $month = $current_month_offset;
        $year = (int) date('Y');
        $first_day = strtotime("{$year}-{$month}-01");
        $last_day = strtotime('-1 second', strtotime('+1 month', $first_day));
        if (date('m') - $current_month_offset == 0) {
            $up_to = date('d', strtotime('NOW'));
        } else {
            $up_to = date('d', $last_day);
        }
        $count = 0;
        while ($count < $up_to) {
            $time = strtotime(date('Ymd', strtotime('+ ' . $count . ' DAY', $first_day))) . '000';
            $order_counts[$time] = 0;
            $order_amounts[$time] = 0;
            $count++;
        }
        if ($orders) {
            foreach ($orders as $order) {
                $order_data = new jigoshop_order($order->ID);
                if ($order_data->status == 'cancelled' || $order_data->status == 'refunded') {
                    continue;
                }
                $time = strtotime(date('Ymd', strtotime($order->post_date))) . '000';
                if (isset($order_counts[$time])) {
                    $order_counts[$time]++;
                } else {
                    $order_counts[$time] = 1;
                }
                if (isset($order_amounts[$time])) {
                    $order_amounts[$time] = $order_amounts[$time] + $order_data->order_total;
                } else {
                    $order_amounts[$time] = (double) $order_data->order_total;
                }
            }
        }
        remove_filter('posts_where', 'orders_this_month');
        ?>
						var d = [
							<?php 
        $values = array();
        foreach ($order_counts as $key => $value) {
            $values[] = "[{$key}, {$value}]";
        }
        echo implode(',', $values);
        ?>
						];
						for(var i = 0; i < d.length; ++i) d[i][0] += 60 * 60 * 1000;
						var d2 = [
							<?php 
        $values = array();
        foreach ($order_amounts as $key => $value) {
            $values[] = "[{$key}, {$value}]";
        }
        echo implode(',', $values);
        ?>
						];
						for(var i = 0; i < d2.length; ++i) d2[i][0] += 60 * 60 * 1000;
						var plot = jQuery.plot(jQuery("#placeholder"), [
							{ label: "<?php 
        __('Number of sales', 'jigoshop');
        ?>
", data: d },
							{ label: "<?php 
        __('Sales amount', 'jigoshop');
        ?>
", data: d2, yaxis: 2 }
						], {
							series: {
								lines: { show: true },
								points: { show: true }
							},
							grid: {
								show: true,
								aboveData: false,
								color: '#ccc',
								backgroundColor: '#fff',
								borderWidth: 2,
								borderColor: '#ccc',
								clickable: false,
								hoverable: true,
								markings: weekendAreas
							},
							xaxis: {
								mode: "time",
								timeformat: "%d %b",
								tickLength: 1,
								minTickSize: [1, "day"]
							},
							yaxes: [
								{ min: 0, tickDecimals: 0 },
								{ position: "right", min: 0, tickDecimals: 2 }
							],
							colors: ["#21759B", "#ed8432"]
						});

						function showTooltip(x, y, contents){
							jQuery('<div id="tooltip">' + contents + '</div>').css({
								position: 'absolute',
								display: 'none',
								top: y + 5,
								left: x + 5,
								border: '1px solid #fdd',
								padding: '2px',
								'background-color': '#fee',
								opacity: 0.80
							}).appendTo("body").fadeIn(200);
						}

						var previousPoint = null;
						jQuery("#placeholder").bind("plothover", function(event, pos, item){
							if(item){
								if(previousPoint != item.dataIndex){
									previousPoint = item.dataIndex;
									jQuery("#tooltip").remove();
									if(item.series.label == "<?php 
        __('Number of sales', 'jigoshop');
        ?>
"){
										var y = item.datapoint[1];
										showTooltip(item.pageX, item.pageY, item.series.label + " - " + y);
									} else {
										var y = item.datapoint[1].toFixed(2);
										showTooltip(item.pageX, item.pageY, item.series.label + " - <?php 
        echo get_jigoshop_currency_symbol();
        ?>
" + y);
									}
								}
							}
							else {
								jQuery("#tooltip").remove();
								previousPoint = null;
							}
						});
					});
					/* ]]> */
				</script>
			</div>
		</div>
	<?php 
    }