コード例 #1
0
 public function icon()
 {
     if ($this->icon) {
         return '<img src="' . fflcommerce::force_ssl($this->icon) . '" alt="' . $this->title . '" />';
     }
     return '';
 }
コード例 #2
0
ファイル: skrill.php プロジェクト: barnent1/fflcommerce
 public function __construct()
 {
     parent::__construct();
     $this->id = 'skrill';
     $this->title = 'Skrill';
     $this->has_fields = false;
     $this->enabled = FFLCommerce_Base::get_options()->get_option('fflcommerce_skrill_enabled');
     $this->title = FFLCommerce_Base::get_options()->get_option('fflcommerce_skrill_title');
     $this->email = FFLCommerce_Base::get_options()->get_option('fflcommerce_skrill_email');
     $this->locale = $this->getLocale();
     $skrillIcon = FFLCommerce_Base::get_options()->get_option('fflcommerce_skrill_icon');
     if (!filter_var($skrillIcon, FILTER_VALIDATE_URL)) {
         $this->icon = fflcommerce::assets_url() . '/assets/images/icons/skrill.png';
     } else {
         $this->icon = $skrillIcon;
     }
     $pMeth = (array) FFLCommerce_Base::get_options()->get_option('fflcommerce_skrill_payment_methods_multicheck');
     $cList = '';
     foreach ($pMeth as $key => $value) {
         if ($value) {
             $cList = $cList . $key . ',';
         }
     }
     $cList = rtrim($cList, ",");
     $this->payment_methods = $cList;
     add_action('init', array($this, 'check_status_response'));
     if (isset($_GET['skrillPayment']) && $_GET['skrillPayment'] == true) {
         add_action('init', array($this, 'generate_skrill_form'));
     }
     add_action('valid-skrill-status-report', array($this, 'successful_request'));
     add_action('receipt_skrill', array($this, 'receipt_skrill'));
 }
function fflcommerce_enqueue_product_quick_scripts()
{
    global $pagenow, $typenow;
    if (empty($typenow) && !empty($_GET['post'])) {
        $post = get_post($_GET['post']);
        $typenow = $post->post_type;
    }
    if ($typenow == 'product') {
        wp_enqueue_script('fflcommerce-admin-quickedit', fflcommerce::assets_url() . '/assets/js/product_quick_edit.js', array('jquery', 'inline-edit-post'), '', true);
        $fflcommerce_quick_edit_params = array('assets_url' => fflcommerce::assets_url(), 'ajax_url' => !is_ssl() ? str_replace('https', 'http', admin_url('admin-ajax.php')) : admin_url('admin-ajax.php'), 'get_stock_price_nonce' => wp_create_nonce("get-product-stock-price"), 'update_stock_price_nonce' => wp_create_nonce("update-product-stock-price"));
        wp_localize_script('fflcommerce-admin-quickedit', 'fflcommerce_quick_edit_params', $fflcommerce_quick_edit_params);
    }
}
コード例 #4
0
ファイル: checkout.php プロジェクト: barnent1/fflcommerce
function fflcommerce_checkout($atts)
{
    if (!defined('FFLCOMMERCE_CHECKOUT')) {
        define('FFLCOMMERCE_CHECKOUT', true);
    }
    $non_js_checkout = isset($_POST['update_totals']) && $_POST['update_totals'] ? true : false;
    $result = fflcommerce_cart::check_cart_item_stock();
    if (is_wp_error($result)) {
        fflcommerce::add_error($result->get_error_message());
    }
    if (!fflcommerce::has_errors() && $non_js_checkout) {
        fflcommerce::add_message(__('The order totals have been updated. Please confirm your order by pressing the Place Order button at the bottom of the page.', 'fflcommerce'));
    }
    fflcommerce::show_messages();
    fflcommerce_get_template('checkout/form.php', false);
}
コード例 #5
0
ファイル: cart.php プロジェクト: barnent1/fflcommerce
function fflcommerce_cart($atts)
{
    unset(fflcommerce_session::instance()->selected_rate_id);
    // Process Discount Codes
    if (isset($_POST['apply_coupon']) && $_POST['apply_coupon'] && fflcommerce::verify_nonce('cart')) {
        $coupon_code = sanitize_title($_POST['coupon_code']);
        fflcommerce_cart::add_discount($coupon_code);
    } elseif (isset($_POST['calc_shipping']) && $_POST['calc_shipping'] && fflcommerce::verify_nonce('cart')) {
        // Update Shipping
        unset(fflcommerce_session::instance()->chosen_shipping_method_id);
        $country = $_POST['calc_shipping_country'];
        $state = $_POST['calc_shipping_state'];
        $postcode = $_POST['calc_shipping_postcode'];
        if ($postcode && !fflcommerce_validation::is_postcode($postcode, $country)) {
            fflcommerce::add_error(__('Please enter a valid postcode/ZIP.', 'fflcommerce'));
            $postcode = '';
        } elseif ($postcode) {
            $postcode = fflcommerce_validation::format_postcode($postcode, $country);
        }
        if ($country) {
            // Update customer location
            fflcommerce_customer::set_location($country, $state, $postcode);
            fflcommerce_customer::set_shipping_location($country, $state, $postcode);
            fflcommerce::add_message(__('Shipping costs updated.', 'fflcommerce'));
        } else {
            fflcommerce_customer::set_shipping_location('', '', '');
            fflcommerce::add_message(__('Shipping costs updated.', 'fflcommerce'));
        }
    } elseif (isset($_POST['shipping_rates'])) {
        $rates_params = explode(":", $_POST['shipping_rates']);
        $available_methods = fflcommerce_shipping::get_available_shipping_methods();
        $shipping_method = $available_methods[$rates_params[0]];
        if ($rates_params[1] != null) {
            fflcommerce_session::instance()->selected_rate_id = $rates_params[1];
        }
        $shipping_method->choose();
        // chooses the method selected by user.
    }
    // Re-Calc prices. This needs to happen every time the cart page is loaded and after checking post results.
    fflcommerce_cart::calculate_totals();
    $result = fflcommerce_cart::check_cart_item_stock();
    if (is_wp_error($result)) {
        fflcommerce::add_error($result->get_error_message());
    }
    fflcommerce_render('shortcode/cart', array('cart' => fflcommerce_cart::get_cart(), 'coupons' => fflcommerce_cart::get_coupons()));
}
コード例 #6
0
ファイル: my_account.php プロジェクト: barnent1/fflcommerce
function fflcommerce_edit_address()
{
    $account_url = get_permalink(fflcommerce_get_page_id(FFLCOMMERCE_MY_ACCOUNT));
    $user_id = get_current_user_id();
    $load_address = fflcommerce_get_address_to_edit();
    $address = fflcommerce_get_address_fields($load_address, $user_id);
    if (isset($_POST['save_address']) && fflcommerce::verify_nonce(FFLCOMMERCE_EDIT_ADDRESS)) {
        if ($user_id > 0) {
            foreach ($address as &$field) {
                if (isset($_POST[$field['name']])) {
                    $field['value'] = fflcommerce_clean($_POST[$field['name']]);
                    update_user_meta($user_id, $field['name'], $field['value']);
                }
            }
            do_action('fflcommerce_user_edit_address', $user_id, $address);
        }
    }
    fflcommerce_render('shortcode/my_account/edit_address', array('url' => add_query_arg('address', $load_address, apply_filters('fflcommerce_get_edit_address_page_id', get_permalink(fflcommerce_get_page_id(FFLCOMMERCE_EDIT_ADDRESS)))), 'account_url' => $account_url, 'load_address' => $load_address, 'address' => $address));
}
コード例 #7
0
ファイル: my_account.php プロジェクト: barnent1/fflcommerce
<?php

/**
 * @var $options Jigoshop_Options Options container.
 * @var $recent_orders int Number of recent orders to show.
 */
fflcommerce::show_messages();
if (is_user_logged_in()) {
    ?>
<p><?php 
    echo sprintf(__('Hello, <strong>%s</strong>. From your account dashboard you can view your recent orders, manage your shipping and billing addresses and <a href="%s">change your password</a>.', 'fflcommerce'), $current_user->display_name, apply_filters('fflcommerce_get_change_password_page_id', get_permalink(fflcommerce_get_page_id('change_password'))));
    ?>
</p>

<?php 
    do_action('fflcommerce_before_my_account');
    ?>

<?php 
    if ($downloads = fflcommerce_customer::get_downloadable_products()) {
        ?>
	<h2><?php 
        _e('Available downloads', 'fflcommerce');
        ?>
</h2>
	<ul class="digital-downloads">
		<?php 
        foreach ($downloads as $download) {
            ?>
			<li><?php 
            if (is_numeric($download['downloads_remaining'])) {
コード例 #8
0
 /**
  * Sets the FFL Commerece 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 = fflcommerce::currency_symbols();
     $countries = fflcommerce::currency_countries();
     $currencies = array();
     foreach ($countries as $key => $country) {
         $currencies[$key] = $country . ' (' . $symbols[$key] . ')';
     }
     $currencies = apply_filters('fflcommerce_currencies', $currencies);
     $cSymbol = '';
     if (function_exists('get_fflcommerce_currency_symbol')) {
         $cSymbol = get_fflcommerce_currency_symbol();
     }
     $cCode = $this->get('fflcommerce_currency') ? $this->get('fflcommerce_currency') : 'GBP';
     $cSep = $this->get('fflcommerce_price_decimal_sep') ? $this->get('fflcommerce_price_decimal_sep') : '.';
     self::$default_options = array(array('type' => 'tab', 'name' => __('Shop', 'fflcommerce')), array('name' => __('Shop Options', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Base Country/Region', 'fflcommerce'), 'desc' => '', 'tip' => __('This is the base country for your business. Tax rates will be based on this country.', 'fflcommerce'), 'id' => 'fflcommerce_default_country', 'type' => 'single_select_country'), array('name' => __('Default Country/Region for customer', 'fflcommerce'), 'desc' => '', 'tip' => __('This is the country for your clients with new accounts.', 'fflcommerce'), 'id' => 'fflcommerce_default_country_for_customer', 'std' => $this->get('fflcommerce_default_country'), 'type' => 'single_select_country', 'options' => array('add_empty' => true)), array('name' => __('Currency', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_currency', 'type' => 'select', 'choices' => $currencies), array('name' => __('Allowed Countries', 'fflcommerce'), 'desc' => '', 'tip' => __('These are countries that you are willing to ship to.', 'fflcommerce'), 'id' => 'fflcommerce_allowed_countries', 'type' => 'select', 'choices' => array('all' => __('All Countries', 'fflcommerce'), 'specific' => __('Specific Countries', 'fflcommerce'))), array('name' => __('Specific Countries', 'fflcommerce'), 'desc' => '', 'tip' => '', 'id' => 'fflcommerce_specific_allowed_countries', 'type' => 'multi_select_countries'), array('name' => __('Demo store', 'fflcommerce'), 'desc' => '', 'tip' => __('Enable this option to show a banner at the top of every page stating this shop is currently in testing mode.', 'fflcommerce'), 'id' => 'fflcommerce_demo_store', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Invoicing', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Company Name', 'fflcommerce'), 'desc' => '', 'tip' => __('Setting your company name will enable us to print it out on your invoice emails. Leave blank to disable.', 'fflcommerce'), 'id' => 'fflcommerce_company_name', 'type' => 'text'), array('name' => __('Tax Registration Number', 'fflcommerce'), 'desc' => __('Add your tax registration label before the registration number and it will be printed as well. eg. <code>VAT Number: 88888888</code>', 'fflcommerce'), 'tip' => __('Setting your tax number will enable us to print it out on your invoice emails. Leave blank to disable.', 'fflcommerce'), 'id' => 'fflcommerce_tax_number', 'type' => 'text'), array('name' => __('Address Line1', 'fflcommerce'), 'desc' => '', 'tip' => __('Setting your address will enable us to print it out on your invoice emails. Leave blank to disable.', 'fflcommerce'), 'id' => 'fflcommerce_address_1', 'type' => 'longtext'), array('name' => __('Address Line2', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_address_2', 'type' => 'longtext'), array('name' => __('Company Phone', 'fflcommerce'), 'desc' => '', 'tip' => __('Setting your company phone number will enable us to print it out on your invoice emails. Leave blank to disable.', 'fflcommerce'), 'id' => 'fflcommerce_company_phone', 'type' => 'text'), array('name' => __('Company Email', 'fflcommerce'), 'desc' => '', 'tip' => __('Setting your company email will enable us to print it out on your invoice emails. Leave blank to disable.', 'fflcommerce'), 'id' => 'fflcommerce_company_email', 'type' => 'email'), array('name' => __('Permalinks', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Prepend shop categories and tags with base page', 'fflcommerce'), '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', 'fflcommerce'), 'id' => 'fflcommerce_prepend_shop_page_to_urls', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Prepend product permalinks with shop base page', 'fflcommerce'), 'desc' => '', 'tip' => '', 'id' => 'fflcommerce_prepend_shop_page_to_product', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Prepend product permalinks with product category', 'fflcommerce'), 'desc' => '', 'tip' => '', 'id' => 'fflcommerce_prepend_category_to_product', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Product category slug', 'fflcommerce'), 'desc' => '', 'tip' => __('Slug displayed in product category URLs. Leave blank to use default "product-category"', 'fflcommerce'), 'id' => 'fflcommerce_product_category_slug', 'type' => 'text'), array('name' => __('Product tag slug', 'fflcommerce'), 'desc' => '', 'tip' => __('Slug displayed in product tag URLs. Leave blank to use default "product-tag"', 'fflcommerce'), 'id' => 'fflcommerce_product_tag_slug', 'type' => 'text'), array('type' => 'tab', 'name' => __('General', 'fflcommerce')), array('name' => __('General Options', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Cart shows "Return to Shop" button', 'fflcommerce'), 'desc' => '', 'tip' => __('Enabling this setting will display a "Return to Shop" button on the Cart page along with the "Continue to Checkout" button.', 'fflcommerce'), 'id' => 'fflcommerce_cart_shows_shop_button', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('After adding product to cart', 'fflcommerce'), 'desc' => '', 'tip' => __('Define what should happen when a user clicks on &#34;Add to Cart&#34; on any product or page.', 'fflcommerce'), 'id' => 'fflcommerce_redirect_add_to_cart', 'type' => 'radio', 'extra' => array('vertical'), 'choices' => array('same_page' => __('Stay on the same page', 'fflcommerce'), 'to_checkout' => __('Redirect to Checkout', 'fflcommerce'), 'to_cart' => __('Redirect to Cart', 'fflcommerce'))), array('name' => __('Cart status after login', 'fflcommerce'), 'desc' => __('Current cart <b>always</b> will be loaded if customer logs in checkout page.', 'fflcommerce'), '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.", 'fflcommerce'), 'id' => 'fflcommerce_cart_after_login', 'type' => 'select', 'choices' => array('load_saved' => __('Load saved cart', 'fflcommerce'), 'load_current' => __('Load current cart', 'fflcommerce'), 'merge' => __('Merge saved and current carts', 'fflcommerce'))), array('name' => __('Reset pending Orders', 'fflcommerce'), 'desc' => __("Change all 'Pending' Orders older than one month to 'On Hold'", 'fflcommerce'), '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!", 'fflcommerce'), 'id' => 'fflcommerce_reset_pending_orders', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Complete processing Orders', 'fflcommerce'), 'desc' => __("Change all 'Processing' Orders older than one month to 'Completed'", 'fflcommerce'), '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.", 'fflcommerce'), 'id' => 'fflcommerce_complete_processing_orders', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Enforce login for downloads', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_downloads_require_login', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Disable FFL Commerce frontend.css', 'fflcommerce'), 'desc' => __('(The next option below will have no effect if this one is disabled)', 'fflcommerce'), 'tip' => __('Useful if you want to disable FFL Commerce styles and theme it yourself via your theme.', 'fflcommerce'), 'id' => 'fflcommerce_disable_css', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Include extra theme styles with FFL Commerce frontend.css', 'fflcommerce'), 'desc' => '', 'tip' => __("With this option <em>on</em>, FFL Commerce's default frontend.css will still load, and any extra bits found in 'theme/fflcommerce/style.css' for over-rides will also be loaded.", 'fflcommerce'), 'id' => 'fflcommerce_frontend_with_theme_css', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Disable bundled Lightbox', 'fflcommerce'), 'desc' => __('Product galleries and images as well as the Add Review form will open in a lightbox.', 'fflcommerce'), 'tip' => __('Useful if your theme or other plugin already loads our Lightbox script and css (prettyPhoto), or you want to use a different one.', 'fflcommerce'), 'id' => 'fflcommerce_disable_fancybox', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Use custom product category order', 'fflcommerce'), 'desc' => '', 'tip' => __('This option allows to make custom product category order, by drag and drop method.', 'fflcommerce'), 'id' => 'fflcommerce_enable_draggable_categories', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('FFL Commerce messages', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Message disappear time', 'fflcommerce'), 'desc' => __('How long message is displayed before disappearing (in ms). Set to 0 to keep it displayed.', 'fflcommerce'), 'id' => 'fflcommerce_message_disappear_time', 'type' => 'natural'), array('name' => __('Error disappear time', 'fflcommerce'), 'desc' => __('How long error is displayed before disappearing (in ms). Set to 0 to keep it displayed.', 'fflcommerce'), 'id' => 'fflcommerce_error_disappear_time', 'type' => 'natural'), array('name' => __('Email Details', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('FFL Commerce email address', 'fflcommerce'), 'desc' => '', 'tip' => __('The email address used to send all FFL Commerce related emails, such as order confirmations and notices.  This may be different than your Company email address on "Shop Tab -> Invoicing".', 'fflcommerce'), 'id' => 'fflcommerce_email', 'type' => 'email'), array('name' => __('Email from name', 'fflcommerce'), 'desc' => '', 'tip' => __('', 'fflcommerce'), 'id' => 'fflcommerce_email_from_name', 'type' => 'text'), array('name' => __('Email footer', 'fflcommerce'), 'desc' => '', 'tip' => __('The email footer used in all FFL Commerce emails.', 'fflcommerce'), 'id' => 'fflcommerce_email_footer', 'type' => 'textarea'), array('name' => __('Use HTML emails', 'fflcommerce'), 'desc' => '', 'tip' => __('This option enables HTML email templates.', 'fflcommerce'), 'id' => 'fflcommerce_enable_html_emails', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Generate default emails', 'fflcommerce'), 'desc' => '', 'tip' => '', 'id' => 'fflcommerce_email_generete_defaults', 'type' => 'user_defined', 'display' => array($this, 'generate_defaults_emails')), array('name' => __('Checkout page', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Validate postal/zip codes', 'fflcommerce'), 'desc' => '', 'tip' => __('Enabling this setting will force proper postcodes to be entered by a customer for a country.', 'fflcommerce'), 'id' => 'fflcommerce_enable_postcode_validating', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Show verify information message', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_verify_checkout_info_message', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Show EU VAT reduction message', 'fflcommerce'), 'desc' => __('This will only apply to EU Union based Shops.', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_eu_vat_reduction_message', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Allow guest purchases', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_enable_guest_checkout', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Show login form', 'fflcommerce'), 'desc' => '', 'id' => 'fflcommerce_enable_guest_login', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Allow registration', 'fflcommerce'), 'desc' => '', 'id' => 'fflcommerce_enable_signup_form', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Force SSL on checkout', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_force_ssl_checkout', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Integration', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('ShareThis Publisher ID', 'fflcommerce'), 'desc' => __("Enter your <a href='http://sharethis.com/account/'>ShareThis publisher ID</a> to show ShareThis on product pages.", 'fflcommerce'), 'tip' => __('ShareThis is a small social sharing widget for posting links on popular sites such as Twitter and Facebook.', 'fflcommerce'), 'id' => 'fflcommerce_sharethis', 'type' => 'text'), array('name' => __('Google Analytics ID', 'fflcommerce'), 'desc' => __('Log into your Google Analytics account to find your ID. e.g. <code>UA-XXXXXXX-X</code>', 'fflcommerce'), 'id' => 'fflcommerce_ga_id', 'type' => 'text'), array('name' => __('Enable eCommerce Tracking', 'fflcommerce'), 'tip' => __('Add Google Analytics eCommerce tracking code upon successful orders', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_ga_ecommerce_tracking_enabled', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('type' => 'tab', 'name' => __('Pages', 'fflcommerce')), array('name' => __('Page configurations', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Cart Page', 'fflcommerce'), 'desc' => __('Shortcode to place on page: <code>[fflcommerce_cart]</code>', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_cart_page_id', 'type' => 'single_select_page'), array('name' => __('Checkout Page', 'fflcommerce'), 'desc' => __('Shortcode to place on page: <code>[fflcommerce_checkout]</code>', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_checkout_page_id', 'type' => 'single_select_page'), array('name' => __('Pay Page', 'fflcommerce'), 'desc' => __('Shortcode to place on page: <code>[fflcommerce_pay]</code><br/>Default parent page: Checkout', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_pay_page_id', 'type' => 'single_select_page'), array('name' => __('Thanks Page', 'fflcommerce'), 'desc' => __('Shortcode to place on page: <code>[fflcommerce_thankyou]</code><br/>Default parent page: Checkout', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_thanks_page_id', 'type' => 'single_select_page'), array('name' => __('My Account Page', 'fflcommerce'), 'desc' => __('Shortcode to place on page: <code>[fflcommerce_my_account]</code>', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_myaccount_page_id', 'type' => 'single_select_page'), array('name' => __('Edit Address Page', 'fflcommerce'), 'desc' => __('Shortcode to place on page: <code>[fflcommerce_edit_address]</code><br/>Default parent page: My Account', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_edit_address_page_id', 'type' => 'single_select_page'), array('name' => __('View Order Page', 'fflcommerce'), 'desc' => __('Shortcode to place on page: <code>[fflcommerce_view_order]</code><br/>Default parent page: My Account', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_view_order_page_id', 'type' => 'single_select_page'), array('name' => __('Change Password Page', 'fflcommerce'), 'desc' => __('Shortcode to place on page: <code>[fflcommerce_change_password]</code><br/>Default parent page: My Account', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_change_password_page_id', 'type' => 'single_select_page'), array('name' => __('Track Order Page', 'fflcommerce'), 'desc' => __('Shortcode to place on page: <code>[fflcommerce_order_tracking]</code>', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_track_order_page_id', 'type' => 'single_select_page'), array('name' => __('Terms Page', 'fflcommerce'), 'desc' => __('If you define a &#34;Terms&#34; page the customer will be asked to accept it before allowing them to place their order.', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_terms_page_id', 'type' => 'single_select_page', 'extra' => 'show_option_none=' . __('None', 'fflcommerce')), array('type' => 'tab', 'name' => __('Catalog &amp; Pricing', 'fflcommerce')), array('name' => __('Catalog Options', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Catalog base page', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_shop_page_id', 'type' => 'single_select_page'), array('name' => __('Shop redirection page', 'fflcommerce'), 'desc' => '', 'tip' => __('This will point users to the page you set for buttons like `Return to shop` or `Continue Shopping`.', 'fflcommerce'), 'id' => 'fflcommerce_shop_redirect_page_id', 'type' => 'single_select_page'), array('name' => __('Catalog product buttons show', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_catalog_product_button', 'type' => 'radio', 'choices' => array('add' => __('Add to Cart', 'fflcommerce'), 'view' => __('View Product', 'fflcommerce'), 'none' => __('No Button', 'fflcommerce'))), array('name' => __('Sort products in catalog by', 'fflcommerce'), 'desc' => '', 'tip' => __('Determines the display sort order of products for the Shop, Categories, and Tag pages.', 'fflcommerce'), 'id' => 'fflcommerce_catalog_sort_orderby', 'type' => 'radio', 'choices' => array('post_date' => __('Creation Date', 'fflcommerce'), 'title' => __('Product Title', 'fflcommerce'), 'menu_order' => __('Product Post Order', 'fflcommerce'))), array('name' => __('Catalog sort direction', 'fflcommerce'), 'desc' => '', 'tip' => __('Determines whether the catalog sort orderby is ascending or descending.', 'fflcommerce'), 'id' => 'fflcommerce_catalog_sort_direction', 'type' => 'radio', 'choices' => array('asc' => __('Ascending', 'fflcommerce'), 'desc' => __('Descending', 'fflcommerce'))), array('name' => __('Catalog products per row', 'fflcommerce'), 'desc' => __('Default = 3', 'fflcommerce'), 'tip' => __('Determines how many products to show on one display row for Shop, Category and Tag pages.', 'fflcommerce'), 'id' => 'fflcommerce_catalog_columns', 'type' => 'number', 'extra' => array('min' => 1, 'max' => 10, 'step' => 1)), array('name' => __('Catalog products per page', 'fflcommerce'), 'desc' => __('Default = 12', 'fflcommerce'), 'tip' => __('Determines how many products to display on Shop, Category and Tag pages before needing next and previous page navigation.', 'fflcommerce'), 'id' => 'fflcommerce_catalog_per_page', 'type' => 'number', 'extra' => array('min' => 1, 'max' => 100, 'step' => 1)), array('name' => __('Pricing Options', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Show prices with tax', 'fflcommerce'), 'desc' => __("This controls the display of the product price in cart and checkout page.", 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_show_prices_with_tax', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Currency display', 'fflcommerce'), 'desc' => __("This controls the display of the currency symbol and currency code.", 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_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', 'fflcommerce'), 'desc' => __('This sets the thousand separator of displayed prices.', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_price_thousand_sep', 'type' => 'text'), array('name' => __('Decimal separator', 'fflcommerce'), 'desc' => __('This sets the decimal separator of displayed prices.', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_price_decimal_sep', 'type' => 'text'), array('name' => __('Number of decimals', 'fflcommerce'), 'desc' => __('This sets the number of decimal points shown in displayed prices.', 'fflcommerce'), 'tip' => '', 'id' => 'fflcommerce_price_num_decimals', 'type' => 'natural'), array('type' => 'tab', 'name' => __('Images', 'fflcommerce')), array('name' => __('Image Options', 'fflcommerce'), '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.', 'fflcommerce'), 'https://wordpress.org/plugins/regenerate-thumbnails/')), array('name' => __('Cropping Options', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Crop Tiny images', 'fflcommerce'), '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).', 'fflcommerce'), 'id' => 'fflcommerce_use_wordpress_tiny_crop', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Crop Thumbnail images', 'fflcommerce'), '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).', 'fflcommerce'), 'id' => 'fflcommerce_use_wordpress_thumbnail_crop', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Crop Catalog images', 'fflcommerce'), '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).', 'fflcommerce'), 'id' => 'fflcommerce_use_wordpress_catalog_crop', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Crop Large images', 'fflcommerce'), '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).', 'fflcommerce'), 'id' => 'fflcommerce_use_wordpress_featured_crop', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Image Sizes', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Tiny Image Width', 'fflcommerce'), 'desc' => __('Default = 36px', 'fflcommerce'), 'tip' => __('Set the width of the small image used in the Cart, Checkout, Orders and Widgets.', 'fflcommerce'), 'id' => 'fflcommerce_shop_tiny_w', 'type' => 'natural'), array('name' => __('Tiny Image Height', 'fflcommerce'), 'desc' => __('Default = 36px', 'fflcommerce'), 'tip' => __('Set the height of the small image used in the Cart, Checkout, Orders and Widgets.', 'fflcommerce'), 'id' => 'fflcommerce_shop_tiny_h', 'type' => 'natural'), array('name' => __('Thumbnail Image Width', 'fflcommerce'), 'desc' => __('Default = 90px', 'fflcommerce'), 'tip' => __('Set the width of the thumbnail image for Single Product page extra images.', 'fflcommerce'), 'id' => 'fflcommerce_shop_thumbnail_w', 'type' => 'natural'), array('name' => __('Thumbnail Image Height', 'fflcommerce'), 'desc' => __('Default = 90px', 'fflcommerce'), 'tip' => __('Set the height of the thumbnail image for Single Product page extra images.', 'fflcommerce'), 'id' => 'fflcommerce_shop_thumbnail_h', 'type' => 'natural'), array('name' => __('Catalog Image Width', 'fflcommerce'), 'desc' => __('Default = 150px', 'fflcommerce'), 'tip' => __('Set the width of the catalog image for Shop, Categories, Tags, and Related Products.', 'fflcommerce'), 'id' => 'fflcommerce_shop_small_w', 'type' => 'natural'), array('name' => __('Catalog Image Height', 'fflcommerce'), 'desc' => __('Default = 150px', 'fflcommerce'), 'tip' => __('Set the height of the catalog image for Shop, Categories, Tags, and Related Products.', 'fflcommerce'), 'id' => 'fflcommerce_shop_small_h', 'type' => 'natural'), array('name' => __('Large Image Width', 'fflcommerce'), 'desc' => __('Default = 300px', 'fflcommerce'), 'tip' => __('Set the width of the Single Product page large or Featured image.', 'fflcommerce'), 'id' => 'fflcommerce_shop_large_w', 'type' => 'natural'), array('name' => __('Large Image Height', 'fflcommerce'), 'desc' => __('Default = 300px', 'fflcommerce'), 'tip' => __('Set the height of the Single Product page large or Featured image.', 'fflcommerce'), 'id' => 'fflcommerce_shop_large_h', 'type' => 'natural'), array('type' => 'tab', 'name' => __('Products & Inventory', 'fflcommerce')), array('name' => __('Product Options', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Enable SKU field', 'fflcommerce'), 'desc' => '', 'tip' => __('Turning off the SKU field will give products an SKU of their post id.', 'fflcommerce'), 'id' => 'fflcommerce_enable_sku', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Enable weight field', 'fflcommerce'), 'desc' => '', 'tip' => '', 'id' => 'fflcommerce_enable_weight', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Weight Unit', 'fflcommerce'), 'desc' => '', 'tip' => __("This controls what unit you will define weights in.", 'fflcommerce'), 'id' => 'fflcommerce_weight_unit', 'type' => 'radio', 'choices' => array('kg' => __('Kilograms', 'fflcommerce'), 'lbs' => __('Pounds', 'fflcommerce'))), array('name' => __('Enable product dimensions', 'fflcommerce'), 'desc' => '', 'tip' => '', 'id' => 'fflcommerce_enable_dimensions', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Dimensions Unit', 'fflcommerce'), 'desc' => '', 'tip' => __('This controls what unit you will define dimensions in.', 'fflcommerce'), 'id' => 'fflcommerce_dimension_unit', 'type' => 'radio', 'choices' => array('cm' => __('centimeters', 'fflcommerce'), 'in' => __('inches', 'fflcommerce'))), array('name' => __('Product thumbnail images per row', 'fflcommerce'), 'desc' => __('Default = 3', 'fflcommerce'), 'tip' => __('Determines how many extra product thumbnail images attached to a product to show on one row for the Single Product page.', 'fflcommerce'), 'id' => 'fflcommerce_product_thumbnail_columns', 'type' => 'number', 'extra' => array('min' => 1, 'max' => 10, 'step' => 1)), array('name' => __('Show related products', 'fflcommerce'), 'desc' => '', 'tip' => __('To show or hide the related products section on a single product page.', 'fflcommerce'), 'id' => 'fflcommerce_enable_related_products', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Inventory Options', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Manage stock', 'fflcommerce'), 'desc' => __('If you are not managing stock, turn it off here to disable it in admin and on the front-end.', 'fflcommerce'), 'tip' => __('You can manage stock on a per-item basis if you leave this option on.', 'fflcommerce'), 'id' => 'fflcommerce_manage_stock', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Show stock amounts', 'fflcommerce'), 'desc' => '', 'tip' => __('Set to yes to allow customers to view the amount of stock available for a product.', 'fflcommerce'), 'id' => 'fflcommerce_show_stock', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Notify on low stock', 'fflcommerce'), 'desc' => '', 'id' => 'fflcommerce_notify_low_stock', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Low stock threshold', 'fflcommerce'), 'desc' => '', 'tip' => __('You will receive a notification as soon this threshold is hit (if notifications are turned on).', 'fflcommerce'), 'id' => 'fflcommerce_notify_low_stock_amount', 'type' => 'natural', 'std' => '2'), array('name' => __('Notify on out of stock', 'fflcommerce'), 'desc' => '', 'id' => 'fflcommerce_notify_no_stock', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Out of stock threshold', 'fflcommerce'), 'desc' => '', 'tip' => __('You will receive a notification as soon this threshold is hit (if notifications are turned on).', 'fflcommerce'), 'id' => 'fflcommerce_notify_no_stock_amount', 'type' => 'natural'), array('name' => __('Hide out of stock products', 'fflcommerce'), '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.', 'fflcommerce'), 'id' => 'fflcommerce_hide_no_stock_product', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('type' => 'tab', 'name' => __('Tax', 'fflcommerce')), array('name' => __('Tax Options', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Calculate Taxes', 'fflcommerce'), 'desc' => __('Only turn this off if you are exclusively selling non-taxable items.', 'fflcommerce'), 'tip' => __('If you are not calculating taxes then you can ignore all other tax options.', 'fflcommerce'), 'id' => 'fflcommerce_calc_taxes', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Apply Taxes After Coupon', 'fflcommerce'), 'desc' => __('This will have no effect if Calculate Taxes is turned off.', 'fflcommerce'), 'tip' => __('If yes, taxes get applied after coupons. When no, taxes get applied before coupons.', 'fflcommerce'), 'id' => 'fflcommerce_tax_after_coupon', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Catalog Prices include tax?', 'fflcommerce'), 'desc' => __('This will only apply to the Shop, Category and Product pages.', 'fflcommerce'), 'tip' => __('This will have no effect on the Cart, Checkout, Emails, or final Orders; prices are always shown with tax out.', 'fflcommerce'), 'id' => 'fflcommerce_prices_include_tax', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Country to base taxes on', 'fflcommerce'), 'desc' => __('This option defines whether to use billing or shipping address to calculate taxes.', 'fflcommerce'), 'id' => 'fflcommerce_country_base_tax', 'type' => 'select', 'choices' => array('billing_country' => __('Billing', 'fflcommerce'), 'shipping_country' => __('Shipping', 'fflcommerce'))), array('name' => __('Additional Tax classes', 'fflcommerce'), 'desc' => __('List 1 per line. This is in addition to the default <em>Standard Rate</em>.', 'fflcommerce'), 'tip' => __('List product and shipping tax classes here, e.g. Zero Tax, Reduced Rate.', 'fflcommerce'), 'id' => 'fflcommerce_tax_classes', 'type' => 'textarea'), array('name' => __('Tax rates', 'fflcommerce'), 'desc' => '', 'tip' => __('To avoid rounding errors, insert tax rates with 4 decimal places.', 'fflcommerce'), 'id' => 'fflcommerce_tax_rates', 'type' => 'tax_rates'), array('name' => __('Default options for new products', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Tax status', 'fflcommerce'), 'tip' => __('Whether new products should be taxable by default.', 'fflcommerce'), 'id' => 'fflcommerce_tax_defaults_status', 'type' => 'select', 'std' => 'taxable', 'choices' => array('taxable' => __('Taxable', 'fflcommerce'), 'shipping' => __('Shipping', 'fflcommerce'), 'none' => __('None', 'fflcommerce'))), array('name' => __('Tax classes', 'fflcommerce'), 'tip' => __('List of tax classes added by default to new products.', 'fflcommerce'), 'id' => 'fflcommerce_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', 'fflcommerce')), array('name' => __('Shipping Options', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Enable Shipping', 'fflcommerce'), 'desc' => __('Only turn this off if you are <strong>not</strong> shipping items, or items have shipping costs included.', 'fflcommerce'), 'tip' => __('If turned off, this will also remove shipping address fields on the Checkout.', 'fflcommerce'), 'id' => 'fflcommerce_calc_shipping', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Enable shipping calculator on cart', 'fflcommerce'), 'desc' => '', 'tip' => '', 'id' => 'fflcommerce_enable_shipping_calc', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Only ship to billing address?', 'fflcommerce'), 'desc' => '', 'tip' => __('When activated, Shipping address fields will not appear on the Checkout.', 'fflcommerce'), 'id' => 'fflcommerce_ship_to_billing_address_only', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Checkout always shows Shipping fields?', 'fflcommerce'), 'desc' => __('This will have no effect if "Only ship to billing address" is activated.', 'fflcommerce'), 'tip' => __('When activated, Shipping address fields will appear by default on the Checkout.', 'fflcommerce'), 'id' => 'fflcommerce_show_checkout_shipping_fields', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Available Shipping Methods', 'fflcommerce'), 'type' => 'title', 'desc' => __('Please enable all of the Shipping Methods you wish to make available to your customers.', 'fflcommerce')), array('type' => 'tab', 'name' => __('Payment Gateways', 'fflcommerce')), array('name' => __('Gateway Options', 'fflcommerce'), 'type' => 'title', 'desc' => ''), array('name' => __('Default Gateway', 'fflcommerce'), 'desc' => __('Only enabled gateways will appear in this list.', 'fflcommerce'), 'tip' => __('This will determine which gateway appears first in the Payment Methods list on the Checkout.', 'fflcommerce'), 'id' => 'fflcommerce_default_gateway', 'type' => 'default_gateway', 'choices' => apply_filters('fflcommerce_available_payment_gateways', array())), array('name' => __('Available gateways', 'fflcommerce'), 'type' => 'title', 'desc' => __('Please enable all of the Payment Gateways you wish to make available to your customers.', 'fflcommerce')));
 }
コード例 #9
0
}
?>
	</ul>
	<div class="form-row">
		<noscript>
			<?php 
_e('Since your browser does not support JavaScript, or it is disabled, please ensure you click the <em>Update Totals</em> button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'fflcommerce');
?>
			<br /><input type="submit" class="button-alt" name="update_totals" value="<?php 
_e('Update totals', 'fflcommerce');
?>
" />
		</noscript>

		<?php 
fflcommerce::nonce_field('process_checkout');
?>

		<?php 
do_action('fflcommerce_review_order_before_submit');
?>

		<?php 
if (fflcommerce_get_page_id('terms') > 0) {
    ?>
			<p class="form-row terms">
				<label for="terms" class="checkbox"><?php 
    _e('I accept the', 'fflcommerce');
    ?>
					<a href="<?php 
    echo esc_url(get_permalink(fflcommerce_get_page_id('terms')));
コード例 #10
0
ファイル: futurepay.php プロジェクト: barnent1/fflcommerce
    /**
     *  Generate the futurepay payment iframe
     */
    protected function call_futurepay($order_id)
    {
        // Get the order
        $order = new fflcommerce_order($order_id);
        $data = array('gmid' => $this->gmid, 'reference' => $order_id . '-' . uniqid(), 'email' => $order->billing_email, 'first_name' => $order->billing_first_name, 'last_name' => $order->billing_last_name, 'company' => $order->billing_company, 'address_line_1' => $order->billing_address_1, 'address_line_2' => $order->billing_address_2, 'city' => $order->billing_city, 'state' => $order->billing_state, 'country' => $order->billing_country, 'zip' => $order->billing_postcode, 'phone' => $order->billing_phone, 'shipping_address_line_1' => $order->shipping_address_1, 'shipping_address_line_2' => $order->shipping_address_2, 'shipping_city' => $order->shipping_city, 'shipping_state' => $order->shipping_state, 'shipping_country' => $order->shipping_country, 'shipping_zip' => $order->shipping_postcode, 'shipping_date' => date('Y/m/d g:i:s'));
        // for FFL Commerce 1.0, FuturePay doesn't allow negative prices (or 0.00 ) which affects discounts
        // with FuturePay doing the calcs, so we will bundle all products into ONE line item with
        // a quantity of ONE and send it that way using the final order total after shipping
        // and discounts are applied
        // all product titles will be comma delimited with their quantities
        $item_names = array();
        if (sizeof($order->items) > 0) {
            foreach ($order->items as $item) {
                $_product = $order->get_product_from_item($item);
                $title = $_product->get_title();
                // if variation, insert variation details into product title
                if ($_product instanceof fflcommerce_product_variation) {
                    $title .= ' (' . fflcommerce_get_formatted_variation($_product, $item['variation'], true) . ')';
                }
                $item_names[] = $item['qty'] . ' x ' . $title;
            }
        }
        // now add the one line item to the necessary product field arrays
        $data['sku'][] = "Products";
        $data['price'][] = $order->order_total;
        // futurepay only needs final order amount
        $data['tax_amount'][] = 0;
        $data['description'][] = sprintf(__('Order %s', 'fflcommerce'), $order->get_order_number()) . ' = ' . implode(', ', $item_names);
        $data['quantity'][] = 1;
        try {
            $response = wp_remote_post(self::$request_url . 'merchant-request-order-token', array('body' => http_build_query($data), 'sslverify' => false));
            // Convert error to exception
            if (is_wp_error($response)) {
                if (class_exists('WP_Exception') && $response instanceof WP_Exception) {
                    throw $response;
                } else {
                    fflcommerce_log($response->get_error_message());
                    throw new Exception($response->get_error_message());
                }
            }
            // Fetch the body from the result, any errors should be caught before proceeding
            $response = trim(wp_remote_retrieve_body($response));
            // we need something to validate the response.  Valid transactions begin with 'FPTK'
            if (!strstr($response, 'FPTK')) {
                $error_message = isset(self::$futurepay_errorcodes[$response]) ? self::$futurepay_errorcodes[$response] : __('An unknown error has occured with code = ', 'fflcommerce') . $response;
                $order->add_order_note(sprintf(__('FUTUREPAY: %s', 'fflcommerce'), $error_message));
                fflcommerce::add_error(sprintf(__('FUTUREPAY: %s.  Please try again or select another gateway for your Order.', 'fflcommerce'), $error_message));
                wp_safe_redirect(get_permalink(fflcommerce_get_page_id('checkout')));
                exit;
            }
            /**
             *  If we're good to go, haul in FuturePay's javascript and display the payment form
             *  so that the customer can enter his ID and password
             */
            echo '<div id="futurepay"></div>';
            echo '<script src="' . self::$request_url . 'cart-integration/' . $response . '"></script>';
            echo '<script type="text/javascript">
				/*<![CDATA[*/
				jQuery(window).load( function() {
					FP.CartIntegration();

					// Need to replace form html
					jQuery("#futurepay").html(FP.CartIntegration.getFormContent());
					FP.CartIntegration.displayFuturePay();
				});

				function FuturePayResponseHandler(response) {
					if (response.error) {
						// TODO: we need something better than this
						alert(response.code + " " + response.message);
					}
					else {
						window.location.replace("./?futurepay="+response.transaction_id);
					}

				}
				/*]]>*/
			</script>';
            echo '<input type="button" class="button alt" name="place_order" id="place_order" value="Place Order" onclick="FP.CartIntegration.placeOrder();" />';
        } catch (Exception $e) {
            echo '<div class="fflcommerce_error">' . $e->getMessage() . '</div>';
            fflcommerce_log('FUTUREPAY ERROR: ' . $e->getMessage());
        }
    }
コード例 #11
0
ファイル: cart.php プロジェクト: barnent1/fflcommerce
					<div class="coupon">
						<label for="coupon_code"><?php 
        _e('Coupon', 'fflcommerce');
        ?>
:</label> <input type="text" name="coupon_code" class="input-text" id="coupon_code" value="" />
						<input type="submit" class="button" name="apply_coupon" value="<?php 
        _e('Apply Coupon', 'fflcommerce');
        ?>
" />
					</div>
				<?php 
    }
    ?>

				<?php 
    fflcommerce::nonce_field('cart');
    ?>

				<?php 
    if ($options->get('fflcommerce_cart_shows_shop_button') == 'no') {
        ?>
					<noscript>
						<input type="submit" class="button" name="update_cart" value="<?php 
        _e('Update Shopping Cart', 'fflcommerce');
        ?>
" />
					</noscript>
					<a href="<?php 
        echo esc_url(fflcommerce_cart::get_checkout_url());
        ?>
" class="checkout-button button-alt"><?php 
コード例 #12
0
 /**
  * Get the add to url
  *
  * @return  mixed
  */
 public function add_to_cart_url()
 {
     if ($this->has_child()) {
         $url = add_query_arg('add-to-cart', 'group');
         $url = add_query_arg('product', $this->ID, $url);
         if ($this->is_type('variable')) {
             $url = add_query_arg('add-to-cart', 'variation');
         }
     } else {
         $url = add_query_arg('add-to-cart', $this->ID);
     }
     return fflcommerce::nonce_url('add_to_cart', $url);
 }
コード例 #13
0
function fflcommerce_custom_product_columns($column)
{
    global $post;
    $fflcommerce_options = FFLCommerce_Base::get_options();
    $product = new fflcommerce_product($post->ID);
    switch ($column) {
        case "thumb":
            if ('trash' != $post->post_status) {
                echo '<a class="row-title" href="' . get_edit_post_link($post->ID) . '">';
                echo fflcommerce_get_product_thumbnail('admin_product_list');
                echo '</a>';
            } else {
                echo fflcommerce_get_product_thumbnail('admin_product_list');
            }
            break;
        case "price":
            echo $product->get_price_html();
            break;
        case "featured":
            $url = wp_nonce_url(admin_url('admin-ajax.php?action=fflcommerce-feature-product&product_id=' . $post->ID));
            echo '<a href="' . esc_url($url) . '" title="' . __('Change', 'fflcommerce') . '">';
            if ($product->is_featured()) {
                echo '<a href="' . esc_url($url) . '"><img src="' . fflcommerce::assets_url() . '/assets/images/head_featured_desc.png" alt="yes" />';
            } else {
                echo '<img src="' . fflcommerce::assets_url() . '/assets/images/head_featured.png" alt="no" />';
            }
            echo '</a>';
            break;
        case "stock":
            if (!$product->is_type('grouped') && $product->is_in_stock()) {
                if ($product->managing_stock()) {
                    if ($product->is_type('variable') && $product->stock > 0) {
                        echo $product->stock . ' ' . __('In Stock', 'fflcommerce');
                    } else {
                        if ($product->is_type('variable')) {
                            $stock_total = 0;
                            foreach ($product->get_children() as $child_ID) {
                                $child = $product->get_child($child_ID);
                                $stock_total += (int) $child->stock;
                            }
                            echo $stock_total . ' ' . __('In Stock', 'fflcommerce');
                        } else {
                            echo $product->stock . ' ' . __('In Stock', 'fflcommerce');
                        }
                    }
                } else {
                    echo __('In Stock', 'fflcommerce');
                }
            } elseif ($product->is_type('grouped')) {
                echo __('Parent (no stock)', 'fflcommerce');
            } else {
                echo '<strong class="attention">' . __('Out of Stock', 'fflcommerce') . '</strong>';
            }
            break;
        case "product-type":
            echo __(ucwords($product->product_type), 'fflcommerce');
            echo '<br/>';
            if ($fflcommerce_options->get('fflcommerce_enable_sku', true) == 'yes' && ($sku = get_post_meta($post->ID, 'sku', true))) {
                echo $sku;
            } else {
                echo $post->ID;
            }
            break;
        case "product-date":
            if ('0000-00-00 00:00:00' == $post->post_date) {
                $t_time = $h_time = __('Unpublished', 'fflcommerce');
                $time_diff = 0;
            } else {
                $t_time = get_the_time(__('Y/m/d g:i:s A', 'fflcommerce'));
                $m_time = $post->post_date;
                $time = get_post_time('G', true, $post);
                $time_diff = time() - $time;
                if ($time_diff > 0 && $time_diff < 24 * 60 * 60) {
                    $h_time = sprintf(__('%s ago', 'fflcommerce'), human_time_diff($time));
                } else {
                    $h_time = mysql2date(__('Y/m/d', 'fflcommerce'), $m_time);
                }
            }
            echo '<abbr title="' . esc_attr($t_time) . '">' . apply_filters('post_date_column_time', $h_time, $post) . '</abbr><br />';
            if ('publish' == $post->post_status) {
                _e('Published', 'fflcommerce');
            } elseif ('future' == $post->post_status) {
                if ($time_diff > 0) {
                    echo '<strong class="attention">' . __('Missed schedule', 'fflcommerce') . '</strong>';
                } else {
                    _e('Scheduled', 'fflcommerce');
                }
            } else {
                _e('Draft', 'fflcommerce');
            }
            if ($product->visibility) {
                echo $product->visibility != 'visible' ? '<br /><strong class="attention">' . ucfirst($product->visibility) . '</strong>' : '';
            }
            break;
        case "product-visibility":
            if ($product->visibility) {
                echo $product->visibility == 'Hidden' ? '<strong class="attention">' . ucfirst($product->visibility) . '</strong>' : ucfirst($product->visibility);
            }
            break;
    }
}
コード例 #14
0
function fflcommerce_order_tracking($atts)
{
    extract(shortcode_atts(array(), $atts));
    global $post;
    $fflcommerce_options = FFLCommerce_Base::get_options();
    if ($_POST) {
        $order = new fflcommerce_order();
        $order->id = !empty($_POST['orderid']) ? $_POST['orderid'] : 0;
        if (isset($_POST['order_email']) && $_POST['order_email']) {
            $order_email = trim($_POST['order_email']);
        } else {
            $order_email = '';
        }
        if (!fflcommerce::verify_nonce('order_tracking')) {
            echo '<p>' . __('You have taken too long. Please refresh the page and retry.', 'fflcommerce') . '</p>';
        } elseif ($order->id && $order_email && $order->get_order(apply_filters('fflcommerce_shortcode_order_tracking_order_id', $order->id))) {
            if ($order->billing_email == $order_email) {
                echo '<p>' . sprintf(__('Order %s which was made %s ago and has the status "%s"', 'fflcommerce'), $order->get_order_number(), human_time_diff(strtotime($order->order_date), current_time('timestamp')), __($order->status, 'fflcommerce'));
                if ($order->status == 'completed') {
                    $completed = (array) get_post_meta($order->id, '_js_completed_date', true);
                    if (!empty($completed)) {
                        $completed = $completed[0];
                    } else {
                        $completed = '';
                    }
                    // shouldn't happen, reset to be sure
                    echo sprintf(__(' was completed %s ago', 'fflcommerce'), human_time_diff(strtotime($completed), current_time('timestamp')));
                }
                echo '.</p>';
                do_action('fflcommerce_tracking_details_info', $order);
                ?>
				<?php 
                do_action('fflcommerce_before_track_order_details', $order->id);
                ?>
				<h2><?php 
                _e('Order Details', 'fflcommerce');
                ?>
</h2>
				<table class="shop_table">
					<thead>
						<tr>
							<th><?php 
                _e('ID/SKU', 'fflcommerce');
                ?>
</th>
							<th><?php 
                _e('Title', 'fflcommerce');
                ?>
</th>
							<th><?php 
                _e('Price', 'fflcommerce');
                ?>
</th>
							<th><?php 
                _e('Quantity', 'fflcommerce');
                ?>
</th>
						</tr>
					</thead>
					<tfoot>
                        <tr>
                            <?php 
                if ($fflcommerce_options->get('fflcommerce_calc_taxes') == 'yes' && $order->has_compound_tax() || $fflcommerce_options->get('fflcommerce_tax_after_coupon') == 'yes' && $order->order_discount > 0) {
                    ?>
                                <td colspan="3"><?php 
                    _e('Retail Price', 'fflcommerce');
                    ?>
</td>
                            <?php 
                } else {
                    ?>
                                <td colspan="3"><?php 
                    _e('Subtotal', 'fflcommerce');
                    ?>
</td>
                            <?php 
                }
                ?>
                                <td><?php 
                echo $order->get_subtotal_to_display();
                ?>
</td>
                        </tr>
                        <?php 
                if ($order->order_shipping > 0) {
                    ?>
                            <tr>
                                <td colspan="3"><?php 
                    _e('Shipping', 'fflcommerce');
                    ?>
</td>
                                <td><?php 
                    echo $order->get_shipping_to_display();
                    ?>
</td>
                            </tr>
                            <?php 
                }
                do_action('fflcommerce_processing_fee_after_shipping');
                if ($fflcommerce_options->get('fflcommerce_tax_after_coupon') == 'yes' && $order->order_discount > 0) {
                    ?>
                            <tr class="discount">
                                <td colspan="3"><?php 
                    _e('Discount', 'fflcommerce');
                    ?>
</td>
                                <td>-<?php 
                    echo fflcommerce_price($order->order_discount);
                    ?>
</td>
                            </tr>
                            <?php 
                }
                if ($fflcommerce_options->get('fflcommerce_calc_taxes') == 'yes' && $order->has_compound_tax() || $fflcommerce_options->get('fflcommerce_tax_after_coupon') == 'yes' && $order->order_discount > 0) {
                    ?>
                            <tr>
                                <td colspan="3"><?php 
                    _e('Subtotal', 'fflcommerce');
                    ?>
</td>
                                <td><?php 
                    echo fflcommerce_price($order->order_discount_subtotal);
                    ?>
</td>
                            </tr>
                            <?php 
                }
                if ($fflcommerce_options->get('fflcommerce_calc_taxes') == 'yes') {
                    foreach ($order->get_tax_classes() as $tax_class) {
                        if ($order->show_tax_entry($tax_class)) {
                            ?>
                                    <tr>
                                        <td colspan="3"><?php 
                            echo $order->get_tax_class_for_display($tax_class) . ' (' . (double) $order->get_tax_rate($tax_class) . '%):';
                            ?>
</td>
                                        <td><?php 
                            echo $order->get_tax_amount($tax_class);
                            ?>
</td>
                                    </tr>
                                    <?php 
                        }
                    }
                }
                ?>
						<?php 
                if ($fflcommerce_options->get('fflcommerce_tax_after_coupon') == 'no' && $order->order_discount > 0) {
                    ?>
<tr class="discount">
							<td colspan="3"><?php 
                    _e('Discount', 'fflcommerce');
                    ?>
</td>
							<td>-<?php 
                    echo fflcommerce_price($order->order_discount);
                    ?>
</td>
						</tr><?php 
                }
                ?>
						<tr>
							<td colspan="3"><strong><?php 
                _e('Grand Total', 'fflcommerce');
                ?>
</strong></td>
							<td><strong><?php 
                echo fflcommerce_price($order->order_total);
                ?>
</strong></td>
						</tr>
					</tfoot>
					<tbody>
						<?php 
                foreach ($order->items as $order_item) {
                    if (isset($order_item['variation_id']) && $order_item['variation_id'] > 0) {
                        $_product = new fflcommerce_product_variation($order_item['variation_id']);
                    } else {
                        $_product = new fflcommerce_product($order_item['id']);
                    }
                    echo '<tr>';
                    echo '<td>' . $_product->sku . '</td>';
                    echo '<td class="product-name">' . $_product->get_title();
                    if ($_product instanceof fflcommerce_product_variation) {
                        echo fflcommerce_get_formatted_variation($_product, $order_item['variation']);
                    }
                    do_action('fflcommerce_display_item_meta_data', $order_item);
                    echo '</td>';
                    echo '<td>' . fflcommerce_price($order_item['cost']) . '</td>';
                    echo '<td>' . $order_item['qty'] . '</td>';
                    echo '</tr>';
                }
                ?>
					</tbody>
				</table>
				<?php 
                do_action('fflcommerce_after_track_order_details', $order->id);
                ?>

				<div style="width: 49%; float:left;">
					<h2><?php 
                _e('Billing Address', 'fflcommerce');
                ?>
</h2>
					<p><?php 
                $address = $order->billing_first_name . ' ' . $order->billing_last_name . '<br/>';
                if ($order->billing_company) {
                    $address .= $order->billing_company . '<br/>';
                }
                $address .= $order->formatted_billing_address;
                echo $address;
                ?>
</p>
				</div>
				<div style="width: 49%; float:right;">
					<h2><?php 
                _e('Shipping Address', 'fflcommerce');
                ?>
</h2>
					<p><?php 
                $address = $order->shipping_first_name . ' ' . $order->shipping_last_name . '<br/>';
                if ($order->shipping_company) {
                    $address .= $order->shipping_company . '<br/>';
                }
                $address .= $order->formatted_shipping_address;
                echo $address;
                ?>
</p>
				</div>
				<div class="clear"></div>
				<?php 
            } else {
                echo '<p>' . __('Sorry, we could not find that order id in our database. <a href="' . get_permalink($post->ID) . '">Want to retry?</a>', 'fflcommerce') . '</p>';
            }
        } else {
            echo '<p>' . sprintf(__('Sorry, we could not find that order id in our database. <a href="%s">Want to retry?</a></p>', 'fflcommerce'), get_permalink($post->ID));
        }
    } else {
        ?>
		<form action="<?php 
        echo esc_url(get_permalink($post->ID));
        ?>
" method="post" class="track_order">

			<p><?php 
        _e('To track your order please enter your Order ID and email address in the boxes below and press return. This was given to you on your receipt and in the confirmation email you should have received.', 'fflcommerce');
        ?>
</p>

			<p class="form-row form-row-first"><label for="orderid"><?php 
        _e('Order ID', 'fflcommerce');
        ?>
</label> <input class="input-text" type="text" name="orderid" id="orderid" placeholder="<?php 
        _e('Found in your order confirmation email.', 'fflcommerce');
        ?>
" /></p>
			<p class="form-row form-row-last"><label for="order_email"><?php 
        _e('Billing Email', 'fflcommerce');
        ?>
</label> <input class="input-text" type="text" name="order_email" id="order_email" placeholder="<?php 
        _e('Email you used during checkout.', 'fflcommerce');
        ?>
" /></p>
			<div class="clear"></div>
			<p class="form-row"><input type="submit" class="button" name="track" value="<?php 
        _e('Track"', 'fflcommerce');
        ?>
" /></p>
			<?php 
        fflcommerce::nonce_field('order_tracking');
        ?>
		</form>
		<?php 
    }
}
コード例 #15
0
ファイル: fflcommerce.php プロジェクト: barnent1/fflcommerce
function fflcommerce_check_comment_rating($comment_data)
{
    // If posting a comment (not trackback etc) and not logged in
    if (isset($_POST['rating']) && !fflcommerce::verify_nonce('comment_rating')) {
        wp_die(__('You have taken too long. Please go back and refresh the page.', 'fflcommerce'));
    } else {
        if (isset($_POST['rating']) && empty($_POST['rating']) && $comment_data['comment_type'] == '') {
            wp_die(__('Please rate the product.', "fflcommerce"));
            exit;
        }
    }
    return $comment_data;
}
コード例 #16
0
 /**
  * Check a nonce and sets FFL Commerce error in case it is invalid
  * To fail silently, set the error_message to an empty string
  *
  * @param  string $action then nonce action
  * @return   bool
  */
 public static function verify_nonce($action)
 {
     $name = '_n';
     $action = 'fflcommerce-' . $action;
     $request = array_merge($_GET, $_POST);
     if (!wp_verify_nonce($request[$name], $action)) {
         fflcommerce::add_error(__('Action failed. Please refresh the page and retry.', 'fflcommerce'));
         return false;
     }
     return true;
 }
コード例 #17
0
/**
 * Settings page
 *
 * Handles the display of the settings page in admin.
 *
 * @since 		1.0
 * @usedby 		fflcommerce_admin_menu2()
 */
function fflcommerce_settings()
{
    global $fflcommerce_options_settings;
    ?>
    <script type="text/javascript" src="<?php 
    echo fflcommerce::assets_url();
    ?>
/assets/js/bootstrap-tooltip.min.js"></script>
    <div class="wrap fflcommerce">
        <div class="icon32 icon32-fflcommerce-settings" id="icon-fflcommerce"><br/></div>
        <?php 
    do_action('fflcommerce_admin_settings_notices');
    ?>
        <form method="post" id="mainform" action="">
        	<?php 
    wp_nonce_field('fflcommerce-update-settings', '_fflcommerce_csrf');
    ?>
    		<?php 
    fflcommerce_admin_fields($fflcommerce_options_settings);
    ?>
            <input name="submitted" type="hidden" value="yes" />
        </form>
    </div>
    <?php 
}
コード例 #18
0
ファイル: worldpay.php プロジェクト: barnent1/fflcommerce
 /**
  *  Default Option settings for WordPress Settings API using the FFLCommerce_Options class
  *  These will be installed on the FFLCommerce_Options 'Payment Gateways' tab by the parent class 'fflcommerce_payment_gateway'
  */
 protected function get_default_options()
 {
     return array(array('name' => sprintf(__('WorldPay %s', 'fflcommerce'), '<img style="vertical-align:middle;margin-top:-4px;margin-left:10px;" src="' . fflcommerce::assets_url() . '/assets/images/icons/worldpay.png" alt="WorldPay">'), 'type' => 'title', 'desc' => sprintf(__("To ensure your <strong>Preferential FFL Commerce Partner Rates</strong>, please complete your %s.  Merchants who fail to register here will be put on WorldPay standard new business accounts which carry higher rates.<br/><br/>The WorldPay gateway uses a Dynamic Response URL. You <strong>must activate</strong> this in your %s with the following:<br/>1) Go to <strong>WorldPay Merchant Interface -> Installations -> Integration Setup (TEST / PRODUCTION)</strong><br/>2) Check the <strong>Payment Response enabled?</strong> checkbox. <br/>3) Copy and Paste the full tag in bold <strong>&lt;wpdisplay item=MC_callback&gt;</strong> to the <strong>Payment Response URL</strong> input field.<br/>4) Check the <strong>Enable the Shopper Response</strong> checkbox. <br/>5) Save Changes.", 'fflcommerce'), '<a href="https://business.worldpay.com/partner/fflcommerce" target="_blank">WorldPay Merchant registration here</a>', '<a href="https://secure.worldpay.com/sso/public/auth/login.html?serviceIdentifier=merchantadmin" target="_blank">WorldPay Merchant Account</a>')), array('name' => __('Enable WorldPay', 'fflcommerce'), 'desc' => '', 'tip' => '', 'id' => 'fflcommerce_worldpay_is_enabled', 'std' => 'no', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Method Title', 'fflcommerce'), 'desc' => '', 'tip' => __('This controls the title which the user sees during checkout and also appears as the Payment Method on final Orders.', 'fflcommerce'), 'id' => 'fflcommerce_worldpay_method_title', 'std' => __('Credit Card via WorldPay', 'fflcommerce'), 'type' => 'text'), array('name' => __('Description', 'fflcommerce'), 'desc' => '', 'tip' => __('This controls the description which the user sees during checkout.', 'fflcommerce'), 'id' => 'fflcommerce_worldpay_checkout_description', 'std' => __("When you Place your Order, you will be directed to the secured WorldPay servers to enter your credit card information.  (Your Billing Address above must match that used on your Credit Card)", 'fflcommerce'), 'type' => 'textarea'), array('name' => __('Enable WorldPay Test Mode', 'fflcommerce'), 'desc' => 'Enable to make test transactions.', 'tip' => '', 'id' => 'fflcommerce_worldpay_test_mode', 'std' => 'no', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Installation ID', 'fflcommerce'), 'desc' => '', 'tip' => __('Please enter your WorldPay Installation ID.', 'fflcommerce'), 'id' => 'fflcommerce_worldpay_install_id', 'std' => '', 'type' => 'text'), array('name' => __('Payment Response Password', 'fflcommerce'), 'desc' => '', 'tip' => __("This option adds an additional security check to the Payment Response sent from WorldPay to FFL Commerce, to help validate that the Payment has been sent from WorldPay<br/>1. Add a <strong>'Payment Response Password'</strong> here <br/>2. Add the password in <strong>Merchant Interface->Installations->Integration Setup (TEST or PRODUCTION)-><em>Payment Response Password</em></strong> field.<br/>Leave both empty to skip this check.", 'fflcommerce'), 'id' => 'fflcommerce_worldpay_response_password', 'std' => '', 'type' => 'text'), array('name' => __('Use MD5 SignatureFields', 'fflcommerce'), 'desc' => 'The phrase to copy: <strong>instId:cartId:amount:currency</strong>', 'tip' => __("This option enables you to use a 'MD5 + secret word' encrypted signature before sending order details to WorldPay as a measure against unauthorized tampering.<br/>The signature will encrypt the mandatory parameters (Installation Id, Order Id, amount, currency).<br/>To enable:<br/>1) Copy the exact phrase (case sensitive, in bold) shown under the setting checkbox.<br>2) Paste into your <strong>WorldPay Merchant Interface -> Installations -> Integration Setup (TEST or PRODUCTION) -><em>SignatureFields</em></strong> input box and also enable this setting checkbox.<br>2) You must also enter a <strong>Secret Word</strong> in the next setting and save the settings.", 'fflcommerce'), 'id' => 'fflcommerce_worldpay_md5', 'std' => 'yes', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Secret Word', 'fflcommerce'), 'desc' => '', 'tip' => __("<strong>(REQUIRED IF MD5 SIGNATURE IS ENABLED)</strong> Enter here the Secret Word you will use to hash the MD5 signature. The word needs to be up to 16 characters, known only to yourself and to WorldPay.<br/> This secret must also be entered into the <strong>WorldPay Merchant Interface -> Installations -> Integration Setup (TEST or PRODUCTION) -><em>MD5 secret for transactions</em></strong> field.", 'fflcommerce'), 'id' => 'fflcommerce_worldpay_md5_secret_word', 'std' => '', 'type' => 'text'), array('name' => __('Fixed Payment Currency', 'fflcommerce'), 'desc' => '', 'tip' => __('This option hides the currency menu on the WorldPay page, which will fix the currency that the shopper must purchase in.<br/><b>The currency submitted is the main currency of your Shop.</b>  With this option disabled, customers will be able to select their currency and see the corrected price for the Order.', 'fflcommerce'), 'id' => 'fflcommerce_worldpay_fixed_currency', 'std' => 'no', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Receive Error Logs', 'fflcommerce'), 'desc' => '', 'tip' => __("Do you want to receive emails for the error logs from FFL Commerce security/fraud checks.", 'fflcommerce'), 'id' => 'fflcommerce_worldpay_receive_security_logs', 'std' => 'yes', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'fflcommerce'), 'yes' => __('Yes', 'fflcommerce'))), array('name' => __('Email error logs to', 'fflcommerce'), 'desc' => '', 'tip' => __('Email address you want to receive all error logs to. If email field is empty, the FFL Commerce email address will be used.', 'fflcommerce'), 'id' => 'fflcommerce_worldpay_security_logs_emailto', 'std' => '', 'type' => 'email'));
 }
コード例 #19
0
ファイル: edit_address.php プロジェクト: barnent1/fflcommerce
    _e('Shipping Address', 'fflcommerce');
    ?>
		<?php 
}
?>
	</h3>
	<?php 
foreach ($address as $field) {
    ?>
		<?php 
    fflcommerce_customer::address_form_field($field);
    ?>
	<?php 
}
?>
	<?php 
fflcommerce::nonce_field('edit_address');
?>
	<input type="submit" class="button" name="save_address" value="<?php 
_e('Save Address', 'fflcommerce');
?>
" />
	<a class="button-alt" href="<?php 
echo $account_url;
?>
"><?php 
_e('Go back to My Account', 'fflcommerce');
?>
</a>
</form>
コード例 #20
0
ファイル: pay.php プロジェクト: barnent1/fflcommerce
function fflcommerce_pay_action()
{
    if (!is_fflcommerce_single_page(FFLCOMMERCE_PAY)) {
        return;
    }
    if (isset($_GET['pay_for_order']) && isset($_GET['order']) && isset($_GET['order_id'])) {
        // Pay for existing order
        $order_key = urldecode($_GET['order']);
        $order_id = (int) $_GET['order_id'];
        $order = new fflcommerce_order($order_id);
        if ($order->id == $order_id && $order->order_key == $order_key && $order->status == 'pending') {
            // Set customer location to order location
            if ($order->billing_country) {
                fflcommerce_customer::set_country($order->billing_country);
            }
            if ($order->billing_state) {
                fflcommerce_customer::set_state($order->billing_state);
            }
            if ($order->billing_postcode) {
                fflcommerce_customer::set_postcode($order->billing_postcode);
            }
            // Pay form was posted - process payment
            if (isset($_POST['pay']) && fflcommerce::verify_nonce('pay')) {
                // Update payment method
                if ($order->order_total > 0) {
                    $payment_method = fflcommerce_clean($_POST['payment_method']);
                    $data = (array) maybe_unserialize(get_post_meta($order_id, 'order_data', true));
                    $data['payment_method'] = $payment_method;
                    update_post_meta($order_id, 'order_data', $data);
                    $available_gateways = fflcommerce_payment_gateways::get_available_payment_gateways();
                    $result = $available_gateways[$payment_method]->process_payment($order_id);
                    // Redirect to success/confirmation/payment page
                    if ($result['result'] == 'success') {
                        wp_safe_redirect($result['redirect']);
                        exit;
                    }
                } else {
                    // No payment was required for order
                    $order->payment_complete();
                    // filter redirect page
                    $checkout_redirect = apply_filters('fflcommerce_get_checkout_redirect_page_id', fflcommerce_get_page_id('thanks'));
                    wp_safe_redirect(get_permalink($checkout_redirect));
                    exit;
                }
            }
        } elseif ($order->status != 'pending') {
            fflcommerce::add_error(__('Your order has already been paid for. Please contact us if you need assistance.', 'fflcommerce'));
        } else {
            fflcommerce::add_error(__('Invalid order.', 'fflcommerce'));
        }
    } else {
        // Pay for order after checkout step
        if (isset($_GET['order'])) {
            $order_id = $_GET['order'];
        } else {
            $order_id = 0;
        }
        if (isset($_GET['key'])) {
            $order_key = $_GET['key'];
        } else {
            $order_key = '';
        }
        if ($order_id > 0) {
            $order = new fflcommerce_order($order_id);
            if ($order->order_key != $order_key || $order->status != 'pending') {
                wp_safe_redirect(apply_filters('fflcommerce_get_myaccount_page_id', get_permalink(fflcommerce_get_page_id('myaccount'))));
                exit;
            }
        } else {
            wp_safe_redirect(apply_filters('fflcommerce_get_myaccount_page_id', get_permalink(fflcommerce_get_page_id('myaccount'))));
            exit;
        }
    }
}
コード例 #21
0
function fflcommerce_cancel_order()
{
    if (isset($_GET['cancel_order']) && isset($_GET['order']) && isset($_GET['order_id'])) {
        $order_key = urldecode($_GET['order']);
        $order_id = (int) $_GET['order_id'];
        $order = new fflcommerce_order($order_id);
        if ($order->id == $order_id && $order->order_key == $order_key && $order->status == 'pending' && fflcommerce::verify_nonce('cancel_order')) {
            // Cancel the order + restore stock
            $order->cancel_order(__('Order cancelled by customer.', 'fflcommerce'));
            // Message
            fflcommerce::add_message(__('Your order was cancelled.', 'fflcommerce'));
        } elseif ($order->status != 'pending') {
            fflcommerce::add_error(__('Your order is no longer pending and could not be cancelled. Please contact us if you need assistance.', 'fflcommerce'));
        } else {
            fflcommerce::add_error(__('Invalid order.', 'fflcommerce'));
        }
        wp_safe_redirect(fflcommerce_cart::get_cart_url());
        exit;
    }
}
コード例 #22
0
 /** Generates a URL so that a customer can cancel their (unpaid - pending) order */
 public function get_cancel_order_url()
 {
     return apply_filters('fflcommerce_get_cancel_order', fflcommerce::nonce_url('cancel_order', add_query_arg('cancel_order', 'true', add_query_arg('order', $this->order_key, add_query_arg('order_id', $this->id, home_url())))));
 }
コード例 #23
0
 private function create_user_account()
 {
     $reg_errors = new WP_Error();
     do_action('register_post', $this->posted['billing_email'], $this->posted['billing_email'], $reg_errors);
     if ($reg_errors->get_error_code()) {
         fflcommerce::add_error($reg_errors->get_error_message());
         return 0;
     }
     $user_pass = $this->posted['account_password'];
     $user_id = wp_create_user($this->posted['account_username'], $user_pass, $this->posted['billing_email']);
     if (!$user_id) {
         fflcommerce::add_error(sprintf(__('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !', 'fflcommerce'), self::get_options()->get('fflcommerce_email')));
         return 0;
     }
     wp_update_user(array('ID' => $user_id, 'role' => 'customer', 'first_name' => $this->posted['billing_first_name'], 'last_name' => $this->posted['billing_last_name']));
     do_action('fflcommerce_created_customer', $user_id);
     // send the user a confirmation and their login details
     if (apply_filters('fflcommerce_new_user_notification', true, $user_id, $user_pass)) {
         wp_new_user_notification($user_id, $user_pass);
     }
     wp_set_auth_cookie($user_id, true, is_ssl());
     return $user_id;
 }
コード例 #24
0
 /**
  * Applies a coupon code
  *
  * @param string $coupon_code The code to apply
  * @return bool True if the coupon is applied, false if it does not exist or cannot be applied
  */
 public static function add_discount($coupon_code)
 {
     if (!self::is_valid_coupon($coupon_code)) {
         return false;
     }
     // Check for other individual_use coupons before adding this coupon.
     foreach (self::get_coupons() as $code) {
         $current = JS_Coupons::get_coupon($code);
         if ($current['individual_use']) {
             fflcommerce::add_error(__("There is already an 'individual use' coupon on the Cart.  No other coupons can be added until it is removed.", 'fflcommerce'));
             return false;
         }
     }
     $coupon = JS_Coupons::get_coupon($coupon_code);
     // Remove other coupons if this one is individual_use.
     if ($coupon['individual_use']) {
         if (!empty(self::$applied_coupons)) {
             fflcommerce::add_error(__("This is an 'individual use' coupon.  All other discount coupons have been removed.", 'fflcommerce'));
             self::$applied_coupons = array();
         }
     }
     // check if coupon is already applied and only add a new coupon
     if (!self::has_discount($coupon_code) && !empty($_POST['coupon_code'])) {
         self::$applied_coupons[] = $coupon_code;
     }
     fflcommerce_session::instance()->coupons = self::$applied_coupons;
     fflcommerce::add_message(__('Discount coupon applied successfully.', 'fflcommerce'));
     return true;
 }
コード例 #25
0
    function fflcommerce_login_form()
    {
        if (is_user_logged_in()) {
            return;
        }
        ?>
		<form method="post" class="login">
			<p class="form-row form-row-first">
				<label for="username"><?php 
        _e('Username', 'fflcommerce');
        ?>
 <span class="required">*</span></label>
				<input type="text" class="input-text" name="username" id="username" />
			</p>
			<p class="form-row form-row-last">
				<label for="password"><?php 
        _e('Password', 'fflcommerce');
        ?>
 <span class="required">*</span></label>
				<input class="input-text" type="password" name="password" id="password" />
			</p>
			<div class="clear"></div>
			<p class="form-row">
				<?php 
        fflcommerce::nonce_field('login', 'login');
        ?>
				<input type="submit" class="button" name="login" value="<?php 
        esc_html_e('Login', 'fflcommerce');
        ?>
" />
				<a class="lost_password" href="<?php 
        echo esc_url(wp_lostpassword_url(get_permalink()));
        ?>
"><?php 
        _e('Lost Password?', 'fflcommerce');
        ?>
</a>
			</p>
		</form>
	<?php 
    }
コード例 #26
0
?>
<form action="<?php 
echo esc_url(apply_filters('fflcommerce_get_change_password_page_id', get_permalink(fflcommerce_get_page_id('change_password'))));
?>
" method="post">
	<p class="form-row form-row-first">
		<label for="password-1"><?php 
_e('New password', 'fflcommerce');
?>
 <span class="required">*</span></label>
		<input type="password" class="input-text" name="password-1" id="password-1" />
	</p>

	<p class="form-row form-row-last">
		<label for="password-2"><?php 
_e('Re-enter new password', 'fflcommerce');
?>
 <span class="required">*</span></label>
		<input type="password" class="input-text" name="password-2" id="password-2" />
	</p>

	<div class="clear"></div>
	<?php 
fflcommerce::nonce_field('change_password');
?>
	<p><input type="submit" class="button" name="save_password" value="<?php 
_e('Save', 'fflcommerce');
?>
" /></p>
</form>
コード例 #27
0
                $gateway->payment_fields();
                echo '</div>';
            }
            ?>
                        </li>
                        <?php 
        }
    } else {
        echo '<p>' . __('Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'fflcommerce') . '</p>';
    }
    ?>
            </ul>
        <?php 
}
?>

        <div class="form-row">
            <?php 
fflcommerce::nonce_field('pay');
?>
            <input type="submit" class="button-alt" name="pay" id="place_order" value="<?php 
_e('Pay for order', 'fflcommerce');
?>
" />

        </div>

    </div>

</form>
コード例 #28
0
</div>
				<div class="nav-next"><?php 
            next_comments_link(__('Next <span class="meta-nav">&rarr;</span>', 'fflcommerce'));
            ?>
</div>
			</div>
		<?php 
        }
        echo '<p class="add_review"><a href="#review_form" class="inline show_review_form button">' . __('Add Review', 'fflcommerce') . '</a></p>';
        $title_reply = __('Add a review', 'fflcommerce');
    } else {
        $title_reply = __('Be the first to review ', 'fflcommerce') . '&ldquo;' . $post->post_title . '&rdquo;';
        echo '<p>' . __('There are no reviews yet, would you like to <a href="#review_form" class="inline show_review_form">submit yours</a>?', 'fflcommerce') . '</p>';
    }
    $commenter = wp_get_current_commenter();
    echo '</div><div id="review_form_wrapper"><div id="review_form">';
    comment_form(array('title_reply' => $title_reply, 'comment_notes_before' => '', 'comment_notes_after' => '', 'fields' => array('author' => '<p class="comment-form-author">' . '<label for="author">' . __('Name') . '</label> ' . '<span class="required">*</span>' . '<input id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30" aria-required="true" /></p>', 'email' => '<p class="comment-form-email"><label for="email">' . __('Email') . '</label> ' . '<span class="required">*</span>' . '<input id="email" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30" aria-required="true" /></p>'), 'label_submit' => __('Submit Review', 'fflcommerce'), 'logged_in_as' => '', 'comment_field' => '
			<p class="comment-form-rating"><label for="rating">' . __('Rating', 'fflcommerce') . '</label><select name="rating" id="rating">
				<option value="">' . __('Rate...', 'fflcommerce') . '</option>
				<option value="5">' . __('Perfect', 'fflcommerce') . '</option>
				<option value="4">' . __('Good', 'fflcommerce') . '</option>
				<option value="3">' . __('Average', 'fflcommerce') . '</option>
				<option value="2">' . __('Not that bad', 'fflcommerce') . '</option>
				<option value="1">' . __('Very Poor', 'fflcommerce') . '</option>
			</select></p>
			<p class="comment-form-comment"><label for="comment">' . _x('Your Review', 'noun', 'fflcommerce') . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>' . fflcommerce::nonce_field('comment_rating', true, false)));
    echo '</div></div>';
    ?>
<div class="clear"></div></div>
<?php 
}