Plugin Directory

Changeset 1036794


Ignore:
Timestamp:
12/02/2014 04:00:22 PM (11 years ago)
Author:
ulih
Message:

Version 2.2.1

Location:
woocommerce-poor-guys-swiss-knife
Files:
150 added
3 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-poor-guys-swiss-knife/trunk/classes/woocommerce-poor-guys-swiss-knife.php

    r1035117 r1036794  
    116116            add_filter('woocommerce_free_price_html', array( $this, 'wcpgsk_free_price_html' ), PHP_INT_MAX, 2 );
    117117            add_filter('woocommerce_after_my_account', array( $this, 'wcpgsk_after_my_account' ), 10 );
     118           
    118119        }
    119120
     
    324325                endswitch;
    325326            endif;
    326             $hdl_backorder = $product->get_availability();
    327             $options = get_option( 'wcpgsk_settings' );                 
    328             if ( $hdl_backorder['class'] == 'available-on-backorder' && isset( $options['process']['backorderlabel'] ) && !empty( $options['process']['backorderlabel'] ) ) :
    329                 $price = $price . '<div class="wcpgsk-extend-price-data">' . __( $options['process']['backorderlabel'], WCPGSK_DOMAIN ) . '</div>';
     327            if ( $product->managing_stock() ) :
     328                $hdl_backorder = $product->get_availability();
     329                $options = get_option( 'wcpgsk_settings' );                 
     330                if ( isset( $hdl_backorder ) && $hdl_backorder['class'] == 'available-on-backorder' && isset( $options['process']['backorderlabel'] ) && !empty( $options['process']['backorderlabel'] ) ) :
     331                    $price = $price . '<div class="wcpgsk-extend-price-data">' . __( $options['process']['backorderlabel'], WCPGSK_DOMAIN ) . '</div>';
     332                endif;
    330333            endif;
    331 
    332334            return $price;
    333335        }
     
    30813083            $options['woofields']['placehoder_billing_email_validator'] = !empty($options['woofields']['placehoder_billing_email_validator']) ? $options['woofields']['placehoder_billing_email_validator'] : '';
    30823084            $options['woofields']['required_billing_email_validator'] = isset($options['woofields']['required_billing_email_validator']) ? $options['woofields']['required_billing_email_validator'] : 1;
    3083             if (isset($options['checkoutform']['billingemailvalidator']) && $options['checkoutform']['billingemailvalidator'] == 1) {
    3084                 $fields['billing_email_validator'] = array(
    3085                     'type'              => 'text',
    3086                     'label'             => __( $options['woofields']['label_billing_email_validator'], WCPGSK_DOMAIN ),
    3087                     'placeholder'       => __( $options['woofields']['placehoder_billing_email_validator'], WCPGSK_DOMAIN ),
    3088                     'required'          => (($options['woofields']['required_billing_email_validator'] == 1) ? true : false),
    3089                     //not necessary... 'validate'           => 'email'
    3090                 );
    3091             }
    3092            
     3085            if ( !is_user_logged_in() ) :           
     3086                if (isset($options['checkoutform']['billingemailvalidator']) && $options['checkoutform']['billingemailvalidator'] == 1) {
     3087                    $fields['billing_email_validator'] = array(
     3088                        'type'              => 'text',
     3089                        'label'             => __( $options['woofields']['label_billing_email_validator'], WCPGSK_DOMAIN ),
     3090                        'placeholder'       => __( $options['woofields']['placehoder_billing_email_validator'], WCPGSK_DOMAIN ),
     3091                        'required'          => (($options['woofields']['required_billing_email_validator'] == 1) ? true : false),
     3092                        //not necessary... 'validate'           => 'email'
     3093                    );
     3094                }
     3095            endif;
    30933096            if (isset($options['woofields']['billing']) && is_array($options['woofields']['billing'])) {
    30943097                foreach($options['woofields']['billing'] as $customkey => $customconfig) {
     
    36633666           
    36643667            //do_action('wcpgsk_checkout_process_action');
    3665            
    3666             if (isset($options['checkoutform']['billingemailvalidator']) && $options['checkoutform']['billingemailvalidator'] == 1) {
    3667                 if ($_POST[ 'billing_email' ] && $_POST[ 'billing_email_validator' ] && strtolower($_POST[ 'billing_email' ]) != strtolower($_POST[ 'billing_email_validator' ]))
    3668                     wcpgsk_add_error(  '<strong>' . __('Email addresses do not match', WCPGSK_DOMAIN) . ': ' . $_POST[ 'billing_email' ] . ' : ' . (empty($_POST[ 'billing_email_validator' ]) ? __('Missing validation email', WCPGSK_DOMAIN) : $_POST[ 'billing_email_validator' ]) . '</strong>');
    3669                 elseif ($_POST[ 'billing_email' ] && !$_POST[ 'billing_email_validator' ])
    3670                     wcpgsk_add_error(  '<strong>' . __('You have to supply a validation email for: ', WCPGSK_DOMAIN) . $_POST[ 'billing_email' ] . '</strong>');
    3671             }
    3672            
     3668            if ( !is_user_logged_in() ) :
     3669                if (isset($options['checkoutform']['billingemailvalidator']) && $options['checkoutform']['billingemailvalidator'] == 1) {
     3670                    if ($_POST[ 'billing_email' ] && $_POST[ 'billing_email_validator' ] && strtolower($_POST[ 'billing_email' ]) != strtolower($_POST[ 'billing_email_validator' ]))
     3671                        wcpgsk_add_error(  '<strong>' . __('Email addresses do not match', WCPGSK_DOMAIN) . ': ' . $_POST[ 'billing_email' ] . ' : ' . (empty($_POST[ 'billing_email_validator' ]) ? __('Missing validation email', WCPGSK_DOMAIN) : $_POST[ 'billing_email_validator' ]) . '</strong>');
     3672                    elseif ($_POST[ 'billing_email' ] && !$_POST[ 'billing_email_validator' ])
     3673                        wcpgsk_add_error(  '<strong>' . __('You have to supply a validation email for: ', WCPGSK_DOMAIN) . $_POST[ 'billing_email' ] . '</strong>');
     3674                }
     3675            endif;
    36733676            //Just communicate the required state to WC plus the label in billing context based on user choice and locale configuration
    36743677            //WC will take care of the error handling
  • woocommerce-poor-guys-swiss-knife/trunk/readme.txt

    r1035117 r1036794  
    55Requires at least: Wordpress 3.1 and WooCommerce 2.0
    66Tested up to: 4.0
    7 Stable tag: 2.2
     7Stable tag: 2.2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    303303== Changelog ==
    304304
     305= 2.2.1 =
     306
     307* Compatibility: Disable email validation for logged-in customers
     308* Bugfix: Fix problem with price label and stock management
     309
    305310= 2.2 =
    306311
     
    312317* Improve integration with WooCommerce Rich Guys 2.2+
    313318* Bugfix: Fixes for quantity notifications
    314 
    315319
    316320= 2.1.2 =
  • woocommerce-poor-guys-swiss-knife/trunk/woocommerce-poor-guys-swiss-knife.php

    r1035117 r1036794  
    88 * Author: Uli Hake
    99 * Author URI: http://takebarcelona.com/authorship/uli-hake
    10  * Version: 2.2
     10 * Version: 2.2.1
    1111 * @package WordPress
    1212 * @subpackage WooCommerce Poor Guys Swiss Knife
     
    121121        //load into our global
    122122        $wcpgsk = new WCPGSK_Main( __FILE__ );
    123         $wcpgsk->version = '2.2';   
     123        $wcpgsk->version = '2.2.1';
    124124        $wcpgsk->wcpgsk_hook_woocommerce_filters();
    125125       
Note: See TracChangeset for help on using the changeset viewer.