/** * WordPress Enqueue for the Pro Script and CSS file * * @return void * * @since 3.9 */ public static function pro_script() { if (wpsc_is_checkout()) { $pro_loc = array('spinner_url' => wpsc_get_ajax_spinner(), 'loading' => __('Loading...', 'wp-e-commerce')); wp_enqueue_script('pro-script-internal', WPSC_URL . '/wpsc-components/merchant-core-v3/gateways/pro.js', array('jquery')); wp_enqueue_style('pro-style-internal', WPSC_URL . '/wpsc-components/merchant-core-v3/gateways/pro.css'); wp_localize_script('pro-script-internal', 'pro_loc', $pro_loc); } }
/** * Get the unique names used in checkout forms * * @since 3.8.14 * @access private * * @return array local variables to add to both admin and front end WPEC javascript */ function wpsc_javascript_localizations($localizations = false) { if (!is_array($localizations)) { $localizations = array(); } // The default localizations should only be added once per page as we don't want them to be // defined more than once in the javascript. static $already_added_default_localizations = false; if (!$already_added_default_localizations) { $localizations['wpsc_ajax'] = array('ajaxurl' => admin_url('admin-ajax.php', 'relative'), 'spinner' => esc_url(wpsc_get_ajax_spinner()), 'no_quotes' => __('It appears that there are no shipping quotes for the shipping information provided. Please check the information and try again.', 'wpsc'), 'ajax_get_cart_error' => __('There was a problem getting the current contents of the shopping cart.', 'wpsc'), 'slide_to_shipping_error' => true); $localizations['base_url'] = site_url(); $localizations['WPSC_URL'] = WPSC_URL; $localizations['WPSC_IMAGE_URL'] = WPSC_IMAGE_URL; $localizations['WPSC_CORE_IMAGES_URL'] = WPSC_CORE_IMAGES_URL; $localizations['fileThickboxLoadingImage'] = WPSC_CORE_IMAGES_URL . '/loadingAnimation.gif'; $localizations['msg_shipping_need_recalc'] = __('Please click the <em>Calculate</em> button to refresh your shipping quotes, as your shipping information has been modified.', 'wpsc'); } /** * a filter for WPeC components, plugins and themes to alter or add to what is localized into the WPeC javascript. * * @since 3.8.14 * * @access public * * @param array $localizations array of localizations being sent to the javascript * */ return apply_filters('wpsc_javascript_localizations', $localizations); }
private function gateway_list_item($gateway, $force) { $checked = in_array($gateway['id'], $this->active_gateways); $active = $checked ? 'active' : 'inactive'; $hidden = $force ? '' : "style='display: none;'"; $edithidden = $hidden; $payment_gateway_names = get_option('payment_gateway_names'); $display_name = isset($payment_gateway_names[$gateway['id']]) ? $payment_gateway_names[$gateway['id']] : ''; $gateway_data = false; ?> <tr class="wpsc-select-gateway <?php echo $active; ?> " data-gateway-id="<?php echo esc_attr($gateway['id']); ?> " id="gateway_list_item_<?php echo $gateway['id']; ?> "> <th scope="row" class="check-column"> <label class="screen-reader-text" for="<?php echo esc_attr($gateway['id']); ?> _id"><?php _e("Select", 'wp-e-commerce'); ?> <?php echo esc_html($gateway['name']); ?> </label> <input name='wpsc_options[custom_gateway_options][]' <?php checked($checked); ?> type='checkbox' value='<?php echo esc_attr($gateway['id']); ?> ' id='<?php echo esc_attr($gateway['id']); ?> _id' /> </th> <td class="plugin-title"> <label for='<?php echo esc_attr($gateway['id']); ?> _id'><strong><?php echo esc_html($gateway['name']); ?> </strong></label> <div class="row-actions-visible"> <span class="edit"> <a class='edit-payment-module' title="<?php esc_attr_e("Edit this Payment Gateway's Settings", 'wp-e-commerce'); ?> " href='<?php echo esc_url($this->get_gateway_settings_url($gateway['id'])); ?> '><?php esc_html_e('Settings', 'wp-e-commerce'); ?> </a> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-feedback" title="" alt="" /> </span> </div> </td> <td class="plugin-description"> <?php echo esc_html($display_name); ?> </td> </tr> <tr id="wpsc_gateway_settings_<?php echo esc_attr($gateway['id']); ?> " data-gateway-id="<?php echo esc_attr($gateway['id']); ?> " class='gateway_settings <?php echo $active; ?> ' <?php echo $hidden; ?> > <td colspan="3" id="wpsc_gateway_settings_<?php echo esc_attr($gateway['id']); ?> _container"> <?php if ($force) { $this->display_payment_gateway_settings_form($gateway['id']); } ?> </td> </tr> <?php }
public function display_tablenav($which) { global $tab; if ($tab === 'account') { return; } if (!Sputnik::account_is_linked()) { return; } $account = Sputnik::get_account(); if ('top' == $which) { ?> <div class="tablenav top"> <div class="alignright actions"> <?php if (in_array($tab, array('dashboard', 'search'))) { ?> <?php Sputnik_Admin::search_form(); } switch ($this->view) { case 'list': $view = 'grid'; $name = __('Grid', 'wp-e-commerce'); break; case 'grid': $view = 'list'; $name = __('List', 'wp-e-commerce'); break; } ?> <!--<a href="<?php echo add_query_arg('view', $view); ?> " class="view-as-<?php echo $view; ?> button"><?php echo $name; ?> </a>--> </div> <?php $this->pagination($which); ?> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-loading list-ajax-loading" alt="" /> <br class="clear" /> </div> <?php } else { ?> <div class="tablenav bottom"> <?php $this->pagination($which); ?> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-loading list-ajax-loading" alt="" /> <br class="clear" /> </div> <?php } }
private function shipping_list_item($shipping, $force) { //get shipping options that are selected $selected_shippings = get_option('custom_shipping_options'); $shipping->checked = is_object($shipping) && in_array($shipping->getInternalName(), (array) $selected_shippings); $shipping->active = $shipping->checked ? 'active' : 'inactive'; $shipping->hidden = $force ? '' : "style='display: none;'"; $shipping->disabled = isset($shipping->requires_curl) && $shipping->requires_curl && !function_exists('curl_init'); ?> <tr class="wpsc-select-shipping <?php echo $shipping->active; ?> " data-shipping-id="<?php echo esc_attr($shipping->getInternalName()); ?> " id="shipping_list_item_<?php echo $shipping->getInternalName(); ?> "> <th scope="row" class="check-column"> <input name='custom_shipping_options[]' <?php disabled($shipping->disabled); ?> <?php checked($shipping->checked); ?> type='checkbox' value='<?php echo $shipping->getInternalName(); ?> ' id='<?php echo $shipping->getInternalName(); ?> _id' /> </th> <td class="plugin-title"> <label for='<?php echo $shipping->getInternalName(); ?> _id'><strong><?php echo $shipping->getName(); ?> </strong></label> <div class="row-actions-visible"> <span class="edit"> <a class='edit-shipping-module' data-module-id="<?php echo $shipping->getInternalName(); ?> " title="<?php esc_attr_e('Edit this Shipping Module', 'wp-e-commerce'); ?> " href='<?php echo esc_url($this->get_shipping_module_url($shipping)); ?> '><?php _ex('Settings', 'Shipping modules link to individual settings', 'wp-e-commerce'); ?> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-feedback" title="" alt="" /> </span> </div> </td> </tr> <tr id="wpsc_shipping_settings_<?php echo esc_attr($shipping->getInternalName()); ?> " data-shipping-id="<?php echo esc_attr($shipping->getInternalName()); ?> " class='wpsc-select-shipping <?php echo $shipping->active; ?> ' <?php echo $shipping->hidden; ?> > <td colspan="3" id="wpsc_shipping_settings_<?php echo esc_attr($shipping->getInternalName()); ?> _container"> <?php $this->display_shipping_module_settings_form($shipping->getInternalName()); ?> </td> </tr> <?php }
public function column_tracking($item) { $classes = array('wpsc-purchase-log-tracking-id'); $empty = empty($item->track_id); ?> <div data-log-id="<?php echo esc_attr($item->id); ?> " <?php echo $empty ? ' class="empty"' : ''; ?> > <a class="add" href="#"><?php echo esc_html_x('Add Tracking ID', 'add purchase log tracking id', 'wpsc'); ?> </a> <input type="text" class="wpsc-purchase-log-tracking-id" value="<?php echo esc_attr($item->track_id); ?> " /> <a class="button save" href="#"><?php echo esc_html_x('Save', 'save sales log tracking id', 'wpsc'); ?> </a> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-feedback" title="" alt="" /><br class="clear" /> <small class="send-email"><a href="#"><?php echo esc_html_x('Send Email', 'sales log', 'wpsc'); ?> </a></small> </div> <?php }
/** * generates a row for use in tax settings tables * * @param string specifies mode of row to generate. Options: rates, bands * @param string the key number for the row * @param array tax rate settings (used keys: rate, name, country_code, region_code, shipping, index, row_class) * */ function wpsc_build_taxes_row($row_mode = 'rates', $row_key = 0, $tax_rate = false) { $defaults = array('rate' => null, 'name' => null, 'country_code' => null, 'region_code' => null, 'shipping' => null, 'index' => null, 'row_class' => null); $tax_rate = array_merge($defaults, (array) $tax_rate); $countries = $this->wpec_taxes->wpec_taxes_get_countries(); if (!empty($tax_rate['country_code']) && $tax_rate['country_code'] != 'all-markets') { $selected_country = array('isocode' => $tax_rate['country_code'], 'country' => wpsc_get_country($tax_rate['country_code'])); } else { $selected_country = array('isocode' => 'all-markets', 'country' => __('All Markets', 'wpsc')); } ob_start(); ?> <tr id='wpsc-taxes-<?php esc_attr_e($row_mode); ?> -row-<?php esc_attr_e($row_key); ?> ' data-row-key="<?php esc_attr_e($row_key); ?> " class='wpsc-tax-<?php esc_attr_e($row_mode); ?> -row <?php esc_attr_e($tax_rate['row_class']); ?> '> <?php if ($row_mode == 'bands') { // BAND NAME ?> <td> <input type='hidden' id='band-index-<?php esc_attr_e($row_key); ?> ' name="wpsc_options[wpec_taxes_bands][<?php esc_attr_e($row_key); ?> ][index]" value="<?php esc_attr_e($row_key); ?> " /> <input id='band-name-<?php esc_attr_e($row_key); ?> ' name="wpsc_options[wpec_taxes_bands][<?php esc_attr_e($row_key); ?> ][name]" class='taxes-band' type='text' value='<?php esc_attr_e($tax_rate['name']); ?> ' /> </td> <?php } ?> <td> <?php // MARKET COUNTRY SELECT echo $this->wpec_taxes_build_select_options($countries, 'isocode', 'country', $selected_country, array('id' => $row_mode . "-country-" . $row_key, 'name' => "wpsc_options[wpec_taxes_" . $row_mode . "][" . $row_key . "][country_code]", 'class' => 'wpsc-taxes-country-drop-down', 'data-row-key' => $row_key, 'data-row-mode' => $row_mode)); // MARKET REGION SELECT if (!empty($tax_rate['region_code'])) { $regions = $this->wpec_taxes->wpec_taxes_get_regions($tax_rate['country_code']); if (!empty($regions)) { if ($tax_rate['region_code'] == 'all-markets') { $region_name = 'All Markets'; } else { $region = new WPSC_Region($tax_rate['country_code'], $tax_rate['region_code']); $region_name = $region->get_name(); } echo $this->wpec_taxes_build_select_options($regions, 'region_code', 'name', array('region_code' => $tax_rate['region_code'], 'name' => $region_name), array('id' => $row_mode . "-region-" . $row_key, 'name' => "wpsc_options[wpec_taxes_" . $row_mode . "][" . $row_key . "][region_code]", 'class' => 'wpsc-taxes-region-drop-down')); } } // if ?> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-feedback" title="" alt="" /> </td> <td><?php // TAX RATE ?> <input type='text' size='3' id="<?php esc_attr_e($row_mode); ?> -rate-<?php esc_attr_e($row_key); ?> " name="wpsc_options[wpec_taxes_<?php esc_attr_e($row_mode); ?> ][<?php esc_attr_e($row_key); ?> ][rate]" class="taxes-<?php esc_attr_e($row_mode); ?> " value="<?php esc_attr_e($tax_rate['rate']); ?> " /> % </td> <?php if ($row_mode == 'rates') { // TAX SHIPPING ? ?> <td> <label> <input type='checkbox' id="shipping-<?php esc_attr_e($row_key); ?> " name="wpsc_options[wpec_taxes_<?php esc_attr_e($row_mode); ?> ][<?php esc_attr_e($row_key); ?> ][shipping]" class="taxes-<?php esc_attr_e($row_mode); ?> " <?php checked($tax_rate['shipping'] == 1); ?> /> <?php _e('Apply to Shipping', 'wpsc'); ?> </label> </td> <?php } ?> <?php // ACTIONS ?> <td> <a tabindex="-1" title="<?php _e('Delete Field', 'wpsc'); ?> " class="button-secondary wpsc-button-round wpsc-button-minus wpsc-taxes-<?php esc_attr_e($row_mode); ?> -delete" id="wpsc-taxes-<?php esc_attr_e($row_mode); ?> -delete-<?php esc_attr_e($row_key); ?> " href="#"><?php echo _x('–', 'delete item', 'wpsc'); ?> </a> <a tabindex="-1" title="<?php _e('Add Field', 'wpsc'); ?> " class="button-secondary wpsc-button-round wpsc-button-plus wpsc-taxes-<?php esc_attr_e($row_mode); ?> -add" href="#"><?php echo _x('+', 'add item', 'wpsc'); ?> </a> </td> </tr> <?php return ob_get_clean(); }
/** * WordPress Enqueue for the Dgital Goods Script and CSS file * * @return void * * @since 3.9 */ public static function dg_script() { $dg_loc = array('spinner_url' => wpsc_get_ajax_spinner(), 'loading' => __('Loading...', 'wp-e-commerce')); // Checkout Page if (wpsc_is_checkout()) { wp_enqueue_script('dg-script', 'https://www.paypalobjects.com/js/external/dg.js'); wp_enqueue_script('dg-script-internal', WPSC_URL . '/wpsc-components/merchant-core-v3/gateways/dg.js', array('jquery')); wp_localize_script('dg-script', 'dg_loc', $dg_loc); } // Cart Page if (function_exists('wpsc_is_cart') && wpsc_is_cart()) { wp_enqueue_script('dg-script', 'https://www.paypalobjects.com/js/external/dg.js'); wp_enqueue_script('dg-script-internal', WPSC_URL . '/wpsc-components/merchant-core-v3/gateways/dgs.js', array('jquery')); wp_localize_script('dg-script', 'dg_loc', $dg_loc); } }
/** * Display the settings page. * @since 3.8.8 * @uses esc_html_e() Sanitize HTML * @uses esc_attr() Sanitize HTML attributes * @uses wp_nonce_field() Prevent CSRF * @uses WPSC_Settings_Page::output_tabs() Display tab navigation. * @uses WPSC_Settings_Page::display_current_tab() Display current tab. * @access public */ public function display() { ?> <div id="wpsc_options" class="wrap"> <div id="icon_card" class="icon32"></div> <h2 id="wpsc-settings-page-title"> <?php esc_html_e('Store Settings', 'wpsc'); ?> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-feedback" title="" alt="" /> </h2> <?php $this->output_tabs(); ?> <div id='wpsc_options_page'> <form method='post' action='<?php echo esc_url($this->submit_url()); ?> ' enctype='multipart/form-data' id='wpsc-settings-form'> <?php $this->display_current_tab(); ?> </form> </div> </div> <?php }
public function display() { global $wpdb; ?> <h3><?php echo esc_html_e('General Settings', 'wpsc'); ?> </h3> <table class='wpsc_options form-table'> <tr> <th scope="row"><label for="wpsc-base-country-drop-down"><?php esc_html_e('Base Country/Region', 'wpsc'); ?> </label></th> <td> <?php wpsc_country_dropdown(array('id' => 'wpsc-base-country-drop-down', 'name' => 'wpsc_options[base_country]', 'selected' => get_option('base_country'), 'include_invisible' => true)); ?> <span id='wpsc-base-region-drop-down'> <?php $this->display_region_drop_down(); ?> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-feedback" title="" alt="" /> </span> <p class='description'><?php esc_html_e('Select your primary business location.', 'wpsc'); ?> </p> </td> </tr> <?php /* START OF TARGET MARKET SELECTION */ $countrylist = WPSC_Countries::get_countries_array(true, true); ?> <tr> <th scope="row"> <?php esc_html_e('Target Markets', 'wpsc'); ?> </th> <td> <?php // check for the suhosin module if (wpsc_is_suhosin_enabled()) { echo "<em>" . __("The Target Markets feature has been disabled because you have the Suhosin PHP extension installed on this server. If you need to use the Target Markets feature then disable the suhosin extension, if you can not do this, you will need to contact your hosting provider.", 'wpsc') . "</em>"; } else { ?> <span> <?php printf(__('Select: <a href="%1$s" class="wpsc-select-all" title="All">All</a> <a href="%2$s" class="wpsc-select-none" title="None">None</a>', 'wpsc'), esc_url(add_query_arg(array('selected_all' => 'all'))), esc_url(add_query_arg(array('selected_all' => 'none')))); ?> </span><br /> <div id='wpsc-target-markets' class='ui-widget-content multiple-select'> <?php foreach ((array) $countrylist as $country) { ?> <?php if ($country['visible'] == 1) { ?> <input type='checkbox' id="countrylist2-<?php echo $country['id']; ?> " name='countrylist2[]' value='<?php echo $country['id']; ?> ' checked='checked' /> <label for="countrylist2-<?php echo $country['id']; ?> "><?php esc_html_e($country['country']); ?> </label><br /> <?php } else { ?> <input type='checkbox' id="countrylist2-<?php echo $country['id']; ?> " name='countrylist2[]' value='<?php echo $country['id']; ?> ' /> <label for="countrylist2-<?php echo $country['id']; ?> "><?php esc_html_e($country['country']); ?> </label><br /> <?php } ?> <?php } ?> </div> <p class='description'><?php esc_html_e('Select the markets you are selling products to.', 'wpsc'); ?> </p> <?php } ?> </td> </tr> <?php $stock_keeping_time = wpsc_get_stock_keeping_time(); $stock_keeping_interval = wpsc_get_stock_keeping_interval(); ?> <tr> <th scope="row"> <label for="wpsc-stock-keeping-time"><?php esc_html_e('Keep stock in cart for', 'wpsc'); ?> </label> </th> <td> <input type="text" name="wpsc_options[wpsc_stock_keeping_time]" id="wpsc-stock-keeping-time" size="2" value="<?php echo esc_attr($stock_keeping_time); ?> " /> <select name="wpsc_options[wpsc_stock_keeping_interval]"> <option value="hour" <?php selected('hour', $stock_keeping_interval); ?> ><?php echo _n('hour', 'hours', $stock_keeping_time, 'wpsc'); ?> </option> <option value="day" <?php selected('day', $stock_keeping_interval); ?> ><?php echo _n('day', 'days', $stock_keeping_time, 'wpsc'); ?> </option> <option value="week" <?php selected('week', $stock_keeping_interval); ?> ><?php echo _n('week', 'weeks', $stock_keeping_time, 'wpsc'); ?> </option> </select> <p class='description'><?php esc_html_e("Set the amount of time items in a customer's cart are reserved. You can also specify decimal amounts such as '0.5 days' or '1.25 weeks'. Note that the minimum interval you can enter is 1 hour, i.e. you can't schedule it to run every 0.5 hour.", 'wpsc'); ?> </p> </td> </tr> <?php $hierarchical_category = get_option('product_category_hierarchical_url', 0); ?> <tr> <th scope="row"> <?php _e('Use Hierarchical Product Category URL', 'wpsc'); ?> </th> <td> <label><input type="radio" <?php checked($hierarchical_category, 1); ?> name="wpsc_options[product_category_hierarchical_url]" value="1" /> <?php _e('Yes', 'wpsc'); ?> </label> <label><input type="radio" <?php checked($hierarchical_category, 0); ?> name="wpsc_options[product_category_hierarchical_url]" value="0" /> <?php _e('No', 'wpsc'); ?> </label><br /> <p class='description'><?php _e('When Hierarchical Product Category URL is enabled, parent product categories are also included in the product URL.<br />For example: <code>http://example.com/products-page/parent-cat/sub-cat/product-name</code>', 'wpsc'); ?> </p> </td> </tr> </table> <h3 class="form_group"><?php esc_html_e('Currency Settings', 'wpsc'); ?> </h3> <table class='wpsc_options form-table'> <?php $currency_data = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_CURRENCY_LIST . "` ORDER BY `country` ASC", ARRAY_A); $currency_type = esc_attr(get_option('currency_type')); ?> <tr> <th scope="row"><label for="wpsc_options_currency_type"><?php esc_html_e('Currency Type', 'wpsc'); ?> </label></th> <td> <select id="wpsc_options_currency_type" name='wpsc_options[currency_type]' onchange='getcurrency(this.options[this.selectedIndex].value);'> <?php foreach ($currency_data as $currency) { ?> <option value='<?php echo $currency['id']; ?> ' <?php selected($currency['id'], $currency_type); ?> ><?php esc_html_e($currency['country']); ?> (<?php echo $currency['currency']; ?> )</option> <?php } ?> </select> </td> </tr> <?php $currency_data = $wpdb->get_row("SELECT `symbol`,`symbol_html`,`code` FROM `" . WPSC_TABLE_CURRENCY_LIST . "` WHERE `id`='" . esc_attr(get_option('currency_type')) . "' LIMIT 1", ARRAY_A); if ($currency_data['symbol'] != '') { $currency_sign = esc_attr($currency_data['symbol_html']); } else { $currency_sign = esc_attr($currency_data['code']); } $currency_sign_location = esc_attr(get_option('currency_sign_location')); $csl1 = ""; $csl2 = ""; $csl3 = ""; $csl4 = ""; switch ($currency_sign_location) { case 1: $csl1 = "checked='checked'"; break; case 2: $csl2 = "checked='checked'"; break; case 3: $csl3 = "checked='checked'"; break; case 4: $csl4 = "checked='checked'"; break; } ?> <tr> <th scope="row"><?php esc_html_e('Currency Sign Location', 'wpsc'); ?> </th> <td> <input type='radio' value='1' name='wpsc_options[currency_sign_location]' id='csl1' <?php echo $csl1; ?> /> <label for='csl1'><?php _ex('100', 'Currency sign location - option 1', 'wpsc'); ?> <span id='cslchar1'><?php echo $currency_sign; ?> </span></label> <input type='radio' value='2' name='wpsc_options[currency_sign_location]' id='csl2' <?php echo $csl2; ?> /> <label for='csl2'><?php _ex('100', 'Currency sign location - option 2', 'wpsc'); ?> <span id='cslchar2'><?php echo $currency_sign; ?> </span></label> <input type='radio' value='3' name='wpsc_options[currency_sign_location]' id='csl3' <?php echo $csl3; ?> /> <label for='csl3'><span id='cslchar3'><?php echo $currency_sign; ?> </span><?php _ex('100', 'Currency sign location - option 3', 'wpsc'); ?> </label> <input type='radio' value='4' name='wpsc_options[currency_sign_location]' id='csl4' <?php echo $csl4; ?> /> <label for='csl4'><span id='cslchar4'><?php echo $currency_sign; ?> </span> <?php _ex('100', 'Currency sign location - option 4', 'wpsc'); ?> </label> </td> </tr> <tr> <th scope="row"><?php esc_html_e('Thousands and decimal separators', 'wpsc'); ?> </th> <td> <label for="wpsc_options_wpsc_thousands_separator"><?php esc_html_e('Thousands separator', 'wpsc'); ?> </label>: <input name="wpsc_options[wpsc_thousands_separator]" id="wpsc_options_wpsc_thousands_separator" type="text" maxlength="1" size="1" value="<?php echo esc_attr(get_option('wpsc_thousands_separator')); ?> " /><br /> <label for="wpsc_options_wpsc_decimal_separator"><?php esc_html_e('Decimal separator', 'wpsc'); ?> </label>: <input name="wpsc_options[wpsc_decimal_separator]" id="wpsc_options_wpsc_decimal_separator" type="text" maxlength="1" size="1" value="<?php echo esc_attr(get_option('wpsc_decimal_separator')); ?> " /><br /> <?php esc_html_e('Preview:', 'wpsc'); ?> 10<?php echo esc_attr(get_option('wpsc_thousands_separator')); ?> 000<?php echo esc_attr(get_option('wpsc_decimal_separator')); ?> 00 </td> </tr> </table> <?php }
public function display() { global $wpdb; //not to sure if we still need these any more - $form_types, $unique_names $form_types = get_option('wpsc_checkout_form_fields'); $unique_names = get_option('wpsc_checkout_unique_names'); do_action('wpsc_checkout_form_fields_page'); ?> <input type='hidden' name='checkout_submits' value='true' /> <h3><?php esc_html_e('Checkout Settings', 'wpsc'); ?> </h3> <table class='form-table'> <tr> <th scope="row"><?php esc_html_e('Force User Registration', 'wpsc'); ?> </th> <td> <input type='radio' value='0' name='wpsc_options[require_register]' id='require_register2' <?php checked($this->require_register, 0); ?> /> <label for='require_register2'><?php _e('Users can checkout without a user account', 'wpsc'); ?> </label><br /> <input type='radio' value='1' name='wpsc_options[require_register]' id='require_register1' <?php checked($this->require_register, 1); ?> /> <label for='require_register1'><?php _e('Users must register before checking out', 'wpsc'); ?> </label> <p class='description'><?php esc_attr_e('Enabling this will also turn on "Membership: Anyone can register" from within WordPress Settings > General if it\'s not already enabled', 'wpsc'); ?> </p> </td> </tr> <tr> <th scope="row"><?php esc_html_e('Shipping Same as Billing', 'wpsc'); ?> </th> <td> <input type='radio' value='1' name='wpsc_options[shippingsameasbilling]' id='shippingsameasbilling1' <?php checked($this->shipping_same_as_billing, 1); ?> /> <label for='shippingsameasbilling1'><?php _e('Enable "Same as billing address" checkbox with Shipping Address fields', 'wpsc'); ?> </label><br /> <input type='radio' value='0' name='wpsc_options[shippingsameasbilling]' id='shippingsameasbilling2' <?php checked($this->shipping_same_as_billing, 0); ?> /> <label for='shippingsameasbilling2'><?php _e('Users must re-enter Shipping Address', 'wpsc'); ?> </label> </td> </tr> <tr> <th scope="row"><?php _e('Security and Encryption', 'wpsc'); ?> </th> <td> <input type='radio' value='1' name='wpsc_options[wpsc_force_ssl]' id='wpsc_force_ssl1' <?php checked($this->force_ssl, 1); ?> /> <label for='wpsc_force_ssl1'><?php _e('Force users to use SSL Encryption', 'wpsc'); ?> </label><br /> <input type='radio' value='0' name='wpsc_options[wpsc_force_ssl]' id='wpsc_force_ssl2' <?php checked($this->force_ssl, 0); ?> /> <label for='wpsc_force_ssl2'><?php _e('Allow site to be used insecurely and unencrypted', 'wpsc'); ?> </label> <p class='description'><?php esc_html_e('This can cause warnings for your users if you do not have a properly configured SSL certificate', 'wpsc'); ?> </p> </td> </tr> </table> <h3><?php esc_html_e('Checkout Form Fields', 'wpsc'); ?> </h3> <p><?php esc_html_e('Here you can customise the forms to be displayed in your checkout page. The checkout page is where you collect important user information that will show up in your purchase logs i.e. the buyer\'s address, and name...', 'wpsc'); ?> </p> <p> <label for='wpsc_form_set'><?php esc_html_e('Select a Form Set', 'wpsc'); ?> :</label> <select id='wpsc_form_set' name='checkout_set'> <?php foreach ($this->checkout_sets as $key => $value) { ?> <option <?php selected($this->current_checkout_set, $key); ?> value="<?php echo esc_attr($key); ?> "><?php echo esc_html($value); ?> </option> <?php } ?> </select> <input type='submit' value='<?php esc_attr_e('Filter', 'wpsc'); ?> ' name='wpsc_checkout_set_filter' class='button-secondary' /> <input <?php if (!$this->current_checkout_set) { echo 'style="display:none;"'; } ?> id="wpsc-delete-checkout-set" type='submit' value='<?php esc_attr_e('Delete', 'wpsc'); ?> ' name='wpsc_checkout_set_delete' class='button-secondary' /> </p> <p><a class="add_new_form_set button-secondary" href='#'><?php esc_html_e("Add New Form Set", 'wpsc'); ?> </a></p> <p class='add_new_form_set_forms'> <label><?php esc_html_e("Add new Form Set", 'wpsc'); ?> : <input type="text" value="" name="new_form_set" /></label> <input type="submit" value="<?php esc_attr_e('Add', 'wpsc'); ?> " class="button-primary" id="formset-add-sumbit"/> </p> <input type="hidden" name="selected_form_set" value="<?php echo esc_attr($this->current_checkout_set); ?> " /> <table id="wpsc_checkout_list" class="widefat page fixed" cellspacing="0"> <thead> <tr> <?php print_column_headers('display-checkout-list'); ?> </tr> </thead> <tfoot> <tr> <?php print_column_headers('display-checkout-list', false); ?> </tr> </tfoot> <tbody id='wpsc_checkout_list_body'> <?php if (empty($this->form_fields)) { ?> <?php $this->prototype_field('new'); ?> <?php } else { ?> <?php foreach ($this->form_fields as $form_field) { ?> <tr data-field-id="<?php echo esc_attr($form_field->id); ?> " data-field-type="<?php echo $form_field->type; ?> " id="checkout_<?php echo esc_attr($form_field->id); ?> " class="checkout_form_field field_type_<?php echo $form_field->type; ?> "> <td class="drag"> <div class="cell-wrapper"> <a title="<?php esc_attr_e('Click and Drag to Order Checkout Fields', 'wpsc'); ?> "> <img src="<?php echo esc_url(WPSC_CORE_IMAGES_URL . '/drag.png'); ?> " /> </a> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-feedback" title="" alt="" /> </div> </td> <td class="namecol"> <div class="cell-wrapper"> <input type="text" name="form_name[<?php echo esc_attr($form_field->id); ?> ]" value="<?php echo esc_attr($form_field->name); ?> " /> </div> </td> <td class="typecol"> <div class="cell-wrapper"> <?php if ($this->is_field_default($form_field)) { ?> <strong><?php echo esc_html($form_field->type); ?> </strong> <?php } else { ?> <select name="form_type[<?php echo esc_attr($form_field->id); ?> ]"> <?php foreach ($this->field_types as $label => $name) { ?> <option <?php selected($form_field->type, $name); ?> value="<?php echo esc_attr($name); ?> "><?php echo esc_html($label); ?> </option> <?php } ?> </select> <?php $field_options = unserialize($form_field->options); if (empty($field_options)) { $field_options = array(); } $i = 0; foreach ($field_options as $label => $value) { $i++; ?> <input type="hidden" name="form_options[<?php echo esc_attr($form_field->id); ?> ][label][]" value="<?php echo esc_attr($label); ?> " /> <input type="hidden" name="form_options[<?php echo esc_attr($form_field->id); ?> ][value][]" value="<?php echo esc_attr($value); ?> " /> <?php } ?> <?php } ?> </div> </td> <td class="uniquenamecol"> <div class="cell-wrapper"> <?php if ($form_field->type != 'heading' && !empty($form_field->unique_name)) { ?> <small><?php echo esc_html($form_field->unique_name); ?> </small> <?php } ?> <?php $style = ''; if (in_array($form_field->type, array('select', 'radio', 'checkbox'))) { $style = 'style="display: inline;"'; } ?> <a class="edit-options" href="#" <?php echo $style; ?> ><?php esc_html_e('Edit Options', 'wpsc'); ?> </a> </div> </td> <td class="displaycol"> <div class="cell-wrapper"> <input <?php checked($form_field->active, 1); ?> type="checkbox" name="form_display[<?php echo esc_attr($form_field->id); ?> ]" value="1" /> </div> </td> <td class="mandatorycol"> <div class="cell-wrapper"> <?php if ($form_field->type != 'heading') { ?> <input <?php checked($form_field->mandatory, 1); ?> type="checkbox" name="form_mandatory[<?php echo esc_attr($form_field->id); ?> ]" value="1" /> <?php } ?> </div> </td> <td class="actionscol"> <div class="cell-wrapper"> <?php if (!$this->is_field_default($form_field)) { ?> <a tabindex="-1" title="<?php esc_attr_e('Delete Field', 'wpsc'); ?> " class="button-secondary wpsc-button-round wpsc-button-minus" href="#"><?php echo _x('–', 'delete item', 'wpsc'); ?> </a> <?php } else { ?> <span title="<?php _e('Cannot Delete Default Fields', 'wpsc'); ?> " class="button-secondary wpsc-button-round wpsc-button-minus"><?php echo _x('–', 'delete item', 'wpsc'); ?> </span> <?php } ?> <a tabindex="-1" title="<?php _e('Add Field', 'wpsc'); ?> " class="button-secondary wpsc-button-round wpsc-button-plus" href="#"><?php echo _x('+', 'add item', 'wpsc'); ?> </a> </div> </td> </tr> <?php } ?> <?php } ?> <?php $this->prototype_field(); ?> </tbody> </table> <?php }
public function display_tablenav($which) { global $tab; if ($tab === 'account') { return; } $account = Sputnik::get_account(); if ('top' == $which) { ?> <div class="tablenav top"> <div class="alignright account"> <?php printf(__('Logged in as %s', 'wp-e-commerce'), '<a href="' . menu_page_url('sputnik-account', false) . '" class="account-link">' . $account->name . '</a>'); if ($tab === 'search') { ?> <?php Sputnik_Admin::search_form(); } ?> </div> <?php $this->pagination($which); ?> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-loading list-ajax-loading" alt="" /> <br class="clear" /> </div> <?php } else { ?> <div class="tablenav bottom"> <?php $this->pagination($which); ?> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-loading list-ajax-loading" alt="" /> <br class="clear" /> </div> <?php } }
esc_html_e("Enter new variants", 'wp-e-commerce'); ?> </label> <input type="text" class="text-field" id="new-variants" /><br /> </p> <p class="howto"><?php esc_html_e("Example: Red, Green, Blue. Separate variants with commas.", 'wp-e-commerce'); ?> </p> <p> <a class="button" href="#"><?php esc_html_e('Add New Variants', 'wp-e-commerce'); ?> </a> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-feedback" title="" alt="" /><br class="clear" /> </p> </div> <p><a name='variation_control'> </a><?php _e('Select the Variation sets and then the corresponding Variants you want to add to this product.', 'wp-e-commerce'); ?> </p> <form action="" method="post"> <ul class="variation_checkboxes"> <?php wp_terms_checklist($this->parent_id, array('taxonomy' => 'wpsc-variation', 'walker' => new WPSC_Walker_Variation_Checklist(), 'checked_ontop' => false)); ?>
/** * Display the settings page. * @since 3.8.8 * @uses esc_html_e() Sanitize HTML * @uses esc_attr() Sanitize HTML attributes * @uses wp_nonce_field() Prevent CSRF * @uses WPSC_Settings_Page::output_tabs() Display tab navigation. * @uses WPSC_Settings_Page::display_current_tab() Display current tab. * @access public */ public function display() { ?> <div id="wpsc_options" class="wrap"> <div id="icon_card" class="icon32"></div> <h2 id="wpsc-settings-page-title"> <?php esc_html_e('Store Settings', 'wp-e-commerce'); ?> <?php if (current_user_can('customize') && '2.0' == get_option('wpsc_get_active_theme_engine')) { printf(' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>', esc_url(add_query_arg(array(array('autofocus' => array('panel' => 'wpsc')), 'return' => urlencode(wp_unslash($_SERVER['REQUEST_URI']))), admin_url('customize.php'))), __('Manage in Customizer')); } ?> <img src="<?php echo esc_url(wpsc_get_ajax_spinner()); ?> " class="ajax-feedback" title="" alt="" /> </h2> <?php $this->output_tabs(); ?> <div id='wpsc_options_page'> <form method='post' action='<?php echo esc_url($this->submit_url()); ?> ' enctype='multipart/form-data' id='wpsc-settings-form'> <?php $this->display_current_tab(); ?> </form> </div> </div> <?php }