Plugin Directory

Changeset 1071318


Ignore:
Timestamp:
01/19/2015 08:58:39 PM (11 years ago)
Author:
ithemes
Message:

Tagging 1.11.6

Location:
ithemes-exchange
Files:
34 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ithemes-exchange/tags/1.11.6/api/misc.php

    r1042138 r1071318  
    218218*/
    219219function it_exchange_wp_get_nav_menu_items_filter( $items, $menu, $args ) {
    220     if ( is_user_logged_in() ) {
     220    if ( is_user_logged_in() && 'disabled' != it_exchange_get_page_type( 'logout' ) ) {
    221221        foreach ( $items as $item ) {
    222222            //We really just want to compare the URL PATH, so grab that and compare later
  • ithemes-exchange/tags/1.11.6/api/pages.php

    r973371 r1071318  
    2222        $registered = it_exchange_get_registered_pages( $options );
    2323        $merged     = array();
    24    
     24
    2525        // Grab existing DB data if its present
    2626        if ( ! $pages = it_exchange_get_option( 'settings_pages', $break_cache ) )
    2727            $pages = array();
    28    
     28
    2929        // Merge DB data with registered defaults
    3030        foreach( $registered as $page => $default_params ) {
     
    3737            $merged[$page] = ITUtility::merge_defaults( $db_params, $default_params );
    3838        }
    39        
     39
    4040        if ( !empty( $options ) )
    4141            return apply_filters( 'it_exchange_get_pages', $merged, $break_cache );
     
    342342function it_exchange_get_registered_pages( $options=array() ) {
    343343    $pages = empty( $GLOBALS['it_exchange']['registered_pages'] ) ? array() : (array) $GLOBALS['it_exchange']['registered_pages'];
    344    
     344
    345345    if ( ! empty( $options['type'] ) ) {
    346346        foreach( $pages as $page => $page_options ) {
     
    349349        }
    350350    }
    351    
     351
    352352    return $pages;
    353353}
  • ithemes-exchange/tags/1.11.6/api/theme/billing.php

    r1032065 r1071318  
    2121    */
    2222    private $_billing_address = '';
     23
     24    /**
     25     * @var array
     26     */
     27    private $session = array();
    2328
    2429    /**
     
    5257    function IT_Theme_API_Billing() {
    5358        $this->_billing_address = it_exchange_get_cart_billing_address();
     59
     60        if ( it_exchange_in_superwidget() ) {
     61
     62            $data = it_exchange_get_session_data( "sw-billing" );
     63
     64            if ( empty( $data ) ) {
     65                $data = array();
     66            }
     67
     68            $this->session = $data;
     69        }
    5470    }
    5571
     
    8399        $options['value']      = empty( $this->_billing_address['first-name'] ) ? '' : $this->_billing_address['first-name'];
    84100
     101        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     102            $options['value'] = $this->session[ $options['field_name'] ];
     103        }
     104
    85105        return $this->get_fields( $options );
    86106    }
     
    104124        $options['value']      = empty( $this->_billing_address['last-name'] ) ? '' : $this->_billing_address['last-name'];
    105125
     126        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     127            $options['value'] = $this->session[ $options['field_name'] ];
     128        }
     129
    106130        return $this->get_fields( $options );
    107131    }
     
    125149        $options['value']      = empty( $this->_billing_address['company-name'] ) ? '' : $this->_billing_address['company-name'];
    126150
     151        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     152            $options['value'] = $this->session[ $options['field_name'] ];
     153        }
     154
    127155        return $this->get_fields( $options );
    128156    }
     
    146174        $options['value']      = empty( $this->_billing_address['address1'] ) ? '' : $this->_billing_address['address1'];
    147175
     176        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     177            $options['value'] = $this->session[ $options['field_name'] ];
     178        }
     179
    148180        return $this->get_fields( $options );
    149181    }
     
    167199        $options['value']      = empty( $this->_billing_address['address2'] ) ? '' : $this->_billing_address['address2'];
    168200
     201        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     202            $options['value'] = $this->session[ $options['field_name'] ];
     203        }
     204
    169205        return $this->get_fields( $options );
    170206    }
     
    188224        $options['value']      = empty( $this->_billing_address['city'] ) ? '' : $this->_billing_address['city'];
    189225
     226        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     227            $options['value'] = $this->session[ $options['field_name'] ];
     228        }
     229
    190230        return $this->get_fields( $options );
    191231    }
     
    208248        $options['field_name'] = 'it-exchange-billing-address-zip';
    209249        $options['value']      = empty( $this->_billing_address['zip'] ) ? '' : $this->_billing_address['zip'];
     250
     251        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     252            $options['value'] = $this->session[ $options['field_name'] ];
     253        }
    210254
    211255        return $this->get_fields( $options );
     
    287331        // Update value if doing ajax
    288332        $options['value'] = empty( $_POST['ite_base_country_ajax'] ) ? $options['value'] : $_POST['ite_base_country_ajax'];
     333
     334        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     335            $options['value'] = $this->session[ $options['field_name'] ];
     336        }
    289337
    290338        $countries = it_exchange_get_data_set( 'countries' );
     
    357405        $options['field_name'] = 'it-exchange-billing-address-state';
    358406        $options['value']      = empty( $this->_billing_address['state'] ) ? '' : $this->_billing_address['state'];
     407
     408        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     409            $options['value'] = $this->session[ $options['field_name'] ];
     410        }
    359411
    360412        $states = it_exchange_get_data_set( 'states', array( 'country' => it_exchange( 'billing', 'get-country', array( 'format' => 'value' ) ) ) );
  • ithemes-exchange/tags/1.11.6/api/theme/coupons.php

    r1018864 r1071318  
    219219        $amount_number = it_exchange_convert_from_database_number( $this->coupon->amount_number );
    220220
    221         return _x( '-', 'LION', 'negative character for amount of money in coupons' ) . it_exchange_basic_coupons_get_total_discount_for_cart();
     221        return _x( '-', 'negative character for amount of money in coupons', 'it-l10n-ithemes-exchange' ) . it_exchange_basic_coupons_get_total_discount_for_cart();
    222222    }
    223223
  • ithemes-exchange/tags/1.11.6/api/theme/customer.php

    r1004481 r1071318  
    481481        foreach( $pages as $page_slug ) {
    482482
     483            // Skip menu item if disabled
     484            if ( 'disabled' == it_exchange_get_page_type( $page_slug ) ) {
     485                continue;
     486            }
     487
    483488            $page_slug = trim( $page_slug );
    484489            $class = it_exchange_is_page( $page_slug ) ? ' class="current"' : '';
  • ithemes-exchange/tags/1.11.6/api/theme/registration.php

    r1004481 r1071318  
    2121    */
    2222    private $_customer = '';
     23
     24    /**
     25     * @var array
     26     */
     27    private $registration_session = array();
    2328
    2429    /**
     
    5055    */
    5156    function IT_Theme_API_Registration() {
     57
     58        if ( it_exchange_in_superwidget() ) {
     59
     60            $data = it_exchange_get_session_data( "sw-registration" );
     61
     62            if ( empty( $data ) ) {
     63                $data = array();
     64            }
     65
     66            $this->registration_session = $data;
     67        }
    5268    }
    5369
     
    116132        $field_name = $field_id;
    117133
     134        if ( isset($this->registration_session[ $field_name ] ) ) {
     135            $value = $this->registration_session[ $field_name ];
     136        } else {
     137            $value = '';
     138        }
     139
    118140        switch( $options['format'] ) {
    119141
     
    130152            default:
    131153                $output = '<label for="' . $field_id. '">' . esc_attr( $options['label'] ) . '<span class="it-exchange-required-star">*</span></label>';
    132                 $output .= '<input type="text" id="' . $field_id. '" name="' . $field_name. '" value="" />';
     154                $output .= '<input type="text" id="' . $field_id. '" name="' . $field_name. '" value="' . esc_attr( $value ) .'" />';
    133155
    134156        }
     
    153175        $field_name = $field_id;
    154176
     177        if ( isset($this->registration_session[ $field_name ] ) ) {
     178            $value = $this->registration_session[ $field_name ];
     179        } else {
     180            $value = '';
     181        }
     182
    155183        switch( $options['format'] ) {
    156184
     
    167195            default:
    168196                $output = '<label for="' . $field_id . '">' . esc_attr( $options['label'] ) . '</label>';
    169                 $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="" />';
     197                $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="' . esc_attr( $value ) .'" />';
    170198
    171199        }
     
    190218        $field_name = $field_id;
    191219
     220        if ( isset($this->registration_session[ $field_name ] ) ) {
     221            $value = $this->registration_session[ $field_name ];
     222        } else {
     223            $value = '';
     224        }
     225
    192226        switch( $options['format'] ) {
    193227
     
    204238            default:
    205239                $output = '<label for="' . $field_id . '">' . $options['label'] . '</label>';
    206                 $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="" />';
     240                $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="' . esc_attr( $value ) .'" />';
    207241
    208242        }
     
    227261        $field_name = $field_id;
    228262
     263        if ( isset($this->registration_session[ $field_name ] ) ) {
     264            $value = $this->registration_session[ $field_name ];
     265        } else {
     266            $value = '';
     267        }
     268
    229269        switch( $options['format'] ) {
    230270
     
    241281            default:
    242282                $output = '<label for="' . $field_id . '">' . esc_attr( $options['label'] ) . '<span class="it-exchange-required-star">*</span></label>';
    243                 $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="" />';
     283                $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="' . esc_attr( $value ) .'" />';
    244284
    245285        }
  • ithemes-exchange/tags/1.11.6/api/theme/shipping.php

    r1032065 r1071318  
    2121    */
    2222    private $_shipping_address = '';
     23
     24    /**
     25     * @var array
     26     */
     27    private $session = array();
    2328
    2429    /**
     
    5156    function IT_Theme_API_Shipping() {
    5257        $this->_shipping_address = it_exchange_get_cart_shipping_address();
     58
     59        if ( it_exchange_in_superwidget() ) {
     60
     61            $data = it_exchange_get_session_data( "sw-shipping" );
     62
     63            if ( empty( $data ) ) {
     64                $data = array();
     65            }
     66
     67            $this->session = $data;
     68        }
    5369    }
    5470
     
    8298        $options['value']      = empty( $this->_shipping_address['first-name'] ) ? '' : $this->_shipping_address['first-name'];
    8399
     100        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     101            $options['value'] = $this->session[ $options['field_name'] ];
     102        }
     103
    84104        return $this->get_fields( $options );
    85105    }
     
    103123        $options['value']      = empty( $this->_shipping_address['last-name'] ) ? '' : $this->_shipping_address['last-name'];
    104124
     125        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     126            $options['value'] = $this->session[ $options['field_name'] ];
     127        }
     128
    105129        return $this->get_fields( $options );
    106130    }
     
    124148        $options['value']      = empty( $this->_shipping_address['company-name'] ) ? '' : $this->_shipping_address['company-name'];
    125149
     150        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     151            $options['value'] = $this->session[ $options['field_name'] ];
     152        }
     153
    126154        return $this->get_fields( $options );
    127155    }
     
    145173        $options['value']      = empty( $this->_shipping_address['address1'] ) ? '' : $this->_shipping_address['address1'];
    146174
     175        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     176            $options['value'] = $this->session[ $options['field_name'] ];
     177        }
     178
    147179        return $this->get_fields( $options );
    148180    }
     
    166198        $options['value']      = empty( $this->_shipping_address['address2'] ) ? '' : $this->_shipping_address['address2'];
    167199
     200        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     201            $options['value'] = $this->session[ $options['field_name'] ];
     202        }
     203
    168204        return $this->get_fields( $options );
    169205    }
     
    187223        $options['value']      = empty( $this->_shipping_address['city'] ) ? '' : $this->_shipping_address['city'];
    188224
     225        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     226            $options['value'] = $this->session[ $options['field_name'] ];
     227        }
     228
    189229        return $this->get_fields( $options );
    190230    }
     
    208248        $options['value']      = empty( $this->_shipping_address['zip'] ) ? '' : $this->_shipping_address['zip'];
    209249
     250        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     251            $options['value'] = $this->session[ $options['field_name'] ];
     252        }
     253
    210254        return $this->get_fields( $options );
    211255    }
     
    231275        // Update value if doing ajax
    232276        $options['value'] = empty( $_POST['ite_base_country_ajax'] ) ? $options['value'] : $_POST['ite_base_country_ajax'];
     277
     278        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     279            $options['value'] = $this->session[ $options['field_name'] ];
     280        }
    233281
    234282        $countries = it_exchange_get_data_set( 'countries' );
     
    302350        $options['field_name'] = 'it-exchange-shipping-address-state';
    303351        $options['value']      = empty( $this->_shipping_address['state'] ) ? '' : $this->_shipping_address['state'];
     352
     353        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     354            $options['value'] = $this->session[ $options['field_name'] ];
     355        }
    304356
    305357        $states = it_exchange_get_data_set( 'states', array( 'country' => it_exchange( 'shipping', 'get-country', array( 'format' => 'value' ) ) ) );
     
    369421        $options['value']      = empty( $this->_shipping_address['email'] ) ? '' : $this->_shipping_address['email'];
    370422
     423        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     424            $options['value'] = $this->session[ $options['field_name'] ];
     425        }
     426
    371427        return $this->get_fields( $options );
    372428    }
     
    388444        $options['field_name'] = 'it-exchange-shipping-address-phone';
    389445        $options['value']      = empty( $this->_shipping_address['phone'] ) ? '' : $this->_shipping_address['phone'];
     446
     447        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     448            $options['value'] = $this->session[ $options['field_name'] ];
     449        }
    390450
    391451        return $this->get_fields( $options );
  • ithemes-exchange/tags/1.11.6/api/transactions.php

    r1042138 r1071318  
    466466    $transaction->update_status( $status );
    467467
    468     do_action( 'it_exchange_update_transaction_status', $transaction, $old_status, $old_status_cleared );
    469     do_action( 'it_exchange_update_transaction_status_' . $transaction->transaction_method, $transaction, $old_status, $old_status_cleared );
     468    do_action( 'it_exchange_update_transaction_status', $transaction, $old_status, $old_status_cleared, $status );
     469    do_action( 'it_exchange_update_transaction_status_' . $transaction->transaction_method, $transaction, $old_status, $old_status_cleared, $status );
    470470    return $transaction->get_status();
    471471}
  • ithemes-exchange/tags/1.11.6/history.txt

    r1042138 r1071318  
     11.11.6 - Glenn Ansley, Lew Ayotte, Elise Alley, Timothy Jacobs
     2    Fix bug preventing users with '&' in their username from logging in via SW. props Timothy Jacobs <http://ironbounddesigns.com/>
     3    Remember the shipping address when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     4    Remember the billing address when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     5    Remember the registration fields when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     6    Fixed bug that tries to display disabled Exchange profile pages on the user's profile page. props Timothy Jacobs <http://ironbounddesigns.com/>
     7    Fix bug causing menu item titles to not display when user_is_logged_in and Exchagne login/logout pages are set to 'disabled' in Settings
     8    Properly escape in values in the event that poorly-formatted option names were previously inserted into the options table
     9    Fixed improper order of args in call to _x()
     10    Add new status to param of actions triggered when a transaction status is changed.
     11    Fixed bug that was preventing default WP welcome email from being sent when new users register
     12    Extend inline-docs a bit for saving custom billing address fields
    1131.11.5 - Glenn Ansley, Lew Ayotte, Elise Alley
    214    Adding IP address of customer to Transaction meta and on the Transaction page
     
    3850    Add actions for applying/removing basic coupons to/from cart
    3951    Adding new filters and setting new global for add-ons
    40     Adding some filters for Table Rate Shipping 
     52    Adding some filters for Table Rate Shipping
    4153    Add Mexican states to states.php dataset. Props: Darryl Clark
    4254    Fixed bug causing JS error when Image Gallery Settings turn zoom off
  • ithemes-exchange/tags/1.11.6/init.php

    r1057567 r1071318  
    22/*
    33 * Plugin Name: iThemes Exchange
    4  * Version: 1.11.5.1
    5  * Text Domain: LION
     4 * Version: 1.11.6
     5 * Text Domain: it-l10n-ithemes-exchange
    66 * Description: Easily sell your digital goods with iThemes Exchange, simple ecommerce for WordPress
    77 * Plugin URI: http://ithemes.com/exchange/
    88 * Author: iThemes
    99 * Author URI: http://ithemes.com
    10 
     10 *
    1111 * Installation:
    1212 * 1. Download and unzip the latest release zip file.
     
    2525class IT_Exchange {
    2626
    27     var $_version         = '1.11.5.1';
     27    var $_version         = '1.11.6';
    2828    var $_wp_minimum      = '3.5';
    2929    var $_slug            = 'it-exchange';
  • ithemes-exchange/tags/1.11.6/lang/it-l10n-ithemes-exchange-es_MX.po

    r1035942 r1071318  
    24882488
    24892489#: api/theme/coupons.php:221
    2490 msgctxt "LION"
     2490msgctxt "it-l10n-ithemes-exchange"
    24912491msgid "-"
    24922492msgstr "-"
  • ithemes-exchange/tags/1.11.6/lang/it-l10n-ithemes-exchange-nl_NL.po

    r1018864 r1071318  
    24922492
    24932493#: api/theme/coupons.php:221
    2494 msgctxt "LION"
     2494msgctxt "it-l10n-ithemes-exchange"
    24952495msgid "-"
    24962496msgstr "-"
  • ithemes-exchange/tags/1.11.6/lang/ithemes-exchange.pot

    r1042138 r1071318  
    1 # Copyright (C) 2014 iThemes Exchange
     1# Copyright (C) 2015 iThemes Exchange
    22# This file is distributed under the same license as the iThemes Exchange package.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: iThemes Exchange 1.11.5\n"
     5"Project-Id-Version: iThemes Exchange 1.11.6\n"
    66"Report-Msgid-Bugs-To: http://ithemes.com/forum/\n"
    7 "POT-Creation-Date: 2014-12-10 19:07:50+00:00\n"
    8 "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
     7"POT-Creation-Date: 2015-01-19 20:51:55+00:00\n"
     8"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
    99"MIME-Version: 1.0\n"
    1010"Content-Type: text/plain; charset=UTF-8\n"
     
    25062506msgstr ""
    25072507
    2508 #: api/theme/billing.php:76 api/theme/customer.php:141
    2509 #: api/theme/registration.php:148 api/theme/shipping.php:75
     2508#: api/theme/billing.php:92 api/theme/customer.php:141
     2509#: api/theme/registration.php:170 api/theme/shipping.php:91
    25102510msgid "First Name"
    25112511msgstr ""
    25122512
    2513 #: api/theme/billing.php:97 api/theme/customer.php:182
    2514 #: api/theme/registration.php:185 api/theme/shipping.php:96
     2513#: api/theme/billing.php:117 api/theme/customer.php:182
     2514#: api/theme/registration.php:213 api/theme/shipping.php:116
    25152515msgid "Last Name"
    25162516msgstr ""
    25172517
    2518 #: api/theme/billing.php:118 api/theme/shipping.php:117
     2518#: api/theme/billing.php:142 api/theme/shipping.php:141
    25192519#: lib/admin/views/admin-settings.php:60
    25202520msgid "Company Name"
    25212521msgstr ""
    25222522
    2523 #: api/theme/billing.php:139 api/theme/shipping.php:138
     2523#: api/theme/billing.php:167 api/theme/shipping.php:166
    25242524msgid "Address"
    25252525msgstr ""
    25262526
    2527 #: api/theme/billing.php:160 api/theme/shipping.php:159
     2527#: api/theme/billing.php:192 api/theme/shipping.php:191
    25282528#: lib/shipping/class.shipping.php:301
    25292529msgid "Address 2"
    25302530msgstr ""
    25312531
    2532 #: api/theme/billing.php:181 api/theme/shipping.php:180
     2532#: api/theme/billing.php:217 api/theme/shipping.php:216
    25332533#: lib/shipping/class.shipping.php:311
    25342534msgid "City"
    25352535msgstr ""
    25362536
    2537 #: api/theme/billing.php:202 api/theme/shipping.php:201
     2537#: api/theme/billing.php:242 api/theme/shipping.php:241
    25382538msgid "Zip Code"
    25392539msgstr ""
    25402540
    2541 #: api/theme/billing.php:230
     2541#: api/theme/billing.php:274
    25422542msgid "Ship to billing address?"
    25432543msgstr ""
    25442544
    2545 #: api/theme/billing.php:278 api/theme/shipping.php:222
     2545#: api/theme/billing.php:322 api/theme/shipping.php:266
    25462546msgid "Country"
    25472547msgstr ""
    25482548
    2549 #: api/theme/billing.php:347 api/theme/shipping.php:291
     2549#: api/theme/billing.php:395 api/theme/shipping.php:339
    25502550#: lib/shipping/class.shipping.php:631
    25512551msgid "State"
    25522552msgstr ""
    25532553
    2554 #: api/theme/billing.php:418 api/theme/customer.php:266
    2555 #: api/theme/registration.php:222 api/theme/shipping.php:363
     2554#: api/theme/billing.php:470 api/theme/customer.php:266
     2555#: api/theme/registration.php:256 api/theme/shipping.php:415
    25562556#: core-addons/load.php:316
    25572557msgid "Email"
    25582558msgstr ""
    25592559
    2560 #: api/theme/billing.php:439 api/theme/shipping.php:383
     2560#: api/theme/billing.php:491 api/theme/shipping.php:439
    25612561msgid "Phone"
    25622562msgstr ""
    25632563
    2564 #: api/theme/billing.php:460 api/theme/shipping.php:403
     2564#: api/theme/billing.php:512 api/theme/shipping.php:463
    25652565msgid "Submit"
    25662566msgstr ""
    25672567
    2568 #: api/theme/billing.php:479 api/theme/checkout.php:93 api/theme/login.php:332
    2569 #: api/theme/registration.php:368 api/theme/shipping-method.php:165
    2570 #: api/theme/shipping.php:422
     2568#: api/theme/billing.php:531 api/theme/checkout.php:93 api/theme/login.php:332
     2569#: api/theme/registration.php:408 api/theme/shipping-method.php:165
     2570#: api/theme/shipping.php:482
    25712571#: core-addons/admin/guest-checkout/lib/template-functions.php:210
    25722572#: core-addons/coupons/basic-coupons/admin.php:390
     
    26192619
    26202620#: api/theme/coupons.php:221
    2621 msgctxt "LION"
     2621msgctxt "negative character for amount of money in coupons"
    26222622msgid "-"
    26232623msgstr ""
     
    26322632
    26332633#: api/theme/customer.php:348 api/theme/login.php:147
    2634 #: api/theme/registration.php:259
     2634#: api/theme/registration.php:299
    26352635msgid "Password"
    26362636msgstr ""
    26372637
    2638 #: api/theme/customer.php:385 api/theme/registration.php:296
     2638#: api/theme/customer.php:385 api/theme/registration.php:336
    26392639msgid "Confirm Password"
    26402640msgstr ""
     
    26442644msgstr ""
    26452645
    2646 #: api/theme/customer.php:535
     2646#: api/theme/customer.php:540
    26472647msgid "View your Account"
    26482648msgstr ""
    26492649
    2650 #: api/theme/customer.php:570
     2650#: api/theme/customer.php:575
    26512651msgid "Thank you for your order. An email confirmation has been sent to %s."
    26522652msgstr ""
     
    26672667msgstr ""
    26682668
    2669 #: api/theme/login.php:110 api/theme/registration.php:111
     2669#: api/theme/login.php:110 api/theme/registration.php:127
    26702670msgid "Username"
    26712671msgstr ""
     
    26832683msgstr ""
    26842684
    2685 #: api/theme/login.php:297 api/theme/registration.php:333
     2685#: api/theme/login.php:297 api/theme/registration.php:373
    26862686#: lib/templates/content-checkout/elements/purchase-requirements/logged-in/elements/login/register.php:20
    26872687msgid "Register"
     
    27582758msgstr ""
    27592759
    2760 #: api/theme/registration.php:412
     2760#: api/theme/registration.php:452
    27612761msgid "Registration Disabled"
    27622762msgstr ""
     
    28712871msgstr ""
    28722872
    2873 #. #-#-#-#-#  ithemes-exchange.pot (iThemes Exchange 1.11.5)  #-#-#-#-#
     2873#. #-#-#-#-#  ithemes-exchange.pot (iThemes Exchange 1.11.6)  #-#-#-#-#
    28742874#. Plugin Name of the plugin/theme
    28752875#: core-addons/admin/basic-reporting/init.php:19
     
    54755475msgstr ""
    54765476
    5477 #: lib/cart/class.cart.php:171 lib/cart/class.cart.php:548
     5477#: lib/cart/class.cart.php:171 lib/cart/class.cart.php:553
    54785478msgid "Product added to cart"
    54795479msgstr ""
     
    54965496msgstr ""
    54975497
    5498 #: lib/cart/class.cart.php:431
     5498#: lib/cart/class.cart.php:436
    54995499msgid "Billing Address Saved"
    55005500msgstr ""
    55015501
    5502 #: lib/cart/class.cart.php:530
     5502#: lib/cart/class.cart.php:535
    55035503msgid "Unknown error. Please try again."
    55045504msgstr ""
    55055505
    5506 #: lib/cart/class.cart.php:540
     5506#: lib/cart/class.cart.php:545
    55075507msgid "Please select a payment method"
    55085508msgstr ""
    55095509
    5510 #: lib/cart/class.cart.php:541
     5510#: lib/cart/class.cart.php:546
    55115511msgid "There was an error processing your transaction. Please try again."
    55125512msgstr ""
    55135513
    5514 #: lib/cart/class.cart.php:542
     5514#: lib/cart/class.cart.php:547
    55155515msgid "Product not removed from cart. Please try again."
    55165516msgstr ""
    55175517
    5518 #: lib/cart/class.cart.php:543
     5518#: lib/cart/class.cart.php:548
    55195519msgid "There was an error emptying your cart. Please try again."
    55205520msgstr ""
    55215521
    5522 #: lib/cart/class.cart.php:544
     5522#: lib/cart/class.cart.php:549
    55235523msgid "There was an error updating your cart. Please try again."
    55245524msgstr ""
    55255525
    5526 #: lib/cart/class.cart.php:545
     5526#: lib/cart/class.cart.php:550
    55275527msgid "Cart Updated."
    55285528msgstr ""
    55295529
    5530 #: lib/cart/class.cart.php:546
     5530#: lib/cart/class.cart.php:551
    55315531msgid "Cart Emptied"
    55325532msgstr ""
    55335533
    5534 #: lib/cart/class.cart.php:547
     5534#: lib/cart/class.cart.php:552
    55355535msgid "Product removed from cart."
    55365536msgstr ""
  • ithemes-exchange/tags/1.11.6/lib/cart/class.cart.php

    r1024556 r1071318  
    409409        }
    410410
    411         /** @todo This is hardcoded for now. will be more flexible at some point **/
     411        /**
     412         * @todo This is hardcoded for now. will be more flexible at some point
     413         * If you're having trouble getting your custom field to save, make sure that your form field's name
     414         * matches what we're looking for in the REQUEST below. eg: adding 'custom-form' to the $fields var
     415         * via this next filter means that your form field name has to be: 'it-exchange-billing-address-custom-form'
     416        */
    412417        $billing = array();
    413418        $fields = apply_filters( 'it_exchange_billing_address_fields', array(
  • ithemes-exchange/tags/1.11.6/lib/sessions/db_session_manager/db-session.php

    r1008592 r1071318  
    157157        // Delete all expired sessions in a single query
    158158        if ( ! empty( $expired_sessions ) ) {
    159             $option_names = implode( "','", $expired_sessions );
    160             $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')" );
     159            $formatted = implode( ', ', array_fill( 0, count( $expired_sessions ), '%s' ) );
     160            $query     = $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name IN ($formatted)", $expired_sessions );
     161            $wpdb->query( $query );
    161162        }
    162163    }
     
    193194        // Delete all sessions in a single query
    194195        if ( ! empty( $expired_sessions ) ) {
    195             $option_names = implode( "','", $expired_sessions );
    196             $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')" );
     196            $formatted = implode( ', ', array_fill( 0, count( $expired_sessions ), '%s' ) );
     197            $query     = $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name IN ($formatted)", $expired_sessions );
     198            $wpdb->query( $query );
    197199        }
    198200    }
  • ithemes-exchange/tags/1.11.6/lib/super-widget/ajax.php

    r935226 r1071318  
    9090// Login
    9191if ( 'login' == $action ) {
    92     $creds['user_login']    = empty( $_POST['log'] ) ? '' : esc_attr( $_POST['log'] );
    93     $creds['user_password'] = empty( $_POST['pwd'] ) ? '' : esc_attr( $_POST['pwd'] );
    94     $creds['remember']      = empty( $_POST['rememberme'] ) ? '' : esc_attr( $_POST['rememberme'] );
     92    $creds['user_login']    = empty( $_POST['log'] ) ? '' : urldecode( $_POST['log'] );
     93    $creds['user_password'] = empty( $_POST['pwd'] ) ? '' : urldecode( $_POST['pwd'] );
     94    $creds['remember']      = empty( $_POST['rememberme'] ) ? '' : urldecode( $_POST['rememberme'] );
    9595
    9696    $user = wp_signon( $creds, false );
     
    113113        // Clearing the user pass will prevent the user email from being sent
    114114        $email_pw = apply_filters( 'it_exchange_send_customer_registration_email', true ) ? $_POST['pass1'] : '';
    115         wp_new_user_notification( $user_id, $email_pass );
     115        wp_new_user_notification( $user_id, $email_pw );
    116116
    117117        $creds = array(
     
    121121
    122122        $user = wp_signon( $creds );
    123         if ( ! is_wp_error( $user ) )
     123        if ( ! is_wp_error( $user ) ) {
    124124            it_exchange_add_message( 'notice', __( 'Registered and logged in as ', 'it-l10n-ithemes-exchange' ) . $user->user_login );
    125         else
     125        } else {
    126126            it_exchange_add_message( 'error', $result->get_error_message() );
     127        }
     128
     129        // Clear form values we saved in case of error
     130        it_exchange_clear_session_data( 'sw-registration' );
     131
    127132        die('1');
    128133    } else {
    129134        it_exchange_add_message( 'error', $user_id->get_error_message() );
     135
     136        // clear out the passwords before we save the data to the session
     137        unset( $_POST['pass1'] );
     138        unset( $_POST['pass2'] );
     139
     140        if ( $user_id->get_error_message( 'user_login' ) ) {
     141            unset( $_POST['user_login'] );
     142        }
     143
     144        if ( $user_id->get_error_message( 'invalid_email' ) || $user_id->get_error_message( 'email_exists' ) ) {
     145            unset( $_POST['email'] );
     146        }
     147
     148        it_exchange_update_session_data( 'sw-registration',  $_POST );
     149
    130150        die('0');
    131151    }
     
    135155if ( 'update-shipping' == $action ) {
    136156    // This function will either updated the value or create an error and return 1 or 0
    137     die( $GLOBALS['IT_Exchange_Shopping_Cart']->handle_update_shipping_address_request() );
     157
     158    $shipping_result = $GLOBALS['IT_Exchange_Shopping_Cart']->handle_update_shipping_address_request();
     159
     160    if ( ! $shipping_result ) {
     161        it_exchange_update_session_data( "sw-shipping", $_POST );
     162    } else {
     163        it_exchange_clear_session_data( "sw-shipping" );
     164    }
     165
     166    die( $shipping_result );
    138167}
    139168
     
    141170if ( 'update-billing' == $action ) {
    142171    // This function will either updated the value or create an error and return 1 or 0
    143     die( $GLOBALS['IT_Exchange_Shopping_Cart']->handle_update_billing_address_request() );
     172
     173    $billing_result =  $GLOBALS['IT_Exchange_Shopping_Cart']->handle_update_billing_address_request();
     174
     175    if ( ! $billing_result ) {
     176        it_exchange_update_session_data( "sw-billing", $_POST );
     177    } else {
     178        it_exchange_clear_session_data( "sw-billing" );
     179    }
     180
     181    die( $billing_result );
    144182}
    145183
  • ithemes-exchange/tags/1.11.6/readme.txt

    r1057567 r1071318  
    44Requires at least: 3.7
    55Tested up to: 4.1
    6 Stable tag: 1.11.5.1
     6Stable tag: 1.11.6
    77License: GPLv2 or later
    88
     
    8888
    8989== Changelog ==
    90 = 1.11.5.1 =
    91 * Fix missing font-icons
     90
     91= 1.11.6 =
     92* Fix bug preventing users with '&' in their username from logging in via SW. props Timothy Jacobs <http://ironbounddesigns.com/>
     93* Remember the shipping address when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     94* Remember the billing address when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     95* Remember the registration fields when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     96* Fixed bug that tries to display disabled Exchange profile pages on the user's profile page. props Timothy Jacobs <http://ironbounddesigns.com/>
     97* Fix bug causing menu item titles to not display when user_is_logged_in and Exchagne login/logout pages are set to 'disabled' in Settings
     98* Properly escape in values in the event that poorly-formatted option names were previously inserted into the options table
     99* Fixed improper order of args in call to _x()
     100* Add new status to param of actions triggered when a transaction status is changed.
     101* Fixed bug that was preventing default WP welcome email from being sent when new users register
     102* Extend inline-docs a bit for saving custom billing address fields
    92103
    93104= 1.11.5 =
     
    135146* Add actions for applying/removing basic coupons to/from cart
    136147* Adding new filters and setting new global for add-ons
    137 * Adding some filters for Table Rate Shipping 
     148* Adding some filters for Table Rate Shipping
    138149* Add Mexican states to states.php dataset. Props: Darryl Clark
    139150* Fixed bug causing JS error when Image Gallery Settings turn zoom off
  • ithemes-exchange/trunk/api/misc.php

    r1042138 r1071318  
    218218*/
    219219function it_exchange_wp_get_nav_menu_items_filter( $items, $menu, $args ) {
    220     if ( is_user_logged_in() ) {
     220    if ( is_user_logged_in() && 'disabled' != it_exchange_get_page_type( 'logout' ) ) {
    221221        foreach ( $items as $item ) {
    222222            //We really just want to compare the URL PATH, so grab that and compare later
  • ithemes-exchange/trunk/api/pages.php

    r973371 r1071318  
    2222        $registered = it_exchange_get_registered_pages( $options );
    2323        $merged     = array();
    24    
     24
    2525        // Grab existing DB data if its present
    2626        if ( ! $pages = it_exchange_get_option( 'settings_pages', $break_cache ) )
    2727            $pages = array();
    28    
     28
    2929        // Merge DB data with registered defaults
    3030        foreach( $registered as $page => $default_params ) {
     
    3737            $merged[$page] = ITUtility::merge_defaults( $db_params, $default_params );
    3838        }
    39        
     39
    4040        if ( !empty( $options ) )
    4141            return apply_filters( 'it_exchange_get_pages', $merged, $break_cache );
     
    342342function it_exchange_get_registered_pages( $options=array() ) {
    343343    $pages = empty( $GLOBALS['it_exchange']['registered_pages'] ) ? array() : (array) $GLOBALS['it_exchange']['registered_pages'];
    344    
     344
    345345    if ( ! empty( $options['type'] ) ) {
    346346        foreach( $pages as $page => $page_options ) {
     
    349349        }
    350350    }
    351    
     351
    352352    return $pages;
    353353}
  • ithemes-exchange/trunk/api/theme/billing.php

    r1032065 r1071318  
    2121    */
    2222    private $_billing_address = '';
     23
     24    /**
     25     * @var array
     26     */
     27    private $session = array();
    2328
    2429    /**
     
    5257    function IT_Theme_API_Billing() {
    5358        $this->_billing_address = it_exchange_get_cart_billing_address();
     59
     60        if ( it_exchange_in_superwidget() ) {
     61
     62            $data = it_exchange_get_session_data( "sw-billing" );
     63
     64            if ( empty( $data ) ) {
     65                $data = array();
     66            }
     67
     68            $this->session = $data;
     69        }
    5470    }
    5571
     
    8399        $options['value']      = empty( $this->_billing_address['first-name'] ) ? '' : $this->_billing_address['first-name'];
    84100
     101        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     102            $options['value'] = $this->session[ $options['field_name'] ];
     103        }
     104
    85105        return $this->get_fields( $options );
    86106    }
     
    104124        $options['value']      = empty( $this->_billing_address['last-name'] ) ? '' : $this->_billing_address['last-name'];
    105125
     126        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     127            $options['value'] = $this->session[ $options['field_name'] ];
     128        }
     129
    106130        return $this->get_fields( $options );
    107131    }
     
    125149        $options['value']      = empty( $this->_billing_address['company-name'] ) ? '' : $this->_billing_address['company-name'];
    126150
     151        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     152            $options['value'] = $this->session[ $options['field_name'] ];
     153        }
     154
    127155        return $this->get_fields( $options );
    128156    }
     
    146174        $options['value']      = empty( $this->_billing_address['address1'] ) ? '' : $this->_billing_address['address1'];
    147175
     176        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     177            $options['value'] = $this->session[ $options['field_name'] ];
     178        }
     179
    148180        return $this->get_fields( $options );
    149181    }
     
    167199        $options['value']      = empty( $this->_billing_address['address2'] ) ? '' : $this->_billing_address['address2'];
    168200
     201        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     202            $options['value'] = $this->session[ $options['field_name'] ];
     203        }
     204
    169205        return $this->get_fields( $options );
    170206    }
     
    188224        $options['value']      = empty( $this->_billing_address['city'] ) ? '' : $this->_billing_address['city'];
    189225
     226        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     227            $options['value'] = $this->session[ $options['field_name'] ];
     228        }
     229
    190230        return $this->get_fields( $options );
    191231    }
     
    208248        $options['field_name'] = 'it-exchange-billing-address-zip';
    209249        $options['value']      = empty( $this->_billing_address['zip'] ) ? '' : $this->_billing_address['zip'];
     250
     251        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     252            $options['value'] = $this->session[ $options['field_name'] ];
     253        }
    210254
    211255        return $this->get_fields( $options );
     
    287331        // Update value if doing ajax
    288332        $options['value'] = empty( $_POST['ite_base_country_ajax'] ) ? $options['value'] : $_POST['ite_base_country_ajax'];
     333
     334        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     335            $options['value'] = $this->session[ $options['field_name'] ];
     336        }
    289337
    290338        $countries = it_exchange_get_data_set( 'countries' );
     
    357405        $options['field_name'] = 'it-exchange-billing-address-state';
    358406        $options['value']      = empty( $this->_billing_address['state'] ) ? '' : $this->_billing_address['state'];
     407
     408        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     409            $options['value'] = $this->session[ $options['field_name'] ];
     410        }
    359411
    360412        $states = it_exchange_get_data_set( 'states', array( 'country' => it_exchange( 'billing', 'get-country', array( 'format' => 'value' ) ) ) );
  • ithemes-exchange/trunk/api/theme/coupons.php

    r1018864 r1071318  
    219219        $amount_number = it_exchange_convert_from_database_number( $this->coupon->amount_number );
    220220
    221         return _x( '-', 'LION', 'negative character for amount of money in coupons' ) . it_exchange_basic_coupons_get_total_discount_for_cart();
     221        return _x( '-', 'negative character for amount of money in coupons', 'it-l10n-ithemes-exchange' ) . it_exchange_basic_coupons_get_total_discount_for_cart();
    222222    }
    223223
  • ithemes-exchange/trunk/api/theme/customer.php

    r1004481 r1071318  
    481481        foreach( $pages as $page_slug ) {
    482482
     483            // Skip menu item if disabled
     484            if ( 'disabled' == it_exchange_get_page_type( $page_slug ) ) {
     485                continue;
     486            }
     487
    483488            $page_slug = trim( $page_slug );
    484489            $class = it_exchange_is_page( $page_slug ) ? ' class="current"' : '';
  • ithemes-exchange/trunk/api/theme/registration.php

    r1004481 r1071318  
    2121    */
    2222    private $_customer = '';
     23
     24    /**
     25     * @var array
     26     */
     27    private $registration_session = array();
    2328
    2429    /**
     
    5055    */
    5156    function IT_Theme_API_Registration() {
     57
     58        if ( it_exchange_in_superwidget() ) {
     59
     60            $data = it_exchange_get_session_data( "sw-registration" );
     61
     62            if ( empty( $data ) ) {
     63                $data = array();
     64            }
     65
     66            $this->registration_session = $data;
     67        }
    5268    }
    5369
     
    116132        $field_name = $field_id;
    117133
     134        if ( isset($this->registration_session[ $field_name ] ) ) {
     135            $value = $this->registration_session[ $field_name ];
     136        } else {
     137            $value = '';
     138        }
     139
    118140        switch( $options['format'] ) {
    119141
     
    130152            default:
    131153                $output = '<label for="' . $field_id. '">' . esc_attr( $options['label'] ) . '<span class="it-exchange-required-star">*</span></label>';
    132                 $output .= '<input type="text" id="' . $field_id. '" name="' . $field_name. '" value="" />';
     154                $output .= '<input type="text" id="' . $field_id. '" name="' . $field_name. '" value="' . esc_attr( $value ) .'" />';
    133155
    134156        }
     
    153175        $field_name = $field_id;
    154176
     177        if ( isset($this->registration_session[ $field_name ] ) ) {
     178            $value = $this->registration_session[ $field_name ];
     179        } else {
     180            $value = '';
     181        }
     182
    155183        switch( $options['format'] ) {
    156184
     
    167195            default:
    168196                $output = '<label for="' . $field_id . '">' . esc_attr( $options['label'] ) . '</label>';
    169                 $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="" />';
     197                $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="' . esc_attr( $value ) .'" />';
    170198
    171199        }
     
    190218        $field_name = $field_id;
    191219
     220        if ( isset($this->registration_session[ $field_name ] ) ) {
     221            $value = $this->registration_session[ $field_name ];
     222        } else {
     223            $value = '';
     224        }
     225
    192226        switch( $options['format'] ) {
    193227
     
    204238            default:
    205239                $output = '<label for="' . $field_id . '">' . $options['label'] . '</label>';
    206                 $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="" />';
     240                $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="' . esc_attr( $value ) .'" />';
    207241
    208242        }
     
    227261        $field_name = $field_id;
    228262
     263        if ( isset($this->registration_session[ $field_name ] ) ) {
     264            $value = $this->registration_session[ $field_name ];
     265        } else {
     266            $value = '';
     267        }
     268
    229269        switch( $options['format'] ) {
    230270
     
    241281            default:
    242282                $output = '<label for="' . $field_id . '">' . esc_attr( $options['label'] ) . '<span class="it-exchange-required-star">*</span></label>';
    243                 $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="" />';
     283                $output .= '<input type="text" id="' . $field_id . '" name="' . $field_name . '" value="' . esc_attr( $value ) .'" />';
    244284
    245285        }
  • ithemes-exchange/trunk/api/theme/shipping.php

    r1032065 r1071318  
    2121    */
    2222    private $_shipping_address = '';
     23
     24    /**
     25     * @var array
     26     */
     27    private $session = array();
    2328
    2429    /**
     
    5156    function IT_Theme_API_Shipping() {
    5257        $this->_shipping_address = it_exchange_get_cart_shipping_address();
     58
     59        if ( it_exchange_in_superwidget() ) {
     60
     61            $data = it_exchange_get_session_data( "sw-shipping" );
     62
     63            if ( empty( $data ) ) {
     64                $data = array();
     65            }
     66
     67            $this->session = $data;
     68        }
    5369    }
    5470
     
    8298        $options['value']      = empty( $this->_shipping_address['first-name'] ) ? '' : $this->_shipping_address['first-name'];
    8399
     100        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     101            $options['value'] = $this->session[ $options['field_name'] ];
     102        }
     103
    84104        return $this->get_fields( $options );
    85105    }
     
    103123        $options['value']      = empty( $this->_shipping_address['last-name'] ) ? '' : $this->_shipping_address['last-name'];
    104124
     125        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     126            $options['value'] = $this->session[ $options['field_name'] ];
     127        }
     128
    105129        return $this->get_fields( $options );
    106130    }
     
    124148        $options['value']      = empty( $this->_shipping_address['company-name'] ) ? '' : $this->_shipping_address['company-name'];
    125149
     150        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     151            $options['value'] = $this->session[ $options['field_name'] ];
     152        }
     153
    126154        return $this->get_fields( $options );
    127155    }
     
    145173        $options['value']      = empty( $this->_shipping_address['address1'] ) ? '' : $this->_shipping_address['address1'];
    146174
     175        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     176            $options['value'] = $this->session[ $options['field_name'] ];
     177        }
     178
    147179        return $this->get_fields( $options );
    148180    }
     
    166198        $options['value']      = empty( $this->_shipping_address['address2'] ) ? '' : $this->_shipping_address['address2'];
    167199
     200        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     201            $options['value'] = $this->session[ $options['field_name'] ];
     202        }
     203
    168204        return $this->get_fields( $options );
    169205    }
     
    187223        $options['value']      = empty( $this->_shipping_address['city'] ) ? '' : $this->_shipping_address['city'];
    188224
     225        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     226            $options['value'] = $this->session[ $options['field_name'] ];
     227        }
     228
    189229        return $this->get_fields( $options );
    190230    }
     
    208248        $options['value']      = empty( $this->_shipping_address['zip'] ) ? '' : $this->_shipping_address['zip'];
    209249
     250        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     251            $options['value'] = $this->session[ $options['field_name'] ];
     252        }
     253
    210254        return $this->get_fields( $options );
    211255    }
     
    231275        // Update value if doing ajax
    232276        $options['value'] = empty( $_POST['ite_base_country_ajax'] ) ? $options['value'] : $_POST['ite_base_country_ajax'];
     277
     278        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     279            $options['value'] = $this->session[ $options['field_name'] ];
     280        }
    233281
    234282        $countries = it_exchange_get_data_set( 'countries' );
     
    302350        $options['field_name'] = 'it-exchange-shipping-address-state';
    303351        $options['value']      = empty( $this->_shipping_address['state'] ) ? '' : $this->_shipping_address['state'];
     352
     353        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     354            $options['value'] = $this->session[ $options['field_name'] ];
     355        }
    304356
    305357        $states = it_exchange_get_data_set( 'states', array( 'country' => it_exchange( 'shipping', 'get-country', array( 'format' => 'value' ) ) ) );
     
    369421        $options['value']      = empty( $this->_shipping_address['email'] ) ? '' : $this->_shipping_address['email'];
    370422
     423        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     424            $options['value'] = $this->session[ $options['field_name'] ];
     425        }
     426
    371427        return $this->get_fields( $options );
    372428    }
     
    388444        $options['field_name'] = 'it-exchange-shipping-address-phone';
    389445        $options['value']      = empty( $this->_shipping_address['phone'] ) ? '' : $this->_shipping_address['phone'];
     446
     447        if ( empty( $options['value'] ) && ! empty( $this->session[ $options['field_name'] ] ) ) {
     448            $options['value'] = $this->session[ $options['field_name'] ];
     449        }
    390450
    391451        return $this->get_fields( $options );
  • ithemes-exchange/trunk/api/transactions.php

    r1042138 r1071318  
    466466    $transaction->update_status( $status );
    467467
    468     do_action( 'it_exchange_update_transaction_status', $transaction, $old_status, $old_status_cleared );
    469     do_action( 'it_exchange_update_transaction_status_' . $transaction->transaction_method, $transaction, $old_status, $old_status_cleared );
     468    do_action( 'it_exchange_update_transaction_status', $transaction, $old_status, $old_status_cleared, $status );
     469    do_action( 'it_exchange_update_transaction_status_' . $transaction->transaction_method, $transaction, $old_status, $old_status_cleared, $status );
    470470    return $transaction->get_status();
    471471}
  • ithemes-exchange/trunk/history.txt

    r1042138 r1071318  
     11.11.6 - Glenn Ansley, Lew Ayotte, Elise Alley, Timothy Jacobs
     2    Fix bug preventing users with '&' in their username from logging in via SW. props Timothy Jacobs <http://ironbounddesigns.com/>
     3    Remember the shipping address when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     4    Remember the billing address when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     5    Remember the registration fields when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     6    Fixed bug that tries to display disabled Exchange profile pages on the user's profile page. props Timothy Jacobs <http://ironbounddesigns.com/>
     7    Fix bug causing menu item titles to not display when user_is_logged_in and Exchagne login/logout pages are set to 'disabled' in Settings
     8    Properly escape in values in the event that poorly-formatted option names were previously inserted into the options table
     9    Fixed improper order of args in call to _x()
     10    Add new status to param of actions triggered when a transaction status is changed.
     11    Fixed bug that was preventing default WP welcome email from being sent when new users register
     12    Extend inline-docs a bit for saving custom billing address fields
    1131.11.5 - Glenn Ansley, Lew Ayotte, Elise Alley
    214    Adding IP address of customer to Transaction meta and on the Transaction page
     
    3850    Add actions for applying/removing basic coupons to/from cart
    3951    Adding new filters and setting new global for add-ons
    40     Adding some filters for Table Rate Shipping 
     52    Adding some filters for Table Rate Shipping
    4153    Add Mexican states to states.php dataset. Props: Darryl Clark
    4254    Fixed bug causing JS error when Image Gallery Settings turn zoom off
  • ithemes-exchange/trunk/init.php

    r1057567 r1071318  
    22/*
    33 * Plugin Name: iThemes Exchange
    4  * Version: 1.11.5.1
    5  * Text Domain: LION
     4 * Version: 1.11.6
     5 * Text Domain: it-l10n-ithemes-exchange
    66 * Description: Easily sell your digital goods with iThemes Exchange, simple ecommerce for WordPress
    77 * Plugin URI: http://ithemes.com/exchange/
    88 * Author: iThemes
    99 * Author URI: http://ithemes.com
    10 
     10 *
    1111 * Installation:
    1212 * 1. Download and unzip the latest release zip file.
     
    2525class IT_Exchange {
    2626
    27     var $_version         = '1.11.5.1';
     27    var $_version         = '1.11.6';
    2828    var $_wp_minimum      = '3.5';
    2929    var $_slug            = 'it-exchange';
  • ithemes-exchange/trunk/lang/it-l10n-ithemes-exchange-es_MX.po

    r1035942 r1071318  
    24882488
    24892489#: api/theme/coupons.php:221
    2490 msgctxt "LION"
     2490msgctxt "it-l10n-ithemes-exchange"
    24912491msgid "-"
    24922492msgstr "-"
  • ithemes-exchange/trunk/lang/it-l10n-ithemes-exchange-nl_NL.po

    r1018864 r1071318  
    24922492
    24932493#: api/theme/coupons.php:221
    2494 msgctxt "LION"
     2494msgctxt "it-l10n-ithemes-exchange"
    24952495msgid "-"
    24962496msgstr "-"
  • ithemes-exchange/trunk/lang/ithemes-exchange.pot

    r1042138 r1071318  
    1 # Copyright (C) 2014 iThemes Exchange
     1# Copyright (C) 2015 iThemes Exchange
    22# This file is distributed under the same license as the iThemes Exchange package.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: iThemes Exchange 1.11.5\n"
     5"Project-Id-Version: iThemes Exchange 1.11.6\n"
    66"Report-Msgid-Bugs-To: http://ithemes.com/forum/\n"
    7 "POT-Creation-Date: 2014-12-10 19:07:50+00:00\n"
    8 "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
     7"POT-Creation-Date: 2015-01-19 20:51:55+00:00\n"
     8"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
    99"MIME-Version: 1.0\n"
    1010"Content-Type: text/plain; charset=UTF-8\n"
     
    25062506msgstr ""
    25072507
    2508 #: api/theme/billing.php:76 api/theme/customer.php:141
    2509 #: api/theme/registration.php:148 api/theme/shipping.php:75
     2508#: api/theme/billing.php:92 api/theme/customer.php:141
     2509#: api/theme/registration.php:170 api/theme/shipping.php:91
    25102510msgid "First Name"
    25112511msgstr ""
    25122512
    2513 #: api/theme/billing.php:97 api/theme/customer.php:182
    2514 #: api/theme/registration.php:185 api/theme/shipping.php:96
     2513#: api/theme/billing.php:117 api/theme/customer.php:182
     2514#: api/theme/registration.php:213 api/theme/shipping.php:116
    25152515msgid "Last Name"
    25162516msgstr ""
    25172517
    2518 #: api/theme/billing.php:118 api/theme/shipping.php:117
     2518#: api/theme/billing.php:142 api/theme/shipping.php:141
    25192519#: lib/admin/views/admin-settings.php:60
    25202520msgid "Company Name"
    25212521msgstr ""
    25222522
    2523 #: api/theme/billing.php:139 api/theme/shipping.php:138
     2523#: api/theme/billing.php:167 api/theme/shipping.php:166
    25242524msgid "Address"
    25252525msgstr ""
    25262526
    2527 #: api/theme/billing.php:160 api/theme/shipping.php:159
     2527#: api/theme/billing.php:192 api/theme/shipping.php:191
    25282528#: lib/shipping/class.shipping.php:301
    25292529msgid "Address 2"
    25302530msgstr ""
    25312531
    2532 #: api/theme/billing.php:181 api/theme/shipping.php:180
     2532#: api/theme/billing.php:217 api/theme/shipping.php:216
    25332533#: lib/shipping/class.shipping.php:311
    25342534msgid "City"
    25352535msgstr ""
    25362536
    2537 #: api/theme/billing.php:202 api/theme/shipping.php:201
     2537#: api/theme/billing.php:242 api/theme/shipping.php:241
    25382538msgid "Zip Code"
    25392539msgstr ""
    25402540
    2541 #: api/theme/billing.php:230
     2541#: api/theme/billing.php:274
    25422542msgid "Ship to billing address?"
    25432543msgstr ""
    25442544
    2545 #: api/theme/billing.php:278 api/theme/shipping.php:222
     2545#: api/theme/billing.php:322 api/theme/shipping.php:266
    25462546msgid "Country"
    25472547msgstr ""
    25482548
    2549 #: api/theme/billing.php:347 api/theme/shipping.php:291
     2549#: api/theme/billing.php:395 api/theme/shipping.php:339
    25502550#: lib/shipping/class.shipping.php:631
    25512551msgid "State"
    25522552msgstr ""
    25532553
    2554 #: api/theme/billing.php:418 api/theme/customer.php:266
    2555 #: api/theme/registration.php:222 api/theme/shipping.php:363
     2554#: api/theme/billing.php:470 api/theme/customer.php:266
     2555#: api/theme/registration.php:256 api/theme/shipping.php:415
    25562556#: core-addons/load.php:316
    25572557msgid "Email"
    25582558msgstr ""
    25592559
    2560 #: api/theme/billing.php:439 api/theme/shipping.php:383
     2560#: api/theme/billing.php:491 api/theme/shipping.php:439
    25612561msgid "Phone"
    25622562msgstr ""
    25632563
    2564 #: api/theme/billing.php:460 api/theme/shipping.php:403
     2564#: api/theme/billing.php:512 api/theme/shipping.php:463
    25652565msgid "Submit"
    25662566msgstr ""
    25672567
    2568 #: api/theme/billing.php:479 api/theme/checkout.php:93 api/theme/login.php:332
    2569 #: api/theme/registration.php:368 api/theme/shipping-method.php:165
    2570 #: api/theme/shipping.php:422
     2568#: api/theme/billing.php:531 api/theme/checkout.php:93 api/theme/login.php:332
     2569#: api/theme/registration.php:408 api/theme/shipping-method.php:165
     2570#: api/theme/shipping.php:482
    25712571#: core-addons/admin/guest-checkout/lib/template-functions.php:210
    25722572#: core-addons/coupons/basic-coupons/admin.php:390
     
    26192619
    26202620#: api/theme/coupons.php:221
    2621 msgctxt "LION"
     2621msgctxt "negative character for amount of money in coupons"
    26222622msgid "-"
    26232623msgstr ""
     
    26322632
    26332633#: api/theme/customer.php:348 api/theme/login.php:147
    2634 #: api/theme/registration.php:259
     2634#: api/theme/registration.php:299
    26352635msgid "Password"
    26362636msgstr ""
    26372637
    2638 #: api/theme/customer.php:385 api/theme/registration.php:296
     2638#: api/theme/customer.php:385 api/theme/registration.php:336
    26392639msgid "Confirm Password"
    26402640msgstr ""
     
    26442644msgstr ""
    26452645
    2646 #: api/theme/customer.php:535
     2646#: api/theme/customer.php:540
    26472647msgid "View your Account"
    26482648msgstr ""
    26492649
    2650 #: api/theme/customer.php:570
     2650#: api/theme/customer.php:575
    26512651msgid "Thank you for your order. An email confirmation has been sent to %s."
    26522652msgstr ""
     
    26672667msgstr ""
    26682668
    2669 #: api/theme/login.php:110 api/theme/registration.php:111
     2669#: api/theme/login.php:110 api/theme/registration.php:127
    26702670msgid "Username"
    26712671msgstr ""
     
    26832683msgstr ""
    26842684
    2685 #: api/theme/login.php:297 api/theme/registration.php:333
     2685#: api/theme/login.php:297 api/theme/registration.php:373
    26862686#: lib/templates/content-checkout/elements/purchase-requirements/logged-in/elements/login/register.php:20
    26872687msgid "Register"
     
    27582758msgstr ""
    27592759
    2760 #: api/theme/registration.php:412
     2760#: api/theme/registration.php:452
    27612761msgid "Registration Disabled"
    27622762msgstr ""
     
    28712871msgstr ""
    28722872
    2873 #. #-#-#-#-#  ithemes-exchange.pot (iThemes Exchange 1.11.5)  #-#-#-#-#
     2873#. #-#-#-#-#  ithemes-exchange.pot (iThemes Exchange 1.11.6)  #-#-#-#-#
    28742874#. Plugin Name of the plugin/theme
    28752875#: core-addons/admin/basic-reporting/init.php:19
     
    54755475msgstr ""
    54765476
    5477 #: lib/cart/class.cart.php:171 lib/cart/class.cart.php:548
     5477#: lib/cart/class.cart.php:171 lib/cart/class.cart.php:553
    54785478msgid "Product added to cart"
    54795479msgstr ""
     
    54965496msgstr ""
    54975497
    5498 #: lib/cart/class.cart.php:431
     5498#: lib/cart/class.cart.php:436
    54995499msgid "Billing Address Saved"
    55005500msgstr ""
    55015501
    5502 #: lib/cart/class.cart.php:530
     5502#: lib/cart/class.cart.php:535
    55035503msgid "Unknown error. Please try again."
    55045504msgstr ""
    55055505
    5506 #: lib/cart/class.cart.php:540
     5506#: lib/cart/class.cart.php:545
    55075507msgid "Please select a payment method"
    55085508msgstr ""
    55095509
    5510 #: lib/cart/class.cart.php:541
     5510#: lib/cart/class.cart.php:546
    55115511msgid "There was an error processing your transaction. Please try again."
    55125512msgstr ""
    55135513
    5514 #: lib/cart/class.cart.php:542
     5514#: lib/cart/class.cart.php:547
    55155515msgid "Product not removed from cart. Please try again."
    55165516msgstr ""
    55175517
    5518 #: lib/cart/class.cart.php:543
     5518#: lib/cart/class.cart.php:548
    55195519msgid "There was an error emptying your cart. Please try again."
    55205520msgstr ""
    55215521
    5522 #: lib/cart/class.cart.php:544
     5522#: lib/cart/class.cart.php:549
    55235523msgid "There was an error updating your cart. Please try again."
    55245524msgstr ""
    55255525
    5526 #: lib/cart/class.cart.php:545
     5526#: lib/cart/class.cart.php:550
    55275527msgid "Cart Updated."
    55285528msgstr ""
    55295529
    5530 #: lib/cart/class.cart.php:546
     5530#: lib/cart/class.cart.php:551
    55315531msgid "Cart Emptied"
    55325532msgstr ""
    55335533
    5534 #: lib/cart/class.cart.php:547
     5534#: lib/cart/class.cart.php:552
    55355535msgid "Product removed from cart."
    55365536msgstr ""
  • ithemes-exchange/trunk/lib/cart/class.cart.php

    r1024556 r1071318  
    409409        }
    410410
    411         /** @todo This is hardcoded for now. will be more flexible at some point **/
     411        /**
     412         * @todo This is hardcoded for now. will be more flexible at some point
     413         * If you're having trouble getting your custom field to save, make sure that your form field's name
     414         * matches what we're looking for in the REQUEST below. eg: adding 'custom-form' to the $fields var
     415         * via this next filter means that your form field name has to be: 'it-exchange-billing-address-custom-form'
     416        */
    412417        $billing = array();
    413418        $fields = apply_filters( 'it_exchange_billing_address_fields', array(
  • ithemes-exchange/trunk/lib/sessions/db_session_manager/db-session.php

    r1008592 r1071318  
    157157        // Delete all expired sessions in a single query
    158158        if ( ! empty( $expired_sessions ) ) {
    159             $option_names = implode( "','", $expired_sessions );
    160             $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')" );
     159            $formatted = implode( ', ', array_fill( 0, count( $expired_sessions ), '%s' ) );
     160            $query     = $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name IN ($formatted)", $expired_sessions );
     161            $wpdb->query( $query );
    161162        }
    162163    }
     
    193194        // Delete all sessions in a single query
    194195        if ( ! empty( $expired_sessions ) ) {
    195             $option_names = implode( "','", $expired_sessions );
    196             $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')" );
     196            $formatted = implode( ', ', array_fill( 0, count( $expired_sessions ), '%s' ) );
     197            $query     = $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name IN ($formatted)", $expired_sessions );
     198            $wpdb->query( $query );
    197199        }
    198200    }
  • ithemes-exchange/trunk/lib/super-widget/ajax.php

    r935226 r1071318  
    9090// Login
    9191if ( 'login' == $action ) {
    92     $creds['user_login']    = empty( $_POST['log'] ) ? '' : esc_attr( $_POST['log'] );
    93     $creds['user_password'] = empty( $_POST['pwd'] ) ? '' : esc_attr( $_POST['pwd'] );
    94     $creds['remember']      = empty( $_POST['rememberme'] ) ? '' : esc_attr( $_POST['rememberme'] );
     92    $creds['user_login']    = empty( $_POST['log'] ) ? '' : urldecode( $_POST['log'] );
     93    $creds['user_password'] = empty( $_POST['pwd'] ) ? '' : urldecode( $_POST['pwd'] );
     94    $creds['remember']      = empty( $_POST['rememberme'] ) ? '' : urldecode( $_POST['rememberme'] );
    9595
    9696    $user = wp_signon( $creds, false );
     
    113113        // Clearing the user pass will prevent the user email from being sent
    114114        $email_pw = apply_filters( 'it_exchange_send_customer_registration_email', true ) ? $_POST['pass1'] : '';
    115         wp_new_user_notification( $user_id, $email_pass );
     115        wp_new_user_notification( $user_id, $email_pw );
    116116
    117117        $creds = array(
     
    121121
    122122        $user = wp_signon( $creds );
    123         if ( ! is_wp_error( $user ) )
     123        if ( ! is_wp_error( $user ) ) {
    124124            it_exchange_add_message( 'notice', __( 'Registered and logged in as ', 'it-l10n-ithemes-exchange' ) . $user->user_login );
    125         else
     125        } else {
    126126            it_exchange_add_message( 'error', $result->get_error_message() );
     127        }
     128
     129        // Clear form values we saved in case of error
     130        it_exchange_clear_session_data( 'sw-registration' );
     131
    127132        die('1');
    128133    } else {
    129134        it_exchange_add_message( 'error', $user_id->get_error_message() );
     135
     136        // clear out the passwords before we save the data to the session
     137        unset( $_POST['pass1'] );
     138        unset( $_POST['pass2'] );
     139
     140        if ( $user_id->get_error_message( 'user_login' ) ) {
     141            unset( $_POST['user_login'] );
     142        }
     143
     144        if ( $user_id->get_error_message( 'invalid_email' ) || $user_id->get_error_message( 'email_exists' ) ) {
     145            unset( $_POST['email'] );
     146        }
     147
     148        it_exchange_update_session_data( 'sw-registration',  $_POST );
     149
    130150        die('0');
    131151    }
     
    135155if ( 'update-shipping' == $action ) {
    136156    // This function will either updated the value or create an error and return 1 or 0
    137     die( $GLOBALS['IT_Exchange_Shopping_Cart']->handle_update_shipping_address_request() );
     157
     158    $shipping_result = $GLOBALS['IT_Exchange_Shopping_Cart']->handle_update_shipping_address_request();
     159
     160    if ( ! $shipping_result ) {
     161        it_exchange_update_session_data( "sw-shipping", $_POST );
     162    } else {
     163        it_exchange_clear_session_data( "sw-shipping" );
     164    }
     165
     166    die( $shipping_result );
    138167}
    139168
     
    141170if ( 'update-billing' == $action ) {
    142171    // This function will either updated the value or create an error and return 1 or 0
    143     die( $GLOBALS['IT_Exchange_Shopping_Cart']->handle_update_billing_address_request() );
     172
     173    $billing_result =  $GLOBALS['IT_Exchange_Shopping_Cart']->handle_update_billing_address_request();
     174
     175    if ( ! $billing_result ) {
     176        it_exchange_update_session_data( "sw-billing", $_POST );
     177    } else {
     178        it_exchange_clear_session_data( "sw-billing" );
     179    }
     180
     181    die( $billing_result );
    144182}
    145183
  • ithemes-exchange/trunk/readme.txt

    r1057567 r1071318  
    44Requires at least: 3.7
    55Tested up to: 4.1
    6 Stable tag: 1.11.5.1
     6Stable tag: 1.11.6
    77License: GPLv2 or later
    88
     
    8888
    8989== Changelog ==
    90 = 1.11.5.1 =
    91 * Fix missing font-icons
     90
     91= 1.11.6 =
     92* Fix bug preventing users with '&' in their username from logging in via SW. props Timothy Jacobs <http://ironbounddesigns.com/>
     93* Remember the shipping address when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     94* Remember the billing address when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     95* Remember the registration fields when errors are present on SW form. props Timothy Jacobs <http://ironbounddesigns.com/>
     96* Fixed bug that tries to display disabled Exchange profile pages on the user's profile page. props Timothy Jacobs <http://ironbounddesigns.com/>
     97* Fix bug causing menu item titles to not display when user_is_logged_in and Exchagne login/logout pages are set to 'disabled' in Settings
     98* Properly escape in values in the event that poorly-formatted option names were previously inserted into the options table
     99* Fixed improper order of args in call to _x()
     100* Add new status to param of actions triggered when a transaction status is changed.
     101* Fixed bug that was preventing default WP welcome email from being sent when new users register
     102* Extend inline-docs a bit for saving custom billing address fields
    92103
    93104= 1.11.5 =
     
    135146* Add actions for applying/removing basic coupons to/from cart
    136147* Adding new filters and setting new global for add-ons
    137 * Adding some filters for Table Rate Shipping 
     148* Adding some filters for Table Rate Shipping
    138149* Add Mexican states to states.php dataset. Props: Darryl Clark
    139150* Fixed bug causing JS error when Image Gallery Settings turn zoom off
Note: See TracChangeset for help on using the changeset viewer.