Plugin Directory

Changeset 986730


Ignore:
Timestamp:
09/10/2014 07:09:51 PM (12 years ago)
Author:
ulih
Message:

Version 1.9.81
Service release for WooCommerce 2.2

Location:
woocommerce-poor-guys-swiss-knife
Files:
140 added
4 edited

Legend:

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

    r984826 r986730  
    107107           
    108108            add_action( 'woocommerce_init', array( $this, 'wcpgsk_empty_cart' ), PHP_INT_MAX );
    109            
    110 
     109       
    111110        }
    112111
  • woocommerce-poor-guys-swiss-knife/trunk/readme.txt

    r984844 r986730  
    55Requires at least: Wordpress 3.1 and WooCommerce 2.0
    66Tested up to: 4.0
    7 Stable tag: 1.9.8
     7Stable tag: 1.9.81
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8080= What's new? =
    8181
     82* WooCommerce 2.2 compatibility
    8283* input pattern attribute support with fallback for Safari browser 
    8384* Add one CC and/or BCC email recipient to all WooCommerce emails
     
    260261== Changelog ==
    261262
     263= 1.9.81 =
     264
     265* Service release for WooCommerce 2.2 fixing front end load issue
     266
    262267= 1.9.8 =
    263268
  • woocommerce-poor-guys-swiss-knife/trunk/wcpgsk-af.php

    r984826 r986730  
    3535add_filter( 'woocommerce_available_variation', 'wcpgsk_available_variation', 10, 3 );
    3636
     37
     38
    3739//fix input quantity problem of woocommerce for variations as variations are configured via javasript overwriting all filters and actions by woocommerce, in fact a bug of woocommerce
    3840function wcpgsk_available_variation($variation_data, $product, $variation) {
     
    4547    return $variation_data;
    4648}
    47 
    48 function woocommerce_quantity_input( $args = array(), $product = null, $echo = true ) {
    49     if ( is_null( $product ) )
    50         $product = $GLOBALS['product'];
    51     $options = get_option( 'wcpgsk_settings' );
    52     $product_id = $product->post->ID;       
    53     $selectqty = get_post_meta($product_id, '_wcpgsk_selectqty', true);     
    54     //var_dump( $args );
    55     $ival = apply_filters( 'woocommerce_quantity_input_min', '', $product );
    56     if ( !$ival ) :
    57         $ival = apply_filters( 'woocommerce_quantity_input_step', '1', $product );
    58     endif;
    59     $stepval = apply_filters( 'woocommerce_quantity_input_step', '1', $product );
    60     $maxval = apply_filters( 'woocommerce_quantity_input_max', '', $product );
    61     $mval = apply_filters( 'woocommerce_quantity_input_min', '', $product );
    62     if ( !empty($args) && isset($args['input_name']) && strpos($args['input_name'], 'quantity[') !== false ) :
    63        
    64         if ( !$ival || (is_numeric( $ival ) && $ival < 1 ) ) :
    65             if ( $stepval <= $maxval || !$maxval ) :
    66                 $ival = $stepval;
    67             else :
    68                 $ival = 1;
    69             endif;
    70         endif;
    71         //$mval = 0;
    72     elseif ( !$ival || (is_numeric( $ival ) && $ival < 1 ) ) :
    73         if ( $stepval <= $maxval || !$maxval ) :
    74             $ival = $stepval;
    75         else :
    76             $ival = 1;
    77         endif;
    78         //$mval = 0;
    79     endif;
    80     $defaults = array(
    81         'input_name'    => 'quantity',
    82         'input_value'   => $ival,
    83         'max_value'     => $maxval,
    84         'min_value'     => $mval,
    85         'step'      => $stepval,
    86         'style'     => apply_filters( 'woocommerce_quantity_style', 'float:left; margin-right:10px;', $product )
    87     );
    88     if ( !empty($args) && isset($args['input_name']) && !empty($args['input_name']) ) :
    89         $defaults['input_name'] = $args['input_name'];
    90     endif;
    91    
    92     if ( $maxval ) :
    93         unset( $args['max_value'] );
    94     endif;
    95     $args = apply_filters( 'woocommerce_quantity_input_args', wp_parse_args( $args, $defaults ), $product );
    96 
    97     if ( isset($options['cart']['minmaxstepproduct']) && $options['cart']['minmaxstepproduct'] == 1 && isset($selectqty) && $selectqty == 'yes' ) :
    98    
    99         $minqty = get_post_meta($product_id, '_wcpgsk_minqty', true);
    100         $maxqty = get_post_meta($product_id, '_wcpgsk_maxqty', true);
    101         $stepqty = get_post_meta($product_id, '_wcpgsk_stepqty', true);     
    102        
    103         if ( ! empty( $args['min_value'] ) )
    104             $min = $args['min_value'];
    105         else $min = $minqty > 0 ? $minqty : 0;
    106 
    107         if ( ! empty( $args['max_value'] ) )
    108             $max = $args['max_value'];
    109         else $max = $maxqty > 0 ? $maxqty : '';
    110 
    111         if ( ! empty( $args['step'] ) )
    112             $step = $args['step'];
    113         else $step = $stepqty > 0 ? $stepqty : 1;
    114         if ( ( !empty( $min ) && is_numeric( $min) ) && ( !empty( $max ) && is_numeric( $max ) ) ) :
    115             $options = '';
    116             for ( $count = $min; $count <= $max; $count = $count+$step ) {
    117                 $options .= '<option value="' . $count . '" ' . selected($count, $args['input_value'], false) . '>' . $count . '</option>';
    118             }
    119             $retstr = '<div class="quantity_select" style="' . $args['style'] . '"><select name="' . esc_attr( $args['input_name'] ) . '" title="' . _x( 'Qty', 'Product quantity input tooltip', 'woocommerce' ) . '" class="qty">' . $options . '</select></div>';
    120             if ( $echo ) :
    121                 echo $retstr;
    122             else :
    123                 return $retstr;
    124             endif;
    125            
    126        
    127         else :
    128             extract( $args, EXTR_OVERWRITE );
    129             if ( function_exists( 'wc_get_template' ) ) :               
    130                 ob_start();
    131                 wc_get_template( 'global/quantity-input.php', $args );
    132                 if ( $echo ) {
    133                     echo ob_get_clean();
    134                 } else {
    135                     return ob_get_clean();
    136                 }
    137             else :
    138                 ?>
    139                     <div class="quantity"><input type="number" step="<?php echo esc_attr( $step ); ?>" <?php if ( is_numeric( $min_value ) ) : ?>min="<?php echo esc_attr( $min_value ); ?>"<?php endif; ?> <?php if ( is_numeric( $max_value ) ) : ?>max="<?php echo esc_attr( $max_value ); ?>"<?php endif; ?> name="<?php echo esc_attr( $input_name ); ?>" value="<?php echo esc_attr( $input_value ); ?>" title="<?php _ex( 'Qty', 'Product quantity input tooltip', 'woocommerce' ) ?>" class="input-text qty text" size="4" /></div>
    140                 <?php
    141             endif;
    142         endif;
    143     else :
    144         extract( $args, EXTR_OVERWRITE );
    145         if ( function_exists( 'wc_get_template' ) ) :               
    146             ob_start();
    147             wc_get_template( 'global/quantity-input.php', $args );
    148             if ( $echo ) {
    149                 echo ob_get_clean();
    150             } else {
    151                 return ob_get_clean();
    152             }
    153         else :
    154             ?>
    155                 <div class="quantity"><input type="number" step="<?php echo esc_attr( $step ); ?>" <?php if ( is_numeric( $min_value ) ) : ?>min="<?php echo esc_attr( $min_value ); ?>"<?php endif; ?> <?php if ( is_numeric( $max_value ) ) : ?>max="<?php echo esc_attr( $max_value ); ?>"<?php endif; ?> name="<?php echo esc_attr( $input_name ); ?>" value="<?php echo esc_attr( $input_value ); ?>" title="<?php _ex( 'Qty', 'Product quantity input tooltip', 'woocommerce' ) ?>" class="input-text qty text" size="4" /></div>
    156             <?php
    157         endif;
    158     endif;
    159 }
    160 
    16149
    16250function wcpgsk_check_cart_items() {
  • woocommerce-poor-guys-swiss-knife/trunk/woocommerce-poor-guys-swiss-knife.php

    r984826 r986730  
    88 * Author: Uli Hake
    99 * Author URI: http://takebarcelona.com/authorship/uli-hake
    10  * Version: 1.9.8
     10 * Version: 1.9.81
    1111 * @package WordPress
    1212 * @subpackage WooCommerce Poor Guys Swiss Knife
     
    9292
    9393add_action( 'woocommerce_init', 'wcpgsk_init' );
    94 if ( !function_exists('wcpgsk_load_wcsession_helper') ) {
     94if ( !function_exists('wcpgsk_init') ) {
    9595function wcpgsk_init() {
    9696    global $wcpgsk, $wcpgsk_about, $wcpgsk_options, $wcpgsk_session, $wcpgsk_woocommerce_active;   
     
    101101        require_once( 'classes/woocommerce-poor-guys-swiss-knife-about.php' ); 
    102102        require_once( 'wcpgsk-af.php' );
     103       
    103104        if ( !is_admin() ) :
    104105            add_action( 'plugins_loaded', 'wcpgsk_load_wcsession_helper' );
     
    106107        //load into our global
    107108        $wcpgsk = new WCPGSK_Main( __FILE__ );
    108         $wcpgsk->version = '1.9.8';
     109        $wcpgsk->version = '1.9.81';   
    109110        $wcpgsk->wcpgsk_hook_woocommerce_filters();
    110111       
     
    118119}
    119120}
    120 
     121/*
     122* obsolete
    121123if ( !function_exists('wcpgsk_load_wcsession_helper') ) {
    122124// @changed 1.5.4 because we do not support WooCommerce < 2.0
     
    128130    endif; 
    129131}
     132}
     133*/
     134
     135add_action( 'after_setup_theme', 'wcpgsk_template_functions', 1 );
     136
     137function wcpgsk_template_functions() {
     138    include_once( 'wcpgsk-fa.php' );
    130139}
    131140
Note: See TracChangeset for help on using the changeset viewer.