Ejemplo n.º 1
0
/**
 * Returns HTML for Digital Download UI
 *
 * @param int $product_id
 * @return HTML
 */
function wpsc_select_product_file($product_id = null)
{
    global $wpdb;
    $product_id = absint($product_id);
    $file_list = wpsc_uploaded_files();
    $args = array('post_type' => 'wpsc-product-file', 'post_parent' => $product_id, 'numberposts' => -1, 'post_status' => 'all');
    $attached_files = (array) get_posts($args);
    $output = '<table id="wpsc_digital_download_table" class="wp-list-table widefat posts select_product_file">';
    $output .= '<thead>';
    $output .= '<tr>';
    $output .= '<th>' . _x('Title', 'Digital download UI', 'wp-e-commerce') . '</th>';
    $output .= '<th>' . _x('Size', 'Digital download UI', 'wp-e-commerce') . '</th>';
    $output .= '<th>' . _x('File Type', 'Digital download UI', 'wp-e-commerce') . '</th>';
    $output .= '<th id="wpsc_digital_download_action_th">' . _x('Actions', 'Digital download UI', 'wp-e-commerce') . '</th>';
    $output .= '</tr>';
    $output .= '</thead>';
    $output .= '<tfoot>';
    $output .= '<tr>';
    $output .= '<th>' . _x('Title', 'Digital download UI', 'wp-e-commerce') . '</th>';
    $output .= '<th>' . _x('Size', 'Digital download UI', 'wp-e-commerce') . '</th>';
    $output .= '<th>' . _x('File Type', 'Digital download UI', 'wp-e-commerce') . '</th>';
    $output .= '<th id="wpsc_digital_download_action_th">' . _x('Actions', 'Digital download UI', 'wp-e-commerce') . '</th>';
    $output .= '</tr>';
    $output .= '</tfoot>';
    $num = 0;
    $output .= '<tbody>';
    $delete_nonce = _wpsc_create_ajax_nonce('delete_file');
    foreach ((array) $attached_files as $file) {
        $file_dir = WPSC_FILE_DIR . $file->post_title;
        $file_size = 'http://s3file' == $file->guid ? __('Remote file sizes cannot be calculated', 'wp-e-commerce') : wpsc_convert_byte(filesize($file_dir));
        $file_url = add_query_arg(array('wpsc_download_id' => $file->ID, '_wpnonce' => wp_create_nonce('wpsc-admin-download-file-' . $file->ID)), admin_url());
        $deletion_url = wp_nonce_url("admin.php?wpsc_admin_action=delete_file&amp;file_name={$file->post_title}&amp;product_id={$product_id}&amp;row_number={$num}", 'delete_file_' . $file->post_title);
        $class = !wpsc_is_odd($num) ? 'alternate' : '';
        $file_type = get_post_mime_type($file->ID);
        $icon_url = wp_mime_type_icon($file_type);
        $output .= '<tr class="wpsc_product_download_row ' . $class . '">';
        $output .= '<td style="padding-right: 30px;"><img src="' . $icon_url . '"><span>' . $file->post_title . '</span></td>';
        $output .= '<td>' . $file_size . '</td>';
        $output .= '<td>' . $file_type . '</td>';
        $output .= '<td><a href="' . esc_url($file_url) . '">' . _x('Download', 'Digital download row UI', 'wp-e-commerce') . '</a><a data-file-name="' . esc_attr($file->post_title) . '" data-product-id="' . esc_attr($product_id) . '" data-nonce="' . esc_attr($delete_nonce) . '" class="file_delete_button" href="' . $deletion_url . '" >' . _x("Delete", "Digital download row UI", 'wp-e-commerce') . '</a></td>';
        $output .= '</tr>';
        $num++;
    }
    $output .= '</tbody>';
    $output .= '</table>';
    if (empty($attached_files)) {
        $output .= "<p class='no-item'>" . __('There are no files attached to this product. Upload a new file or select from other product files.', 'wp-e-commerce') . "</p>";
    }
    $output .= "<div class='" . (is_numeric($product_id) ? 'edit_' : '') . "select_product_handle'></div>";
    $output .= "<script type='text/javascript'>\r\n";
    $output .= "var select_min_height = " . 25 * 3 . ";\r\n";
    $output .= "var select_max_height = " . 25 * ($num + 1) . ";\r\n";
    $output .= "</script>";
    return $output;
}
Ejemplo n.º 2
0
/**
 * Includes the JS and CSS
 *
 * @param string    $pagehook     The pagehook for the currently viewing page, provided by the 'admin_enqueue_scripts' action
 *
 * @uses wp_admin_css()               Enqueues or prints a stylesheet in the admin
 * @uses wp_enqueue_script()          Enqueues the specified script
 * @uses wp_localize_script()         Sets up the JS vars needed
 * @uses wp_enqueue_style()           Enqueues the styles
 * @uses wp_dequeue_script()          Removes a previously enqueued script by handle
 * @uses _wpsc_create_ajax_nonce()    Alias for wp_create_nonce, creates a random one time use token
 */
function wpsc_admin_include_css_and_js_refac($pagehook)
{
    global $post_type, $post;
    $current_screen = get_current_screen();
    if ('dashboard_page_wpsc-sales-logs' == $current_screen->id) {
        // jQuery
        wp_enqueue_script('jquery');
        wp_enqueue_script('jquery-ui-draggable');
        wp_enqueue_script('jquery-ui-droppable');
        wp_enqueue_script('jquery-ui-sortable');
        // Metaboxes
        wp_enqueue_script('common');
        wp_enqueue_script('wp-lists');
        wp_enqueue_script('postbox');
    }
    $version_identifier = WPSC_VERSION . "." . WPSC_MINOR_VERSION;
    $pages = array('index.php', 'options-general.php', 'edit.php', 'post.php', 'post-new.php');
    if (in_array($pagehook, $pages) && $post_type == 'wpsc-product' || $current_screen->id == 'edit-wpsc_product_category' || $current_screen->id == 'dashboard_page_wpsc-sales-logs' || $current_screen->id == 'dashboard_page_wpsc-purchase-logs' || $current_screen->id == 'settings_page_wpsc-settings' || $current_screen->id == 'wpsc-product_page_wpsc-edit-coupons' || $current_screen->id == 'edit-wpsc-variation' || $current_screen->id == 'wpsc-product-variations-iframe' || $pagehook == 'media-upload-popup' && get_post_type($_REQUEST['post_id']) == 'wpsc-product') {
        _wpsc_enqueue_wp_e_commerce_admin();
        wp_enqueue_script('livequery', WPSC_URL . '/wpsc-admin/js/jquery.livequery.js', array('jquery'), '1.0.3');
        wp_enqueue_script('wp-e-commerce-admin', WPSC_URL . '/wpsc-admin/js/admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-sortable'), $version_identifier, false);
        wp_enqueue_script('wpsc-sortable-table', WPSC_URL . '/wpsc-admin/js/sortable-table.js', array('jquery'));
        if (in_array($current_screen->id, array('wpsc-product', 'edit-wpsc-variation', 'wpsc-product'))) {
            wp_enqueue_script('wp-e-commerce-variations', WPSC_URL . '/wpsc-admin/js/variations.js', array('jquery', 'wpsc-sortable-table'), $version_identifier);
            wp_localize_script('wp-e-commerce-variations', 'WPSC_Variations', array('thickbox_title' => __('Add Media - %s', 'wpsc')));
        }
        wp_enqueue_style('wp-e-commerce-admin', WPSC_URL . '/wpsc-admin/css/admin.css', false, $version_identifier, 'all');
        // Localize scripts
        wp_localize_script('wp-e-commerce-admin', 'wpsc_adminL10n', array('dragndrop_set' => get_option('wpsc_sort_by') == 'dragndrop' ? 'true' : 'false', 'save_product_order_nonce' => _wpsc_create_ajax_nonce('save_product_order'), 'l10n_print_after' => 'try{convertEntities(wpsc_adminL10n);}catch(e){};', 'empty_coupon' => esc_html__('Please enter a coupon code.', 'wpsc'), 'bulk_edit_no_vars' => esc_html__('Quick Edit options are limited when editing products that have variations. You will need to edit the variations themselves.', 'wpsc'), 'wpsc_core_images_url' => WPSC_CORE_IMAGES_URL, 'variation_parent_swap' => esc_html_x('New Variation Set', 'Variation taxonomy parent', 'wpsc'), 'variation_helper_text' => esc_html_x('Choose the Variation Set you want to add variants to. If you\'re creating a new variation set then select', 'Variation helper text', 'wpsc'), 'variations_tutorial' => esc_html__('Variations allow you to create options for your products. For example, if you\'re selling T-Shirts, they will generally have a "Size" option. Size will be the Variation Set name, and it will be a "New Variant Set". You will then create variants (small, medium, large) which will have the "Variation Set" of Size. Once you have made your set you can use the table on the right to manage them (edit, delete). You will be able to order your variants by dragging and dropping them within their Variation Set.', 'wpsc'), 'coupons_compare_or' => esc_html_x('OR', 'Coupon comparison logic', 'wpsc'), 'coupons_compare_and' => esc_html_x('AND', 'Coupon comparison logic', 'wpsc'), 'meta_downloads_plural' => __(' downloads', 'live preview for downloads metabox', 'wpsc'), 'meta_downloads_singular' => __(' download', 'live preview for downloads metabox', 'wpsc')));
    }
    if ($pagehook == 'wpsc-product-variations-iframe') {
        _wpsc_enqueue_wp_e_commerce_admin();
        wp_enqueue_script('wp-e-commerce-product-variations', WPSC_URL . '/wpsc-admin/js/product-variations.js', array('jquery'), $version_identifier);
        wp_localize_script('wp-e-commerce-product-variations', 'WPSC_Product_Variations', array('product_id' => $_REQUEST['product_id'], 'add_variation_set_nonce' => _wpsc_create_ajax_nonce('add_variation_set')));
    }
    if ($pagehook == 'media-upload-popup') {
        $post = get_post($_REQUEST['post_id']);
        if ($post->post_type == 'wpsc-product' && $post->post_parent) {
            _wpsc_enqueue_wp_e_commerce_admin();
            wp_dequeue_script('set-post-thumbnail');
            wp_enqueue_script('wpsc-set-post-thumbnail', WPSC_URL . '/wpsc-admin/js/set-post-thumbnail.js', array('jquery', 'wp-e-commerce-admin'), $version_identifier);
            wp_localize_script('wpsc-set-post-thumbnail', 'WPSC_Set_Post_Thumbnail', array('link_text' => __('Use as Product Thumbnail', 'wpsc'), 'saving' => __('Saving...'), 'error' => __('Could not set that as the thumbnail image. Try a different attachment.'), 'done' => __('Done'), 'nonce' => _wpsc_create_ajax_nonce('set_variation_product_thumbnail')));
        }
    }
    if ('dashboard_page_wpsc-upgrades' == $pagehook || 'dashboard_page_wpsc-update' == $pagehook) {
        wp_enqueue_style('wp-e-commerce-admin', WPSC_URL . '/wpsc-admin/css/admin.css', false, $version_identifier, 'all');
    }
}
Ejemplo n.º 3
0
function wpsc_product_files_existing()
{
    //List all product_files, with checkboxes
    $product_id = absint($_GET["product_id"]);
    $file_list = wpsc_uploaded_files();
    $args = array('post_type' => 'wpsc-product-file', 'post_parent' => $product_id, 'numberposts' => -1, 'post_status' => 'all');
    $attached_files = (array) get_posts($args);
    foreach ($attached_files as $key => $attached_file) {
        $attached_files_by_file[$attached_file->post_title] =& $attached_files[$key];
    }
    $output = "<span class='admin_product_notes select_product_note '>" . esc_html__('Choose a downloadable file for this product:', 'wpsc') . "</span><br>";
    $output .= "<form method='post' class='product_upload'>";
    $output .= '<div class="ui-widget-content multiple-select select_product_file" style="width:100%">';
    $num = 0;
    foreach ((array) $file_list as $file) {
        $num++;
        $checked_curr_file = "";
        if (isset($attached_files_by_file[$file['display_filename']])) {
            $checked_curr_file = "checked='checked'";
        }
        $output .= "<p " . ($num % 2 > 0 ? '' : "class='alt'") . " id='select_product_file_row_{$num}'>\n";
        $output .= "  <input type='checkbox' name='select_product_file[]' value='" . $file['real_filename'] . "' id='select_product_file_{$num}' " . $checked_curr_file . " />\n";
        $output .= "  <label for='select_product_file_{$num}'>" . $file['display_filename'] . "</label>\n";
        $output .= "</p>\n";
    }
    $output .= "</div>";
    $output .= "<input type='hidden' id='hidden_id' value='{$product_id}' />";
    $output .= "<input data-nonce='" . _wpsc_create_ajax_nonce('upload_product_file') . "' type='submit' name='save' name='product_files_submit' class='button-primary prdfil' value='" . esc_html__('Save Product Files', 'wpsc') . "' />";
    $output .= "</form>";
    $output .= "<div class='" . (is_numeric($product_id) ? "edit_" : "") . "select_product_handle'><div></div></div>";
    $output .= "<script type='text/javascript'>\n\r";
    $output .= "var select_min_height = " . 25 * 3 . ";\n\r";
    $output .= "var select_max_height = " . 25 * ($num + 1) . ";\n\r";
    $output .= "</script>";
    echo $output;
}
Ejemplo n.º 4
0
/**
 * Save a downloadable file to a product
 *
 * @since 3.8.9
 * @access private
 *
 * @uses $wpdb                          WordPress database object for use in queries
 * @uses _wpsc_create_ajax_nonce()      Creates nonce for an ajax action
 * @uses wpsc_get_mimetype()            Returns mimetype of file
 * @uses wp_insert_post()               Inserts post to WordPress database
 * @uses wp_nonce_url()                 Retrieve URL with nonce added to URL query.
 * @uses wpsc_convert_bytes()           Formats bytes
 * @uses wpsc_get_extension()           Gets extension of file
 * @uses esc_attr()                     Escapes HTML attributes
 * @uses _x()                           Retrieve translated string with gettext context
 *
 * @return array|WP_Error Response args if successful, WP_Error if otherwise.
 */
function _wpsc_ajax_upload_product_file()
{
    global $wpdb;
    $product_id = absint($_POST["product_id"]);
    $output = '';
    $delete_nonce = _wpsc_create_ajax_nonce('delete_file');
    foreach ($_POST["select_product_file"] as $selected_file) {
        // if we already use this file, there is no point doing anything more.
        $sql = $wpdb->prepare("SELECT * FROM {$wpdb->posts} WHERE post_type = 'wpsc-product-file' AND post_title = %s", $selected_file);
        // TODO it's safer to select by post ID, in that case we will use get_posts()
        $file_post_data = $wpdb->get_row($sql, ARRAY_A);
        $selected_file_path = WPSC_FILE_DIR . basename($selected_file);
        $file_url = WPSC_FILE_URL . basename($selected_file);
        $file_size = filesize($selected_file_path);
        if (empty($file_post_data)) {
            $type = wpsc_get_mimetype($selected_file_path);
            $attachment = array('post_mime_type' => $type, 'post_parent' => $product_id, 'post_title' => $selected_file, 'post_content' => '', 'post_type' => "wpsc-product-file", 'post_status' => 'inherit');
            $id = wp_insert_post($attachment);
        } else {
            // already attached
            if ($file_post_data['post_parent'] == $product_id) {
                continue;
            }
            $type = $file_post_data["post_mime_type"];
            $url = $file_post_data["guid"];
            $title = $file_post_data["post_title"];
            $content = $file_post_data["post_content"];
            // Construct the attachment
            $attachment = array('post_mime_type' => $type, 'guid' => $url, 'post_parent' => absint($product_id), 'post_title' => $title, 'post_content' => $content, 'post_type' => "wpsc-product-file", 'post_status' => 'inherit');
            // Save the data
            $id = wp_insert_post($attachment);
        }
        $deletion_url = wp_nonce_url("admin.php?wpsc_admin_action=delete_file&amp;file_name={$attachment['post_title']}&amp;product_id={$product_id}", 'delete_file_' . $attachment['post_title']);
        $output .= '<tr class="wpsc_product_download_row">';
        $output .= '<td style="padding-right: 30px;">' . $attachment['post_title'] . '</td>';
        $output .= '<td>' . wpsc_convert_byte($file_size) . '</td>';
        $output .= '<td>.' . wpsc_get_extension($attachment['post_title']) . '</td>';
        $output .= "<td><a data-file-name='" . esc_attr($attachment['post_title']) . "' data-product-id='" . esc_attr($product_id) . "' data-nonce='" . esc_attr($delete_nonce) . "' class='file_delete_button' href='{$deletion_url}' >" . _x('Delete', 'Digital Download UI row', 'wpsc') . "</a></td>";
        $output .= '<td><a href=' . $file_url . '>' . _x('Download', 'Digital Download UI row', 'wpsc') . '</a></td>';
        $output .= '</tr>';
    }
    return array('content' => $output);
}
Ejemplo n.º 5
0
/**
 * Product Custom Metadata Form
 *
 * @global  $post  Instance of WP_Post.
 * @global  $wpdb  Instance of wpdb.
 */
function wpsc_product_advanced_forms()
{
    global $post, $wpdb;
    $delete_nonce = _wpsc_create_ajax_nonce('remove_product_meta');
    $custom_fields = $wpdb->get_results("\n\t\tSELECT\n\t\t\t`meta_id`, `meta_key`, `meta_value`\n\t\tFROM\n\t\t\t`{$wpdb->postmeta}`\n\t\tWHERE\n\t\t\t`post_id` = {$post->ID}\n\t\tAND\n\t\t\t`meta_key` NOT LIKE '\\_%'\n\t\tORDER BY\n\t\t\tLOWER(meta_key)", ARRAY_A);
    $output = '<table id="wpsc_product_meta_table" class="wp-list-table widefat posts">';
    $output .= '<thead>';
    $output .= '<tr>';
    $output .= '<th id="wpsc_custom_meta_name_th">' . _x('Name', 'Product meta UI', 'wp-e-commerce') . '</th>';
    $output .= '<th id="wpsc_custom_meta_value_th">' . _x('Value', 'Product meta UI', 'wp-e-commerce') . '</th>';
    $output .= '<th id="wpsc_custom_meta_action_th">' . _x('Action', 'Product meta UI', 'wp-e-commerce') . '</th>';
    $output .= '</tr>';
    $output .= '</thead>';
    $output .= '<tfoot>';
    $output .= '<tr>';
    $output .= '<th>' . _x('Name', 'Product meta UI', 'wp-e-commerce') . '</th>';
    $output .= '<th>' . _x('Value', 'Product meta UI', 'wp-e-commerce') . '</th>';
    $output .= '<th>' . _x('Action', 'Product meta UI', 'wp-e-commerce') . '</th>';
    $output .= '</tr>';
    $output .= '</tfood>';
    $output .= '<tbody>';
    if (empty($custom_fields)) {
        $output .= '<tr class="no-meta"><td colspan="3"><p>' . sprintf(__('You have no custom metadata. You can set any arbitrary meta you like and access it programatically via the <a href="">Post Meta API</a>.', 'wp-e-commerce'), esc_url('https://codex.wordpress.org/Function_Reference/get_post_meta')) . '</p></td></tr>';
    } else {
        // Display all available metadata
        $alternate = false;
        foreach ((array) $custom_fields as $custom_field) {
            $i = $custom_field['meta_id'];
            $alternate = !$alternate;
            $output .= '<tr' . ($alternate ? ' class="alternate"' : '') . '>';
            $output .= '<td><input type="text" value="' . esc_attr($custom_field['meta_key']) . '" name="custom_meta[' . $i . '][name]" id="custom_meta_name_' . $i . '"></input></td>';
            $output .= '<td><input type="text" value="' . esc_attr($custom_field['meta_value']) . '" name="custom_meta[' . $i . '][value]" id="custom_meta_value_' . $i . '"></input></td>';
            $output .= '<td><a href="#" data-nonce="' . esc_attr($delete_nonce) . '" class="wpsc_remove_meta" onclick="wpsc_remove_custom_meta(this,' . $i . ')">' . esc_html('Delete', 'wp-e-commerce') . '</a></td>';
            $output .= '</tr>';
        }
    }
    // Template for new metadata input
    $output .= '<tr id="wpsc_new_meta_template">';
    $output .= '<td><input type="text" name="new_custom_meta[name][]"  value=""></input></td>';
    $output .= '<td><input type="text" name="new_custom_meta[value][]" value=""></input></td>';
    $output .= '<td><a href="#" class="wpsc_remove_meta" onclick="wpsc_remove_empty_meta(this)">' . esc_html('Delete', 'wp-e-commerce') . '</a></td>';
    $output .= '</tr>';
    $output .= '</tbody>';
    $output .= '</table>';
    $output .= '<a href="#" class="add_more_meta  button button-small" id="wpsc_add_custom_meta">' . esc_html('+ Add Custom Meta', 'wp-e-commerce') . '</a>';
    echo $output;
}
function wpsc_product_advanced_forms()
{
    global $post, $wpdb, $variations_processor, $wpsc_product_defaults;
    $product_data = get_post_custom($post->ID);
    $product_data['meta'] = $product_meta = array();
    if (!empty($product_data['_wpsc_product_metadata'])) {
        $product_data['meta'] = $product_meta = maybe_unserialize($product_data['_wpsc_product_metadata'][0]);
    }
    $delete_nonce = _wpsc_create_ajax_nonce('remove_product_meta');
    $custom_fields = $wpdb->get_results("\n\t\tSELECT\n\t\t\t`meta_id`, `meta_key`, `meta_value`\n\t\tFROM\n\t\t\t`{$wpdb->postmeta}`\n\t\tWHERE\n\t\t\t`post_id` = {$post->ID}\n\t\tAND\n\t\t\t`meta_key` NOT LIKE '\\_%'\n\t\tORDER BY\n\t\t\tLOWER(meta_key)", ARRAY_A);
    if (!isset($product_meta['engraved'])) {
        $product_meta['engraved'] = '';
    }
    if (!isset($product_meta['can_have_uploaded_image'])) {
        $product_meta['can_have_uploaded_image'] = '';
    }
    ?>

        <table>
            <tr>
                <td colspan='2' class='itemfirstcol'>
                    <strong><?php 
    esc_html_e('Custom Meta', 'wpsc');
    ?>
:</strong><br />
                    <a href='#' class='add_more_meta' onclick="return add_more_meta(this)"><?php 
    esc_html_e('+ Add Custom Meta', 'wpsc');
    ?>
 </a><br /><br />

                    <?php 
    foreach ((array) $custom_fields as $custom_field) {
        $i = $custom_field['meta_id'];
        ?>
                            <div class='product_custom_meta'  id='custom_meta_<?php 
        echo $i;
        ?>
'>
                                    <?php 
        esc_html_e('Name', 'wpsc');
        ?>
                                    <input type='text' class='text'  value='<?php 
        echo $custom_field['meta_key'];
        ?>
' name='custom_meta[<?php 
        echo $i;
        ?>
][name]' id='custom_meta_name_<?php 
        echo $i;
        ?>
'>
                                    <?php 
        esc_html_e('Value', 'wpsc');
        ?>
                                    <textarea class='text' name='custom_meta[<?php 
        echo $i;
        ?>
][value]' id='custom_meta_value_<?php 
        echo $i;
        ?>
'><?php 
        echo esc_textarea($custom_field['meta_value']);
        ?>
</textarea>
                                    <a href='#' data-nonce="<?php 
        echo esc_attr($delete_nonce);
        ?>
" class='remove_meta' onclick='return remove_meta(this, <?php 
        echo $i;
        ?>
)'><?php 
        esc_html_e('Delete', 'wpsc');
        ?>
</a>
                                    <br />
                            </div>
                    <?php 
    }
    ?>
				<div class='product_custom_meta'>
					<?php 
    esc_html_e('Name', 'wpsc');
    ?>
: <br />
					<input type='text' name='new_custom_meta[name][]' value='' class='text'/><br />
					<?php 
    esc_html_e('Description', 'wpsc');
    ?>
: <br />
					<textarea name='new_custom_meta[value][]' cols='40' rows='10' class='text' ></textarea>
					<br />
				</div>
			</td>
		</tr>
		<tr>
			<td class='itemfirstcol' colspan='2'><br /> <strong><?php 
    esc_html_e('Merchant Notes:', 'wpsc');
    ?>
</strong><br />

			<textarea cols='40' rows='3' name='meta[_wpsc_product_metadata][merchant_notes]' id='merchant_notes'><?php 
    if (isset($product_meta['merchant_notes'])) {
        echo esc_textarea(trim($product_meta['merchant_notes']));
    }
    ?>
</textarea>
			<small><?php 
    esc_html_e('These notes are only available here.', 'wpsc');
    ?>
</small>
		</td>
	</tr>
	<tr>
		<td class='itemfirstcol' colspan='2'><br />
			<strong><?php 
    esc_html_e('Personalisation Options', 'wpsc');
    ?>
:</strong><br />
			<input type='hidden' name='meta[_wpsc_product_metadata][engraved]' value='0' />
			<input type='checkbox' name='meta[_wpsc_product_metadata][engraved]' <?php 
    echo $product_meta['engraved'] == true ? 'checked="checked"' : '';
    ?>
 id='add_engrave_text' />
			<label for='add_engrave_text'><?php 
    esc_html_e('Users can personalize this Product by leaving a message on single product page', 'wpsc');
    ?>
</label>
			<br />
		</td>
	</tr>
	<tr>
		<td class='itemfirstcol' colspan='2'>
			<input type='hidden' name='meta[_wpsc_product_metadata][can_have_uploaded_image]' value='0' />
			<input type='checkbox' name='meta[_wpsc_product_metadata][can_have_uploaded_image]' <?php 
    echo $product_meta['can_have_uploaded_image'] == true ? 'checked="checked"' : '';
    ?>
 id='can_have_uploaded_image' />
			<label for='can_have_uploaded_image'> <?php 
    esc_html_e('Users can upload images on single product page to purchase logs.', 'wpsc');
    ?>
 </label>
			<br />
		</td>
	</tr>
        <?php 
    if (get_option('payment_gateway') == 'google') {
        ?>
	<tr>
		<td class='itemfirstcol' colspan='2'>

			<input type='checkbox' <?php 
        echo $product_meta['google_prohibited'];
        ?>
 name='meta[_wpsc_product_metadata][google_prohibited]' id='add_google_prohibited' /> <label for='add_google_prohibited'>
			<?php 
        esc_html_e('Prohibited <a href="http://checkout.google.com/support/sell/bin/answer.py?answer=75724">by Google?</a>', 'wpsc');
        ?>
			</label><br />
		</td>
	</tr>
	<?php 
    }
    do_action('wpsc_add_advanced_options', $post->ID);
    ?>
	<tr>
		<td class='itemfirstcol' colspan='2'><br />
			<strong><?php 
    esc_html_e('Enable Comments', 'wpsc');
    ?>
:</strong><br />
			<select name='meta[_wpsc_product_metadata][enable_comments]'>
				<option value='' <?php 
    echo isset($product_meta['enable_comments']) && $product_meta['enable_comments'] == '' ? 'selected' : '';
    ?>
 ><?php 
    esc_html_e('Use Default', 'wpsc');
    ?>
</option>
				<option value='1' <?php 
    echo isset($product_meta['enable_comments']) && $product_meta['enable_comments'] == '1' ? 'selected' : '';
    ?>
 ><?php 
    esc_html_e('Yes', 'wpsc');
    ?>
</option>
				<option value='0' <?php 
    echo isset($product_meta['enable_comments']) && $product_meta['enable_comments'] == '0' ? 'selected' : '';
    ?>
 ><?php 
    esc_html_e('No', 'wpsc');
    ?>
</option>
			</select>
			<br/><?php 
    esc_html_e('Allow users to comment on this Product.', 'wpsc');
    ?>
		</td>
	</tr>
    </table>
<?php 
}