/**
  * Generate the form configuration array for this tab
  *
  * @since  0.1
  * @access private
  */
 private function populate_form_array()
 {
     // define the sections
     $this->sections = array('locations' => array('title' => _x('Page Slugs', 'page locations section title', 'wpsc'), 'fields' => array('store_slug', 'store_as_front_page', 'category_base_slug', 'product_base_slug', 'cart_page_slug', 'checkout_page_slug', 'customer_account_page_slug', 'login_page_slug', 'password_reminder_page_slug', 'register_page_slug', 'prefix_product_slug', 'hierarchical_product_category_url')), 'titles' => array('title' => _x('Page Titles', 'page titles section title', 'wpsc'), 'fields' => array('store_title', 'cart_page_title', 'checkout_page_title', 'customer_account_page_title', 'login_page_title', 'password_reminder_page_title', 'register_page_title')));
     // Shortcut variables for buttons and messages
     $view_button = '<a class="button button-secondary button-view-page" href="%1$s">%2$s</a>';
     $view_message = _x('View', 'view page', 'wpsc');
     $view_category_message = _x('Sample Category', 'view page', 'wpsc');
     $view_product_message = _x('Sample Product', 'view page', 'wpsc');
     // generate sample URLs for single product and product category
     $base_shop_url = '<small>' . esc_url(wpsc_get_store_url('/')) . '</small>';
     $sample_category = get_terms('wpsc_product_category', array('number' => 1));
     $sample_product = get_posts(array('post_type' => 'wpsc-product', 'numberposts' => 1));
     // generate form fields
     $this->form_array = array('store_slug' => array('type' => 'textfield', 'prepend' => '<small>' . esc_url(home_url('/')) . '</small>', 'title' => _x('Main store', 'page slug setting', 'wpsc'), 'append' => sprintf($view_button, wpsc_get_store_url(), $view_message), 'validation' => 'required', 'class' => 'regular-text'), 'store_as_front_page' => array('type' => 'radios', 'title' => _x('Display main store on front page', 'page settings', 'wpsc'), 'options' => array(1 => _x('Yes', 'settings', 'wpsc'), 0 => _x('No', 'settings', 'wpsc'))), 'store_title' => array('type' => 'textfield', 'title' => _x('Main store title', 'page slug title', 'wpsc'), 'validation' => 'required'), 'category_base_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'append' => empty($sample_category) ? '' : sprintf($view_button, get_term_link($sample_category[0]), $view_category_message), 'title' => _x('Product category base slug', 'permalinks setting', 'wpsc'), 'validation' => 'required', 'class' => 'regular-text'), 'product_base_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'append' => empty($sample_product) ? '' : sprintf($view_button, get_permalink($sample_product[0]), $view_product_message), 'title' => _x('Single product base slug', 'permalinks setting', 'wpsc'), 'validation' => 'required', 'class' => 'regular-text'), 'prefix_product_slug' => array('type' => 'checkboxes', 'title' => _x('Product prefix', 'permalinks setting', 'wpsc'), 'options' => array(1 => __('Include category slug in product URL.', 'wpsc'))), 'hierarchical_product_category_url' => array('type' => 'radios', 'title' => _x('Hierarchical product category URL', 'permalinks setting', 'wpsc'), 'options' => array(1 => _x('Yes', 'settings', 'wpsc'), 0 => _x('No', 'settings', 'wpsc')), 'description' => __('When hierarchical product category URL is enabled, parent product categories are also included in the product URL.', 'wpsc')), 'cart_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'append' => sprintf($view_button, wpsc_get_cart_url(), $view_message), 'title' => _x('Cart page', 'page settings', 'wpsc'), 'validation' => 'required', 'class' => 'regular-text'), 'cart_page_title' => array('type' => 'textfield', 'title' => _x('Cart page', 'page settings', 'wpsc'), 'validation' => 'required'), 'checkout_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'title' => _x('Checkout page', 'page setting', 'wpsc'), 'validation' => 'required', 'class' => 'regular-text'), 'checkout_page_title' => array('type' => 'textfield', 'title' => _x('Checkout page', 'page settings', 'wpsc'), 'validation' => 'required'), 'customer_account_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'append' => sprintf($view_button, wpsc_get_customer_account_url(), $view_message), 'title' => _x('Customer account page', 'permalinks setting', 'wpsc'), 'validation' => 'required|slug_not_conflicted', 'class' => 'regular-text'), 'customer_account_page_title' => array('type' => 'textfield', 'title' => _x('Customer account page', 'page settings', 'wpsc'), 'validation' => 'required'), 'login_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'title' => _x('Login page', 'permalinks setting', 'wpsc'), 'description' => __('Leaving this field blank will disable the page.', 'wpsc'), 'validation' => 'slug_not_conflicted', 'class' => 'regular-text'), 'login_page_title' => array('type' => 'textfield', 'title' => _x('Login page', 'page settings', 'wpsc'), 'validation' => 'required'), 'password_reminder_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'title' => _x('Password reminder page', 'permalinks setting', 'wpsc'), 'description' => __("Leaving this field blank will disable the page.", 'wpsc'), 'validation' => 'slug_not_conflicted', 'class' => 'regular-text'), 'password_reminder_page_title' => array('type' => 'textfield', 'title' => _x('Password reminder page', 'page settings', 'wpsc'), 'validation' => 'required'), 'register_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'title' => _x('Register page', 'permalinks setting', 'wpsc'), 'description' => __("Leaving this field blank will disable the page.", 'wpsc'), 'validation' => 'slug_not_conflicted', 'class' => 'regular-text'), 'register_page_title' => array('type' => 'textfield', 'title' => _x('Register page', 'page settings', 'wpsc'), 'validation' => 'required'));
     // display warnings for login, register and password reminder pages when
     // "Anyone can register" is disabled.
     if (!get_option('users_can_register')) {
         $additional_description = '<br /> ' . __('<strong>Note:</strong> Enable "Anyone can register" in <a href="%s">Settings -> General</a> first if you want to use this page.', 'wpsc');
         $additional_description = sprintf($additional_description, admin_url('options-general.php'));
         $this->form_array['login_page_slug']['description'] .= $additional_description;
         $this->form_array['password_reminder_page_slug']['description'] .= $additional_description;
         $this->form_array['register_page_slug']['description'] .= $additional_description;
     }
 }
Example #2
0
 private function send_registration_notification($user_id, $username, $email, $password)
 {
     wp_new_user_notification($user_id);
     $username = stripslashes($username);
     $password = stripslashes($password);
     $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
     $title = apply_filters('wpsc_registration_notification_title', __('[%s] Thank you for registering', 'wpsc'));
     $title = sprintf($title, $blogname);
     $message = sprintf(__('Welcome, %s.', 'wpsc'), $username) . "\r\n\r\n";
     $message .= __("Thank you for registering with us. Your account has been created:", 'wpsc') . "\r\n\r\n";
     $message .= sprintf(__('Username: %s', 'wpsc'), $username) . "\r\n\r\n";
     $message .= sprintf(__('Password: %s', 'wpsc'), $password) . "\r\n\r\n";
     $message .= __("Here's a list of things you can do to get started:", 'wpsc') . "\r\n\r\n";
     $message .= sprintf(__('1. Log in with your new account details <%s>', 'wpsc'), wpsc_get_login_url()) . "\r\n\r\n";
     $message .= sprintf(__('2. Build your customer profile, and probably change your password to something easier to remember <%s>', 'wpsc'), wpsc_get_customer_account_url()) . "\r\n\r\n";
     $message .= sprintf(__('3. Explore our shop! <%s>', 'wpsc'), wpsc_get_store_url()) . "\r\n\r\n";
     $message = apply_filters('wpsc_registration_notification_body', $message);
     wp_mail($email, $title, $message);
 }
 public function get_current_pagination_base()
 {
     $slug = 'orders';
     if ($this->current_status > 0) {
         $slug .= '/status/' . $this->current_status;
     }
     return wpsc_get_customer_account_url($slug);
 }
Example #4
0
 private function item_url($item)
 {
     return wpsc_get_customer_account_url('orders/' . $item->id);
 }
Example #5
0
function wpsc_get_customer_orders_statuses()
{
    if (_wpsc_get_current_controller_name() != 'customer-account' || _wpsc_get_current_controller_slug() != 'orders') {
        return '';
    }
    $controller = _wpsc_get_current_controller();
    $view_labels = array(0 => _nx_noop('All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', 'purchase logs', 'wp-e-commerce'), 1 => _nx_noop('Incomplete <span class="count">(%s)</span>', 'Incomplete <span class="count">(%s)</span>', 'purchase logs', 'wp-e-commerce'), 2 => _nx_noop('Received <span class="count">(%s)</span>', 'Received <span class="count">(%s)</span>', 'purchase logs', 'wp-e-commerce'), 3 => _nx_noop('Accepted <span class="count">(%s)</span>', 'Accepted <span class="count">(%s)</span>', 'purchase logs', 'wp-e-commerce'), 4 => _nx_noop('Dispatched <span class="count">(%s)</span>', 'Dispatched <span class="count">(%s)</span>', 'purchase logs', 'wp-e-commerce'), 5 => _nx_noop('Closed <span class="count">(%s)</span>', 'Closed <span class="count">(%s)</span>', 'purchase logs', 'wp-e-commerce'), 6 => _nx_noop('Declined <span class="count">(%s)</span>', 'Declined <span class="count">(%s)</span>', 'purchase logs', 'wp-e-commerce'));
    $views = array();
    foreach ($controller->status_filters as $status => $count) {
        if (!isset($view_labels[$status]) || $status && !$count) {
            continue;
        }
        $text = sprintf(translate_nooped_plural($view_labels[$status], $count, 'wp-e-commerce'), number_format_i18n($count));
        $url = $status ? wpsc_get_customer_account_url('orders/status/' . $status) : wpsc_get_customer_account_url();
        $link = '<a href="' . esc_url($url) . '">' . $text . '</a>';
        $views[$status] = '<span class="wpsc-order-status-' . $status . '">' . $link . '</span>';
    }
    if (count($views) == 2) {
        unset($views[1]);
    }
    $output = '<div class="wpsc-order-statuses">';
    $output .= implode('<span class="wpsc-order-status-separator"> | </span>', $views);
    $output .= '</div>';
    return $output;
}
Example #6
0
function wpsc_customer_account_url($slug = '')
{
    echo esc_url(wpsc_get_customer_account_url($slug));
}