Plugin Directory

Changeset 1006889


Ignore:
Timestamp:
10/13/2014 10:45:45 PM (11 years ago)
Author:
ulih
Message:

Version 2.0.2

Location:
woocommerce-poor-guys-swiss-knife/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-poor-guys-swiss-knife/trunk/assets/js/accordion.js

    r820403 r1006889  
    1313        active: false,
    1414    });
     15   
    1516});
    1617/*
  • woocommerce-poor-guys-swiss-knife/trunk/readme.txt

    r1005375 r1006889  
    55Requires at least: Wordpress 3.1 and WooCommerce 2.0
    66Tested up to: 4.0
    7 Stable tag: 2.0.1
     7Stable tag: 2.0.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    298298== Changelog ==
    299299
     300= 2.0.2 =
     301
     302* Compatibility: Make some filter functions saver to avoid errors with other third party plugins
     303* Revision: Number customer field handling
     304
    300305= 2.0.1 =
    301306
  • woocommerce-poor-guys-swiss-knife/trunk/wcpgsk-af.php

    r1005375 r1006889  
    403403
    404404if ( !function_exists('wcpgsk_qtyselector_max') ) {
    405 function wcpgsk_qtyselector_max( $whatever, $product ) {
    406     global $wcpgsk_session;
    407     $options = get_option( 'wcpgsk_settings' );
    408     if ( $product->is_sold_individually() ) :
    409         $maxqty = 1;
     405function wcpgsk_qtyselector_max( $whatever, $product = null ) {
     406    if ( isset( $product ) && is_object( $product ) ) :
     407        global $wcpgsk_session;
     408        $options = get_option( 'wcpgsk_settings' );
     409        if ( $product->is_sold_individually() ) :
     410            $maxqty = 1;
     411        else :
     412            $maxqty = isset($options['cart']['maxqty_' . $product->product_type]) && $options['cart']['maxqty_' . $product->product_type] != 0 ? $options['cart']['maxqty_' . $product->product_type] : '';
     413            if ( isset($options['cart']['minmaxstepproduct']) && $options['cart']['minmaxstepproduct'] == 1 ) :
     414                $product_id = $product->post->ID;       
     415                $maxval = get_post_meta($product_id, '_wcpgsk_maxqty', true);
     416                if ( isset($maxval) && $maxval > 0 ) :
     417                    $maxqty = $maxval;
     418                endif;
     419            endif;
     420            if ($maxqty == '' && isset($wcpgsk_session->qtyargs['max_value']) ) {
     421                $maxqty = $wcpgsk_session->qtyargs['max_value'];
     422            }
     423        endif;
     424        return $maxqty;
    410425    else :
    411         $maxqty = isset($options['cart']['maxqty_' . $product->product_type]) && $options['cart']['maxqty_' . $product->product_type] != 0 ? $options['cart']['maxqty_' . $product->product_type] : '';
    412         if ( isset($options['cart']['minmaxstepproduct']) && $options['cart']['minmaxstepproduct'] == 1 ) :
    413             $product_id = $product->post->ID;       
    414             $maxval = get_post_meta($product_id, '_wcpgsk_maxqty', true);
    415             if ( isset($maxval) && $maxval > 0 ) :
    416                 $maxqty = $maxval;
    417             endif;
    418         endif;
    419         if ($maxqty == '' && isset($wcpgsk_session->qtyargs['max_value']) ) {
    420             $maxqty = $wcpgsk_session->qtyargs['max_value'];
    421         }
    422     endif;
    423     return $maxqty;
     426        return $whatever;
     427    endif;
    424428}
    425429}
    426430
    427431if ( !function_exists('wcpgsk_qtyselector_min') ) {
    428 function wcpgsk_qtyselector_min( $whatever, $product ) {
    429     global $wcpgsk_session;
    430     $options = get_option( 'wcpgsk_settings' );
    431     if ( $product->is_sold_individually() ) :
    432         $minqty = 1;
     432function wcpgsk_qtyselector_min( $whatever, $product = null ) {
     433    if ( isset( $product ) && is_object( $product ) ) :
     434        global $wcpgsk_session;
     435        $options = get_option( 'wcpgsk_settings' );
     436        if ( $product->is_sold_individually() ) :
     437            $minqty = 1;
     438        else :
     439            $minqty = isset($options['cart']['minqty_' . $product->product_type]) && $options['cart']['minqty_' . $product->product_type] != 0 ? $options['cart']['minqty_' . $product->product_type] : 0;
     440            if ( isset($options['cart']['minmaxstepproduct']) && $options['cart']['minmaxstepproduct'] == 1 ) :
     441                $product_id = $product->post->ID;       
     442                $minval = get_post_meta($product_id, '_wcpgsk_minqty', true);
     443                if ( isset($minval) && $minval > 0 ) :
     444                    $minqty = $minval;
     445                endif;
     446            endif;
     447            if ($minqty == '' && isset($wcpgsk_session->qtyargs['min_value']) ) {
     448                $minqty = $wcpgsk_session->qtyargs['min_value'];
     449            }
     450        endif;
     451        return $minqty;
    433452    else :
    434         $minqty = isset($options['cart']['minqty_' . $product->product_type]) && $options['cart']['minqty_' . $product->product_type] != 0 ? $options['cart']['minqty_' . $product->product_type] : 0;
    435         if ( isset($options['cart']['minmaxstepproduct']) && $options['cart']['minmaxstepproduct'] == 1 ) :
    436             $product_id = $product->post->ID;       
    437             $minval = get_post_meta($product_id, '_wcpgsk_minqty', true);
    438             if ( isset($minval) && $minval > 0 ) :
    439                 $minqty = $minval;
    440             endif;
    441         endif;
    442         if ($minqty == '' && isset($wcpgsk_session->qtyargs['min_value']) ) {
    443             $minqty = $wcpgsk_session->qtyargs['min_value'];
    444         }
    445     endif;
    446     return $minqty;
     453        return $whatever;
     454    endif;
    447455}
    448456}
    449457
    450458if ( !function_exists('wcpgsk_quantity_input_step') ) {
    451 function wcpgsk_quantity_input_step( $whatever, $product ) {
    452     global $wcpgsk_session;
    453     $options = get_option( 'wcpgsk_settings' );
    454     if ( $product->is_sold_individually() ) :
    455         $stepqty = 1;
    456     else :     
    457         $stepqty = isset($options['cart']['stepqty_' . $product->product_type]) && $options['cart']['stepqty_' . $product->product_type] != 0 ? $options['cart']['stepqty_' . $product->product_type] : 1;
    458         if ( isset($options['cart']['minmaxstepproduct']) && $options['cart']['minmaxstepproduct'] == 1 ) :
    459             $product_id = $product->post->ID;       
    460             $stepval = get_post_meta($product_id, '_wcpgsk_stepqty', true);
    461             if ( isset($stepval) && $stepval > 0 ) :
    462                 $stepqty = $stepval;
    463             endif;
    464         endif;
    465     endif;
    466     return $stepqty;
     459function wcpgsk_quantity_input_step( $whatever, $product = null ) {
     460    if ( isset( $product ) && is_object( $product ) ) :
     461        global $wcpgsk_session;
     462        $options = get_option( 'wcpgsk_settings' );
     463        if ( $product->is_sold_individually() ) :
     464            $stepqty = 1;
     465        else :     
     466            $stepqty = isset($options['cart']['stepqty_' . $product->product_type]) && $options['cart']['stepqty_' . $product->product_type] != 0 ? $options['cart']['stepqty_' . $product->product_type] : 1;
     467            if ( isset($options['cart']['minmaxstepproduct']) && $options['cart']['minmaxstepproduct'] == 1 ) :
     468                $product_id = $product->post->ID;       
     469                $stepval = get_post_meta($product_id, '_wcpgsk_stepqty', true);
     470                if ( isset($stepval) && $stepval > 0 ) :
     471                    $stepqty = $stepval;
     472                endif;
     473            endif;
     474        endif;
     475        return $stepqty;
     476    else :
     477        return $whatever;
     478    endif;
    467479}
    468480}
     
    473485 * @TODO: revision of this all as the whole process is not meaningful due to some other changes
    474486 */
    475 function wcpgsk_qty_input_args($args, $product) {
     487function wcpgsk_qty_input_args($argss) {
    476488    global $wcpgsk_session, $woocommerce;
    477489   
     
    860872                    var $this = this;
    861873                    jQuery(this).after("<div id=\'slider_" + jQuery(this).attr("id") + "\'></div>");
     874                    if ( jQuery($this).attr("minvalue") ) {
     875                        jQuery($this).attr("min", jQuery($this).attr("minvalue") );
     876                    }
     877                    if ( jQuery($this).attr("rangemax") ) {
     878                        jQuery($this).attr("max", jQuery($this).attr("rangemax") );
     879                    }
     880                    if ( jQuery($this).attr("maxvalue") ) {
     881                        jQuery($this).attr("max", jQuery($this).attr("maxvalue") );
     882                    }
     883                    if ( jQuery(this).attr("numstep") ) {
     884                        jQuery($this).attr("step", jQuery($this).attr("numstep") );
     885                    }               
    862886
    863887                    if (jQuery($this).attr("numpres") == "true") {
     
    874898                    }
    875899                    else {
     900                        jQuery($this).attr("type", "number");
     901                   
    876902                        jQuery("#slider_" + jQuery($this).attr("id")).slider({
    877903                            range: jQuery($this).attr("numpres"),
     
    883909                                jQuery( $this ).val( ui.value );
    884910                            }       
    885                         }).sliderAccess({ touchonly : false });
     911                        }).sliderAccess({ touchonly : true });
    886912                    }
    887913                });
  • woocommerce-poor-guys-swiss-knife/trunk/woocommerce-poor-guys-swiss-knife.php

    r1005375 r1006889  
    88 * Author: Uli Hake
    99 * Author URI: http://takebarcelona.com/authorship/uli-hake
    10  * Version: 2.0.1
     10 * Version: 2.0.2
    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.0.1';
     123        $wcpgsk->version = '2.0.2';
    124124        $wcpgsk->wcpgsk_hook_woocommerce_filters();
    125125       
Note: See TracChangeset for help on using the changeset viewer.