Plugin Directory

Changeset 976205


Ignore:
Timestamp:
08/31/2014 10:51:19 PM (12 years ago)
Author:
ulih
Message:

Version 1.9.7
Enhancements and minor bug fixes

Location:
woocommerce-poor-guys-swiss-knife
Files:
138 added
5 edited

Legend:

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

    r936643 r976205  
    281281            new_row = table.children('tbody').children('tr.wcpgsk_add_field_row').clone(false),
    282282            /*fix hyphen problem*/
    283             //new_id = jQuery('#' + jQuery(this).attr('for') + '_fieldid').val().toLowerCase().replace(/[^a-z0-9_\s]/gi, '').replace(/[_\s]/g, '_'),
    284283            new_id = jQuery('#' + jQuery(this).attr('for') + '_fieldid').val().toLowerCase().replace(/[^a-z0-9_\s]/gi, '').replace(/[\s]/g, '_'),
     284           
    285285            new_type = jQuery('#' + jQuery(this).attr('for') + '_type').val();// Create and add the new field row
    286286        if (new_id.length > 0) {
     
    294294            if (!foundid) {
    295295                new_row.attr( 'class', 'wcpgsk_order_row' );
    296 
    297            
    298296                // Update names
    299297                var count = parseInt(row_count) + 1;
     
    306304                   
    307305                });
    308 
     306                //fix new field problem
     307                var newfield = new_row.find('[name$="[label_' + new_id + ']"]').val();
     308                alert(newfield);
     309                var nfcnt = 1;
     310                table.children('tbody').children('tr.wcpgsk_order_row').each(function() {
     311                    jQuery(this).find('[name*="[label_"]').each(function(){
     312                        if ( jQuery(this).val().indexOf(newfield) == 0 ) {
     313                            nfcnt++;
     314                        }
     315                    });
     316                });
     317                if ( nfcnt > 1 ) {
     318                    new_row.find('[name$="[placeholder_' + new_id + ']"]').val(newfield + nfcnt);
     319                    new_row.find('[name$="[label_' + new_id + ']"]').val(newfield + nfcnt);                 
     320                }
     321                //fix end
    309322                new_row.find('[name$="[ident_' + new_id + ']"]').html(new_id);
    310323                new_row.find('[name$="[button_' + new_id + ']"]').html(new_type);
  • woocommerce-poor-guys-swiss-knife/trunk/classes/woocommerce-poor-guys-swiss-knife.php

    r972884 r976205  
    5252               
    5353                add_action('wp_ajax_wcpgsk_save_checkoutjs', array($this, 'wcpgsk_save_checkoutjs_callback')); 
    54 
     54                add_action( 'wcpgsk_settings_page_email', array( $this, 'wcpgsk_settings_page_email_wcpgsk' ), 10, 1 );
     55                add_action( 'wcpgsk_settings_page_labels', array( $this, 'wcpgsk_page_labels' ), 10, 1 );
     56               
    5557            endif;
    5658           
     
    9496
    9597            add_filter( 'woocommerce_customer_meta_fields', array($this, 'wcpgsk_customer_meta_fields'), 99 );
     98            //add_filter( 'woocommerce_customer_meta_fields', array($this, 'wcpgsk_customer_meta_fields'), 99 );
     99
     100            add_filter( 'woocommerce_email_headers', array( $this, 'wcpgsk_email_headers' ), PHP_INT_MAX, 3 );
    96101           
    97102            add_action( 'wp_print_scripts', array($this, 'wcpgsk_handle_scripts'), 100 );
    98             add_action( 'wp_enqueue_scripts', array($this, 'wcpgsk_degenerate'), 100 );         
    99         }
    100 
     103            add_action( 'wp_enqueue_scripts', array($this, 'wcpgsk_degenerate'), 100 );     
     104           
     105            add_filter( 'woocommerce_sale_flash', array( $this, 'wcpgsk_sale_flash' ), 10, 3 );
     106            add_action( 'woocommerce_proceed_to_checkout', array( $this, 'wcpgsk_after_cart' ), 10 );
     107           
     108            add_action( 'woocommerce_init', array( $this, 'wcpgsk_empty_cart' ), PHP_INT_MAX );
     109           
     110
     111        }
     112
     113        /**
     114         * Process empty cart request
     115         *
     116         * @since 1.9.7
     117         *
     118         * @access public
     119         */
     120        public function wcpgsk_empty_cart() {
     121            if ( isset( $_POST['wcpgsk_empty_cart'] ) ) {               
     122                global $woocommerce;
     123                $woocommerce->cart->empty_cart();
     124            }
     125        }
     126       
     127        /**
     128         * Add empty cart form
     129         *
     130         * @since 1.9.7
     131         *
     132         * @access public
     133         */
     134        public function wcpgsk_after_cart( ) {
     135            $options = get_option( 'wcpgsk_settings' );
     136            if ( isset( $options['cart']['addemptycart'] ) && $options['cart']['addemptycart'] ) :
     137                if ( isset( $options['process']['confirmemptycart'] ) && !empty( $options['process']['confirmemptycart'] ) ) :
     138                    $eclabel = isset( $options['process']['emptycartlabel'] ) && !empty( $options['process']['emptycartlabel'] ) ? $options['process']['emptycartlabel'] : "Empty cart";
     139                    $cclabel = isset( $options['process']['confirmemptycart'] ) && !empty( $options['process']['confirmemptycart'] ) ? $options['process']['confirmemptycart'] : "Yes, empty cart";
     140                    echo '<div style="float:left;display:inline-block;padding:0 5px 0 5px;" class="wcpgsk_empty_cart"><input type="button" class="button" style="width:100%" id="wcpgsk_confirm_empty_cart" value="' . __( $eclabel, WCPGSK_DOMAIN) . '"/></div>';
     141                    echo '<div style="float:left;display:inline-block;padding:0 5px 0 5px;" class="wcpgsk_empty_cart"><input type="submit" class="button" style="display:none;width:100%" id="wcpgsk_empty_cart" name="wcpgsk_empty_cart" value="' . __( $cclabel, WCPGSK_DOMAIN) . '"></div>';
     142                else :
     143                    $eclabel = isset( $options['process']['emptycartlabel'] ) && !empty( $options['process']['emptycartlabel'] ) ? $options['process']['emptycartlabel'] : "Empty cart";
     144                    echo '<div style="float:left;display:inline-block;padding:0 5px 0 5px;" class="wcpgsk_empty_cart"><input type="submit" class="button" name="wcpgsk_empty_cart" value="' . __( $eclabel, WCPGSK_DOMAIN) . '"></div>';
     145                endif;
     146            endif;
     147        }
     148       
     149       
     150       
     151        /**
     152         * Sale flash text
     153         *
     154         * @since 1.9.7
     155         *
     156         * @access public
     157         * @param string $flash
     158         * @param mixed $post
     159         * @param mixed $product
     160         * @return string
     161         */
     162        public function wcpgsk_sale_flash( $flash, $post, $product ) {
     163            $options = get_option( 'wcpgsk_settings' );
     164            if ( isset( $options['process']['onsalelabel'] ) && !empty( $options['process']['onsalelabel'] ) ) :
     165                $flash = '<span class="onsale">' . __( $options['process']['onsalelabel'], WCPGSK_DOMAIN ) . '</span>';
     166            endif;
     167            return $flash;
     168        }
     169       
     170        /**
     171         * Add additional email headers
     172         *
     173         * @since 1.9.7
     174         *
     175         * @access public
     176         * @param string $headers (existing)
     177         * @param string $context
     178         * @param mixed $email
     179         * @return string
     180         */
     181        public function wcpgsk_email_headers( $headers = '', $context = '', $email = array() ) {
     182            $options = get_option( 'wcpgsk_settings' );
     183            if ( isset( $headers ) && !empty( $headers ) ) :
     184                $headers = explode( "\r\n", $headers );
     185            else :
     186                $headers = array();
     187            endif;
     188            if ( isset( $options['email']['wc_cc_email'] ) && !empty( $options['email']['wc_cc_email'] ) && is_email( $options['email']['wc_cc_email'] ) ) :
     189                $headers[] = "Cc: " . $options['email']['wc_cc_email'];
     190            endif;
     191            if ( isset($options['email']['wc_bcc_email']) && !empty( $options['email']['wc_bcc_email'] ) && is_email( $options['email']['wc_bcc_email'] ) ) :           
     192                $headers[] = "Bcc: " . $options['email']['wc_bcc_email'];           
     193            endif;
     194           
     195            return implode( "\r\n", $headers);
     196        }
     197       
     198        /**
     199         * Email configuration settings
     200         *
     201         * @since 1.9.7
     202         *
     203         * @access public
     204         * @param array $options
     205         */
     206        public function wcpgsk_settings_page_email_wcpgsk( $options ) {
     207            if ( isset( $options['email']['wc_cc_email'] ) && !empty( $options['email']['wc_cc_email'] ) ) :           
     208                $emails = explode( ',', str_replace( ';', ',', $options['email']['wc_cc_email'] ) );
     209                $options['email']['wc_cc_email'] = isset( $emails[0] ) ? $emails[0] : '';
     210            else :
     211                $options['email']['wc_cc_email'] = '';             
     212            endif;
     213            if ( isset($options['email']['wc_bcc_email']) && !empty( $options['email']['wc_bcc_email'] ) ) :           
     214                $emails = explode( ',', str_replace( ';', ',', $options['email']['wc_bcc_email'] ) );
     215                $options['email']['wc_bcc_email'] = isset( $emails[0] ) ? $emails[0] : '';
     216            else :
     217                $options['email']['wc_bcc_email'] = '';
     218            endif;
     219        ?>
     220            <h3 class="wcpgsk_acc_header"><?php echo __('Email Settings',WCPGSK_DOMAIN); ?></h3>
     221            <div>
     222                <table class="widefat" border="1" >
     223                <thead>
     224                    <tr>
     225                        <th><?php _e('Settings Name', WCPGSK_DOMAIN);  ?></th>
     226                        <th><?php _e('Data', WCPGSK_DOMAIN);  ?></th>       
     227                        <th><?php _e('Comments', WCPGSK_DOMAIN);  ?></th>
     228                    </tr>
     229                </thead>
     230                <tbody>
     231                    <tr>
     232                        <td width="25%"><?php _e( 'Carbon Copy Email (CC) Recipient', WCPGSK_DOMAIN ); ?></td>
     233                        <td>
     234                            <input name="wcpgsk_settings[email][wc_cc_email]" id="wcpgsk_wc_cc_email" type="email" value="<?php echo $options['email']['wc_cc_email'] ?>" class="regular-text" />
     235                        </td>
     236                        <td>
     237                            <span class="description"><?php _e('Specify a valid email address that will receive copies of all WooCommerce emails.', WCPGSK_DOMAIN); ?></span>
     238                        </td>
     239                    </tr>
     240                    <tr>
     241                        <td width="25%"><?php _e( 'Blind Carbon Copy (BCC) Email Recipient', WCPGSK_DOMAIN ); ?></td>
     242                        <td>
     243                            <input name="wcpgsk_settings[email][wc_bcc_email]" id="wcpgsk_wc_bcc_email" type="email" value="<?php echo $options['email']['wc_bcc_email'] ?>" class="regular-text" />
     244                        </td>
     245                        <td>
     246                            <span class="description"><?php _e('Specify a valid email address that will receive hidden copies of all WooCommerce emails.', WCPGSK_DOMAIN); ?></span>
     247                        </td>
     248                    </tr>
     249                    <tr><td colspan="3"><?php _e('WooCommerce Rich Guys Swiss Knife includes more email options, e.g. context dependent cc and bcc email recipients, etc.', WCPGSK_DOMAIN); ?></td></tr>   
     250                </tbody>
     251                </table>
     252                <?php submit_button( __( 'Save Changes', WCPGSK_DOMAIN ) ); ?>
     253
     254            </div>
     255        <?php
     256        }
     257
     258        /**
     259         * Label configuration settings
     260         *
     261         * @since 1.9.7
     262         *
     263         * @access public
     264         * @param array $options
     265         */
     266        public function wcpgsk_page_labels( $options ) {
     267        ?>
     268            <h3 class="wcpgsk_acc_header"><?php echo __('Label Settings',WCPGSK_DOMAIN); ?></h3>
     269            <div>
     270                <table class="widefat" border="1" >
     271                <thead>
     272                    <tr>
     273                        <th><?php _e('Settings Name', WCPGSK_DOMAIN);  ?></th>
     274                        <th><?php _e('Data', WCPGSK_DOMAIN);  ?></th>       
     275                        <th><?php _e('Comments', WCPGSK_DOMAIN);  ?></th>
     276                    </tr>
     277                </thead>
     278                <tbody>
     279                    <?php do_action( 'wcpgsk_settings_labels_before', $options ); ?>
     280                    <tr>
     281                        <td width="25%"><?php _e( 'On Sale Label', WCPGSK_DOMAIN ); ?></td>
     282                        <td>
     283                            <input name="wcpgsk_settings[process][onsalelabel]" type="text" id="wcpgsk_onsalelabel" value="<?php echo $options['process']['onsalelabel'] ?>" class="regular-text" />
     284                        </td>
     285                        <td>
     286                            <span class="description"><?php _e('Define the on sale label. (You may need to adapt css!)', WCPGSK_DOMAIN); ?></span>
     287                        </td>
     288                    </tr>
     289                    <tr>
     290                        <td width="25%"><?php _e( 'Add to Cart Button Label', WCPGSK_DOMAIN ); ?></td>
     291                        <td>
     292                            <input name="wcpgsk_settings[process][fastcheckoutbtn]" type="text" id="wcpgsk_fastcheckout_btn" value="<?php echo $options['process']['fastcheckoutbtn'] ?>" class="regular-text" />
     293                        </td>
     294                        <td>
     295                            <span class="description"><?php _e('Define the label for the Add to Cart button.', WCPGSK_DOMAIN); ?></span>
     296                        </td>
     297                    </tr>
     298                    <tr>
     299                        <td width="25%"><?php _e( 'Read more Button Label', WCPGSK_DOMAIN ); ?></td>
     300                        <td>
     301                            <input name="wcpgsk_settings[process][readmorebtn]" type="text" id="wcpgsk_readmore_btn" value="<?php echo $options['process']['readmorebtn'] ?>" class="regular-text" />
     302                        </td>
     303                        <td>
     304                            <span class="description"><?php _e('Define the label for the Read more button.', WCPGSK_DOMAIN); ?></span>
     305                        </td>
     306                    </tr>
     307                    <tr>
     308                        <td width="25%"><?php _e( 'View products Button Label', WCPGSK_DOMAIN ); ?></td>
     309                        <td>
     310                            <input name="wcpgsk_settings[process][viewproductsbtn]" type="text" id="wcpgsk_viewproducts_btn" value="<?php echo $options['process']['viewproductsbtn'] ?>" class="regular-text" />
     311                        </td>
     312                        <td>
     313                            <span class="description"><?php _e('Define the label for the View products button.', WCPGSK_DOMAIN); ?></span>
     314                        </td>
     315                    </tr>
     316                    <tr>
     317                        <td width="25%"><?php _e( 'Select options Button Label', WCPGSK_DOMAIN ); ?></td>
     318                        <td>
     319                            <input name="wcpgsk_settings[process][selectoptionsbtn]" type="text" id="wcpgsk_selectoptions_btn" value="<?php echo $options['process']['selectoptionsbtn'] ?>" class="regular-text" />
     320                        </td>
     321                        <td>
     322                            <span class="description"><?php _e('Define the label for the Select options button.', WCPGSK_DOMAIN); ?></span>
     323                        </td>
     324                    </tr>
     325                    <tr>
     326                        <td width="25%"><?php _e( 'Buy product Button Label', WCPGSK_DOMAIN ); ?></td>
     327                        <td>
     328                            <input name="wcpgsk_settings[process][buyproductbtn]" type="text" id="wcpgsk_buyproduct_btn" value="<?php echo $options['process']['buyproductbtn'] ?>" class="regular-text" />
     329                        </td>
     330                        <td>
     331                            <span class="description"><?php _e('Define the label for the Buy product button.', WCPGSK_DOMAIN); ?></span>
     332                        </td>
     333                    </tr>
     334                    <tr>
     335                        <td width="25%"><?php _e( 'Out of stock Button Label', WCPGSK_DOMAIN ); ?></td>
     336                        <td>
     337                            <input name="wcpgsk_settings[process][outofstockbtn]" type="text" id="wcpgsk_outofstock_btn" value="<?php echo $options['process']['outofstockbtn'] ?>" class="regular-text" />
     338                        </td>
     339                        <td>
     340                            <span class="description"><?php _e('Define the label for the Out of stock button.', WCPGSK_DOMAIN); ?></span>
     341                        </td>
     342                    </tr>
     343                    <tr>
     344                        <td width="25%"><?php _e( 'Tax Label', WCPGSK_DOMAIN ); ?></td>
     345                        <td>
     346                            <input name="wcpgsk_settings[filters][woocommerce_countries_tax_or_vat]" type="text" id="wcpgsk_woocommerce_countries_tax_or_vat" value="<?php echo $options['filters']['woocommerce_countries_tax_or_vat'] ?>" class="regular-text" />
     347                        </td>
     348                        <td>
     349                            <span class="description"><?php _e('Define the tax label.', WCPGSK_DOMAIN); ?></span>
     350                        </td>
     351                    </tr>
     352                    <tr>
     353                        <td width="25%"><?php _e( 'Includes tax message', WCPGSK_DOMAIN ); ?></td>
     354                        <td>
     355                            <input name="wcpgsk_settings[filters][woocommerce_countries_inc_tax_or_vat]" type="text" id="wcpgsk_woocommerce_countries_inc_tax_or_vat" value="<?php echo $options['filters']['woocommerce_countries_inc_tax_or_vat'] ?>" class="regular-text" />
     356                        </td>
     357                        <td>
     358                            <span class="description"><?php _e('Define the tax included message.', WCPGSK_DOMAIN); ?></span>
     359                        </td>
     360                    </tr>
     361                    <tr>
     362                        <td width="25%"><?php _e( 'Tax excluded message', WCPGSK_DOMAIN ); ?></td>
     363                        <td>
     364                            <input name="wcpgsk_settings[filters][woocommerce_countries_ex_tax_or_vat]" type="text" id="wcpgsk_woocommerce_countries_ex_tax_or_vat" value="<?php echo $options['filters']['woocommerce_countries_ex_tax_or_vat'] ?>" class="regular-text" />
     365                        </td>
     366                        <td>
     367                            <span class="description"><?php _e('Define the tax excluded message.', WCPGSK_DOMAIN); ?></span>
     368                        </td>
     369                    </tr>
     370                    <tr>
     371                        <td width="25%"><?php _e( 'Product Description Tab Label', WCPGSK_DOMAIN ); ?></td>
     372                        <td>
     373                            <input name="wcpgsk_settings[filters][woocommerce_product_description_tab_title]" type="text" id="wcpgsk_woocommerce_product_description_tab_title" value="<?php echo $options['filters']['woocommerce_product_description_tab_title'] ?>" class="regular-text" />
     374                        </td>
     375                        <td>
     376                            <span class="description"><?php _e('Define the label for the product description tab.', WCPGSK_DOMAIN); ?></span>
     377                        </td>
     378                    </tr>
     379                    <tr>
     380                        <td width="25%"><?php _e( 'Product Description Header', WCPGSK_DOMAIN ); ?></td>
     381                        <td>
     382                            <input name="wcpgsk_settings[filters][woocommerce_product_description_heading]" type="text" id="wcpgsk_woocommerce_product_description_heading" value="<?php echo $options['filters']['woocommerce_product_description_heading'] ?>" class="regular-text" />
     383                        </td>
     384                        <td>
     385                            <span class="description"><?php _e('Define the product description header.', WCPGSK_DOMAIN); ?></span>
     386                        </td>
     387                    </tr>
     388                    <tr>
     389                        <td width="25%"><?php _e( 'Product Additional Information Tab Label', WCPGSK_DOMAIN ); ?></td>
     390                        <td>
     391                            <input name="wcpgsk_settings[filters][woocommerce_product_additional_information_tab_title]" type="text" id="wcpgsk_woocommerce_product_additional_information_tab_title" value="<?php echo $options['filters']['woocommerce_product_additional_information_tab_title'] ?>" class="regular-text" />
     392                        </td>
     393                        <td>
     394                            <span class="description"><?php _e('Define the label for the product additional information tab.', WCPGSK_DOMAIN); ?></span>
     395                        </td>
     396                    </tr>
     397                    <tr>
     398                        <td width="25%"><?php _e( 'Product Additional Information Header', WCPGSK_DOMAIN ); ?></td>
     399                        <td>
     400                            <input name="wcpgsk_settings[filters][woocommerce_product_additional_information_heading]" type="text" id="wcpgsk_woocommerce_product_additional_information_heading" value="<?php echo $options['filters']['woocommerce_product_additional_information_heading'] ?>" class="regular-text" />
     401                        </td>
     402                        <td>
     403                            <span class="description"><?php _e('Define the product additional information header.', WCPGSK_DOMAIN); ?></span>
     404                        </td>
     405                    </tr>
     406                    <tr>
     407                        <td><?php _e('Set Order Button Text', WCPGSK_DOMAIN); ?>:</td>
     408                        <td>
     409                            <input name="wcpgsk_settings[filters][woocommerce_order_button_text]" type="text" class="wcpgsk_textfield" value="<?php if (!empty($options['filters']['woocommerce_order_button_text'])) echo esc_attr( $options['filters']['woocommerce_order_button_text'] ); ?>" class="regular-text" />
     410                        </td>
     411                        <td>
     412                            <span class="description"><?php _e('Set the order button text.', WCPGSK_DOMAIN); ?></span>
     413                        </td>
     414                    </tr>
     415                    <tr>
     416                        <td><?php _e('Set Login required message', WCPGSK_DOMAIN); ?>:</td>
     417                        <td>
     418                            <input name="wcpgsk_settings[filters][woocommerce_checkout_must_be_logged_in_message]" type="text" class="wcpgsk_textfield" value="<?php if (!empty($options['filters']['woocommerce_checkout_must_be_logged_in_message'])) echo esc_attr( $options['filters']['woocommerce_checkout_must_be_logged_in_message'] ); ?>" class="regular-text" />
     419                        </td>
     420                        <td>
     421                            <span class="description"><?php _e('Change the login required message for the checkout form.', WCPGSK_DOMAIN); ?></span>
     422                        </td>
     423                    </tr>
     424                    <tr>
     425                        <td><?php _e('Set Login possible message', WCPGSK_DOMAIN); ?>:</td>
     426                        <td>
     427                            <input name="wcpgsk_settings[filters][woocommerce_checkout_login_message]" type="text" class="wcpgsk_textfield" value="<?php if (!empty($options['filters']['woocommerce_checkout_login_message'])) echo esc_attr( $options['filters']['woocommerce_checkout_login_message'] ); ?>" class="regular-text" />
     428                        </td>
     429                        <td>
     430                            <span class="description"><?php _e('Change the returning customer login message for the checkout form.', WCPGSK_DOMAIN); ?></span>
     431                        </td>
     432                    </tr>
     433                    <tr>
     434                        <td><?php _e('Set Coupon message', WCPGSK_DOMAIN); ?>:</td>
     435                        <td>
     436                            <input name="wcpgsk_settings[filters][woocommerce_checkout_coupon_message]" type="text" class="wcpgsk_textfield" value="<?php if (!empty($options['filters']['woocommerce_checkout_coupon_message'])) echo esc_attr( $options['filters']['woocommerce_checkout_coupon_message'] ); ?>" class="regular-text" />
     437                        </td>
     438                        <td>
     439                            <span class="description"><?php _e('Change the coupon message for the checkout form.', WCPGSK_DOMAIN); ?></span>
     440                        </td>
     441                    </tr>
     442                   
     443                    <?php do_action( 'wcpgsk_settings_labels_after', $options ); ?>                 
     444                </tbody>
     445                </table>
     446                <?php submit_button( __( 'Save Changes', WCPGSK_DOMAIN ) ); ?>
     447
     448            </div>
     449        <?php       
     450        }
     451       
    101452        /**
    102453         * Hook available and WCPGSK configured WooCommerce filters
     
    113464            endif;
    114465        }
     466       
     467       
     468       
    115469        /**
    116470         * Run available WooCommerce filters
     
    574928            $shipping_fields = $this->wcpgsk_additional_data($order, 'shipping');
    575929            ?>
    576             <table cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top;" border="0">
     930            <table cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top;" border="0" class="wcpgsk_customer_data">
    577931
    578932                <tr>
     
    580934                    if ( isset($billing_fields) && !empty($billing_fields) ) :
    581935                    ?>
    582                     <td valign="top" width="50%">
     936                    <td valign="top" width="50%" class="billing_data">
    583937
    584938                        <?php if ( !empty($options['checkoutform']['morebillingtitle']) ) : ?>
     
    586940                        <?php endif; ?>
    587941
    588                         <p>
     942                        <dl>
    589943                        <?php
    590                             //$billing_fields = $this->wcpgsk_additional_data($order, 'billing');
    591                             //if ( isset($billing_fields) && !empty($billing_fields) ) :
    592944                            foreach ($billing_fields as $key => $field) :
    593945                                $key_type = "billing_" . $key;
    594946                                $label = !empty($field['label']) ? $field['label'] . ": " : "";
    595                                 //if ( isset($options['woofields']['type_' . $key_type]) && $options['woofields']['type_' . $key_type] == 'fileupload' ) :
    596                                 //else :
    597                                 echo $label . $field['captured'] . '<br />';
    598                                 //endif;
     947                                if ( is_array( $field['captured'] ) ) :
     948                                    echo '<dt>' . $label . '</dt><dd>' . implode( '<br />', $field['captured'] ) . '</dd>';
     949                                else :
     950                                    echo '<dt>' . $label . '</dt><dd>' . $field['captured'] . '</dd>';
     951                                endif;
    599952                            endforeach;
    600                             //endif;
    601953                        ?>
    602                         </p>
     954                        </dl>
    603955
    604956                    </td>
     
    609961                    ?>
    610962
    611                     <td valign="top" width="50%">
     963                    <td valign="top" width="50%" class="shipping_data">
    612964                        <?php if ( !empty($options['checkoutform']['moreshippingtitle']) ) : ?>
    613965                        <h3><?php _e( $options['checkoutform']['moreshippingtitle'], 'woocommerce' ); ?></h3>
    614966                        <?php endif; ?>
    615967
    616                         <p>
     968                        <dl>
    617969                        <?php
    618970                            foreach ($shipping_fields as $key => $field) :
    619971                                $key_type = "shipping_" . $key;
    620972                                $label = !empty($field['label']) ? $field['label'] . ": " : "";
    621                                 //if ( isset($options['woofields']['type_' . $key_type]) && $options['woofields']['type_' . $key_type] == 'fileupload' ) :
    622                                 //else :
    623                                     echo $label . $field['captured'] . '<br />';
    624                                 //endif;
     973                                if ( is_array( $field['captured'] ) ) :
     974                                    echo '<dt>' . $label . '</dt><dd>' . implode( '<br />', $field['captured'] ) . '</dd>';
     975                                else :
     976                                    echo '<dt>' . $label . '</dt><dd>' . $field['captured'] . '</dd>';
     977                                endif;
    625978                            endforeach;
    626979                        ?>
    627                         </p>
     980                        </dl>
    628981
    629982                    </td>
     
    6541007                    if ( isset($billing_fields) && !empty($billing_fields) ) :
    6551008                    ?>
    656                     <td valign="top" width="50%">
     1009                    <td valign="top" width="50%" class="billing_data">
    6571010
    6581011                        <?php if ( !empty($options['checkoutform']['morebillingtitle']) ) : ?>
     
    6601013                        <?php endif; ?>
    6611014
    662                         <p>
     1015                        <dl>
    6631016                        <?php
    6641017                            //$billing_fields = $this->wcpgsk_additional_data($order, 'billing');
     
    6691022                                //if ( isset($options['woofields']['type_' . $key_type]) && $options['woofields']['type_' . $key_type] == 'fileupload' ) :
    6701023                                //else :
    671                                     echo $label . $field['captured'] . '<br />';
     1024                                    echo '<dt>' . $label . '</dt><dd>' . $field['captured'] . '</dd>';
    6721025                                //endif;
    6731026                            endforeach;
    6741027                            //endif;
    6751028                        ?>
    676                         </p>
     1029                        </dl>
    6771030
    6781031                    </td>
     
    6831036                    ?>
    6841037
    685                     <td valign="top" width="50%">
     1038                    <td valign="top" width="50%" class="shipping_data">
    6861039                        <?php if ( !empty($options['checkoutform']['moreshippingtitle']) ) : ?>
    6871040                        <h3><?php _e( $options['checkoutform']['moreshippingtitle'], 'woocommerce' ); ?></h3>
    6881041                        <?php endif; ?>
    689                         <p>
     1042                        <dl>
    6901043                        <?php
    6911044                            foreach ($shipping_fields as $key => $field) :
     
    6941047                                //if ( isset($options['woofields']['type_' . $key_type]) && $options['woofields']['type_' . $key_type] == 'fileupload' ) :
    6951048                                //else :
    696                                     echo $label . $field['captured'] . '<br />';
     1049                                    echo '<dt>' . $label . '</dt><dd>' . $field['captured'] . '</dd>';
    6971050                                //endif;
    6981051                            endforeach;
    6991052                        ?>
    700                         </p>
     1053                        </dl>
    7011054
    7021055                    </td>
     
    8361189                        $options['process']['selectoptionsbtn'] = isset($options['process']['selectoptionsbtn']) ? $options['process']['selectoptionsbtn'] : '';
    8371190                        $options['process']['outofstockbtn'] = isset($options['process']['outofstockbtn']) ? $options['process']['outofstockbtn'] : '';
     1191                        if ( !isset( $options['process']['onsalelabel'] ) ) :
     1192                            $options['process']['onsalelabel'] = __( 'Sale!', WCPGSK_DOMAIN );
     1193                        endif;
     1194                        if ( !isset( $options['process']['emptycartlabel'] ) ) :
     1195                            $options['process']['emptycartlabel'] = __( 'Empty cart?', WCPGSK_DOMAIN );
     1196                        endif;
     1197                        if ( !isset( $options['process']['confirmemptycart'] ) ) :
     1198                            $options['process']['confirmemptycart'] = __( 'Yes, empty cart', WCPGSK_DOMAIN );
     1199                        endif;
     1200                       
     1201                       
    8381202                        //add options if necessary
    8391203                        //unset( $options['filters'] );
     
    8721236                        </thead>
    8731237                        <tbody>
    874                             <?php do_action( 'wcpgsk_settings_shop_before', $options ); ?>
    875                             <tr>
    876                                 <td width="25%"><?php _e( 'Add to Cart Button Label', WCPGSK_DOMAIN ); ?></td>
    877                                 <td>
    878                                     <input name="wcpgsk_settings[process][fastcheckoutbtn]" id="wcpgsk_fastcheckout_btn" value="<?php echo $options['process']['fastcheckoutbtn'] ?>" class="regular-text" />
    879                                 </td>
    880                                 <td>
    881                                     <span class="description"><?php _e('Define the label for the Add to Cart button.', WCPGSK_DOMAIN); ?></span>
    882                                 </td>
    883                             </tr>
    884                             <tr>
    885                                 <td width="25%"><?php _e( 'Read more Button Label', WCPGSK_DOMAIN ); ?></td>
    886                                 <td>
    887                                     <input name="wcpgsk_settings[process][readmorebtn]" id="wcpgsk_readmore_btn" value="<?php echo $options['process']['readmorebtn'] ?>" class="regular-text" />
    888                                 </td>
    889                                 <td>
    890                                     <span class="description"><?php _e('Define the label for the Read more button.', WCPGSK_DOMAIN); ?></span>
    891                                 </td>
    892                             </tr>
    893                             <tr>
    894                                 <td width="25%"><?php _e( 'View products Button Label', WCPGSK_DOMAIN ); ?></td>
    895                                 <td>
    896                                     <input name="wcpgsk_settings[process][viewproductsbtn]" id="wcpgsk_viewproducts_btn" value="<?php echo $options['process']['viewproductsbtn'] ?>" class="regular-text" />
    897                                 </td>
    898                                 <td>
    899                                     <span class="description"><?php _e('Define the label for the View products button.', WCPGSK_DOMAIN); ?></span>
    900                                 </td>
    901                             </tr>
    902                             <tr>
    903                                 <td width="25%"><?php _e( 'Select options Button Label', WCPGSK_DOMAIN ); ?></td>
    904                                 <td>
    905                                     <input name="wcpgsk_settings[process][selectoptionsbtn]" id="wcpgsk_selectoptions_btn" value="<?php echo $options['process']['selectoptionsbtn'] ?>" class="regular-text" />
    906                                 </td>
    907                                 <td>
    908                                     <span class="description"><?php _e('Define the label for the Select options button.', WCPGSK_DOMAIN); ?></span>
    909                                 </td>
    910                             </tr>
    911                             <tr>
    912                                 <td width="25%"><?php _e( 'Buy product Button Label', WCPGSK_DOMAIN ); ?></td>
    913                                 <td>
    914                                     <input name="wcpgsk_settings[process][buyproductbtn]" id="wcpgsk_buyproduct_btn" value="<?php echo $options['process']['buyproductbtn'] ?>" class="regular-text" />
    915                                 </td>
    916                                 <td>
    917                                     <span class="description"><?php _e('Define the label for the Buy product button.', WCPGSK_DOMAIN); ?></span>
    918                                 </td>
    919                             </tr>
    920                             <tr>
    921                                 <td width="25%"><?php _e( 'Out of stock Button Label', WCPGSK_DOMAIN ); ?></td>
    922                                 <td>
    923                                     <input name="wcpgsk_settings[process][outofstockbtn]" id="wcpgsk_outofstock_btn" value="<?php echo $options['process']['outofstockbtn'] ?>" class="regular-text" />
    924                                 </td>
    925                                 <td>
    926                                     <span class="description"><?php _e('Define the label for the Out of stock button.', WCPGSK_DOMAIN); ?></span>
    927                                 </td>
    928                             </tr>
    929                             <tr>
    930                                 <td width="25%"><?php _e( 'Tax Label', WCPGSK_DOMAIN ); ?></td>
    931                                 <td>
    932                                     <input name="wcpgsk_settings[filters][woocommerce_countries_tax_or_vat]" id="wcpgsk_woocommerce_countries_tax_or_vat" value="<?php echo $options['filters']['woocommerce_countries_tax_or_vat'] ?>" class="regular-text" />
    933                                 </td>
    934                                 <td>
    935                                     <span class="description"><?php _e('Define the tax label.', WCPGSK_DOMAIN); ?></span>
    936                                 </td>
    937                             </tr>
    938                             <tr>
    939                                 <td width="25%"><?php _e( 'Includes tax message', WCPGSK_DOMAIN ); ?></td>
    940                                 <td>
    941                                     <input name="wcpgsk_settings[filters][woocommerce_countries_inc_tax_or_vat]" id="wcpgsk_woocommerce_countries_inc_tax_or_vat" value="<?php echo $options['filters']['woocommerce_countries_inc_tax_or_vat'] ?>" class="regular-text" />
    942                                 </td>
    943                                 <td>
    944                                     <span class="description"><?php _e('Define the tax included message.', WCPGSK_DOMAIN); ?></span>
    945                                 </td>
    946                             </tr>
    947                             <tr>
    948                                 <td width="25%"><?php _e( 'Tax excluded message', WCPGSK_DOMAIN ); ?></td>
    949                                 <td>
    950                                     <input name="wcpgsk_settings[filters][woocommerce_countries_ex_tax_or_vat]" id="wcpgsk_woocommerce_countries_ex_tax_or_vat" value="<?php echo $options['filters']['woocommerce_countries_ex_tax_or_vat'] ?>" class="regular-text" />
    951                                 </td>
    952                                 <td>
    953                                     <span class="description"><?php _e('Define the tax excluded message.', WCPGSK_DOMAIN); ?></span>
    954                                 </td>
    955                             </tr>
    956                             <tr>
    957                                 <td width="25%"><?php _e( 'Product Description Tab Label', WCPGSK_DOMAIN ); ?></td>
    958                                 <td>
    959                                     <input name="wcpgsk_settings[filters][woocommerce_product_description_tab_title]" id="wcpgsk_woocommerce_product_description_tab_title" value="<?php echo $options['filters']['woocommerce_product_description_tab_title'] ?>" class="regular-text" />
    960                                 </td>
    961                                 <td>
    962                                     <span class="description"><?php _e('Define the label for the product description tab.', WCPGSK_DOMAIN); ?></span>
    963                                 </td>
    964                             </tr>
    965                             <tr>
    966                                 <td width="25%"><?php _e( 'Product Description Header', WCPGSK_DOMAIN ); ?></td>
    967                                 <td>
    968                                     <input name="wcpgsk_settings[filters][woocommerce_product_description_heading]" id="wcpgsk_woocommerce_product_description_heading" value="<?php echo $options['filters']['woocommerce_product_description_heading'] ?>" class="regular-text" />
    969                                 </td>
    970                                 <td>
    971                                     <span class="description"><?php _e('Define the product description header.', WCPGSK_DOMAIN); ?></span>
    972                                 </td>
    973                             </tr>
    974                             <tr>
    975                                 <td width="25%"><?php _e( 'Product Additional Information Tab Label', WCPGSK_DOMAIN ); ?></td>
    976                                 <td>
    977                                     <input name="wcpgsk_settings[filters][woocommerce_product_additional_information_tab_title]" id="wcpgsk_woocommerce_product_additional_information_tab_title" value="<?php echo $options['filters']['woocommerce_product_additional_information_tab_title'] ?>" class="regular-text" />
    978                                 </td>
    979                                 <td>
    980                                     <span class="description"><?php _e('Define the label for the product additional information tab.', WCPGSK_DOMAIN); ?></span>
    981                                 </td>
    982                             </tr>
    983                             <tr>
    984                                 <td width="25%"><?php _e( 'Product Additional Information Header', WCPGSK_DOMAIN ); ?></td>
    985                                 <td>
    986                                     <input name="wcpgsk_settings[filters][woocommerce_product_additional_information_heading]" id="wcpgsk_woocommerce_product_additional_information_heading" value="<?php echo $options['filters']['woocommerce_product_additional_information_heading'] ?>" class="regular-text" />
    987                                 </td>
    988                                 <td>
    989                                     <span class="description"><?php _e('Define the product additional information header.', WCPGSK_DOMAIN); ?></span>
    990                                 </td>
    991                             </tr>
    9921238                            <tr>
    9931239                                <td><?php _e('Product items per page', WCPGSK_DOMAIN); ?>:</td>
    9941240                                <td>
    995                                     <input name="wcpgsk_settings[filters][loop_shop_per_page]" type="text" value="<?php if (isset($options['filters']['loop_shop_per_page'])) echo esc_attr( $options['filters']['loop_shop_per_page'] ); ?>" size="2" class="regular-text" />
     1241                                    <input name="wcpgsk_settings[filters][loop_shop_per_page]" type="number" value="<?php if (isset($options['filters']['loop_shop_per_page'])) echo esc_attr( $options['filters']['loop_shop_per_page'] ); ?>" size="3" class="regular-text" />
    9961242                                </td>
    9971243                                <td>
     
    10021248                                <td><?php _e('Product columns per page', WCPGSK_DOMAIN); ?>:</td>
    10031249                                <td>
    1004                                     <input name="wcpgsk_settings[filters][loop_shop_columns]" type="text" value="<?php if (isset($options['filters']['loop_shop_columns'])) echo esc_attr( $options['filters']['loop_shop_columns'] ); ?>" size="2" class="regular-text" />
     1250                                    <input name="wcpgsk_settings[filters][loop_shop_columns]" type="number" value="<?php if (isset($options['filters']['loop_shop_columns'])) echo esc_attr( $options['filters']['loop_shop_columns'] ); ?>" size="2" class="regular-text" />
    10051251                                </td>
    10061252                                <td>
     
    10111257                                <td><?php _e('Product thumbnail columns per page', WCPGSK_DOMAIN); ?>:</td>
    10121258                                <td>
    1013                                     <input name="wcpgsk_settings[filters][woocommerce_product_thumbnails_columns]" type="text" value="<?php if (isset($options['filters']['woocommerce_product_thumbnails_columns'])) echo esc_attr( $options['filters']['woocommerce_product_thumbnails_columns'] ); ?>" size="2" class="regular-text" />
     1259                                    <input name="wcpgsk_settings[filters][woocommerce_product_thumbnails_columns]" type="number" value="<?php if (isset($options['filters']['woocommerce_product_thumbnails_columns'])) echo esc_attr( $options['filters']['woocommerce_product_thumbnails_columns'] ); ?>" size="2" class="regular-text" />
    10141260                                </td>
    10151261                                <td>
     
    10551301                   
    10561302                    </div>
     1303                    <?php do_action( 'wcpgsk_settings_page_labels', $options ); ?>
     1304                    <?php do_action( 'wcpgsk_settings_page_email', $options ); ?>
    10571305                   
    10581306                    <?php do_action( 'wcpgsk_settings_page_two', $options ); ?>
     
    10701318                        <tbody>
    10711319                            <?php do_action( 'wcpgsk_settings_cart_before', $options ); ?>                         
     1320                            <tr>
     1321                                <td><?php _e('Add empty cart button to cart', WCPGSK_DOMAIN); ?>:</td>
     1322                                <td>
     1323                                    <input name="wcpgsk_settings[cart][addemptycart]" type="hidden" value="0" />
     1324                                    <input name="wcpgsk_settings[cart][addemptycart]" type="checkbox" value="1" <?php if (  1 == ($options['cart']['addemptycart'])) echo "checked='checked'"; ?> />
     1325                                </td>
     1326                                <td>
     1327                                    <span class="description"><?php _e('Allow your customers to empty the cart.', WCPGSK_DOMAIN); ?></span>
     1328                                </td>
     1329                            </tr>
     1330                            <tr>
     1331                                <td width="25%"><?php _e( 'Empty Cart Label', WCPGSK_DOMAIN ); ?></td>
     1332                                <td>
     1333                                    <input name="wcpgsk_settings[process][emptycartlabel]" type="text" id="wcpgsk_emptycartlabel" value="<?php echo isset( $options['process']['emptycartlabel'] ) ? $options['process']['emptycartlabel'] : ''; ?>" class="regular-text" />
     1334                                </td>
     1335                                <td>
     1336                                    <span class="description"><?php _e('Label for the empty cart button.', WCPGSK_DOMAIN); ?></span>
     1337                                </td>
     1338                            </tr>
     1339                            <tr>
     1340                                <td width="25%"><?php _e( 'Confirm Empty Cart Label', WCPGSK_DOMAIN ); ?></td>
     1341                                <td>
     1342                                    <input name="wcpgsk_settings[process][confirmemptycart]" type="text" id="wcpgsk_confirmemptycart" value="<?php echo isset( $options['process']['confirmemptycart'] ) ? $options['process']['confirmemptycart'] : ''; ?>" class="regular-text" />
     1343                                </td>
     1344                                <td>
     1345                                    <span class="description"><?php _e('Leave this blank to allow empty cart action without confirmation.', WCPGSK_DOMAIN); ?></span>
     1346                                </td>
     1347                            </tr>
     1348                           
    10721349                            <tr>
    10731350                                <td><?php _e('Minimum cart items', WCPGSK_DOMAIN); ?>:</td>
     
    11851462                                </td>
    11861463                            </tr>
    1187                            
    1188                         <?php   
     1464                        <?php
    11891465                            endforeach;
    11901466                        ?>
     1467                           
    11911468                        <?php do_action( 'wcpgsk_settings_cart_after', $options ); ?>
    11921469
     
    12241501                                <td>
    12251502                                    <span class="description"><?php _e('For date fields you can specify a maximum offset in number of days.', WCPGSK_DOMAIN); ?></span>
    1226                                 </td>
    1227                             </tr>
    1228                             <tr>
    1229                                 <td><?php _e('Set Order Button Text', WCPGSK_DOMAIN); ?>:</td>
    1230                                 <td>
    1231                                     <input name="wcpgsk_settings[filters][woocommerce_order_button_text]" type="text" class="wcpgsk_textfield" value="<?php if (!empty($options['filters']['woocommerce_order_button_text'])) echo esc_attr( $options['filters']['woocommerce_order_button_text'] ); ?>" class="regular-text" />
    1232                                 </td>
    1233                                 <td>
    1234                                     <span class="description"><?php _e('Set the order button text.', WCPGSK_DOMAIN); ?></span>
    1235                                 </td>
    1236                             </tr>
    1237                             <tr>
    1238                                 <td><?php _e('Set Login required message', WCPGSK_DOMAIN); ?>:</td>
    1239                                 <td>
    1240                                     <input name="wcpgsk_settings[filters][woocommerce_checkout_must_be_logged_in_message]" type="text" class="wcpgsk_textfield" value="<?php if (!empty($options['filters']['woocommerce_checkout_must_be_logged_in_message'])) echo esc_attr( $options['filters']['woocommerce_checkout_must_be_logged_in_message'] ); ?>" class="regular-text" />
    1241                                 </td>
    1242                                 <td>
    1243                                     <span class="description"><?php _e('Change the login required message for the checkout form.', WCPGSK_DOMAIN); ?></span>
    1244                                 </td>
    1245                             </tr>
    1246                             <tr>
    1247                                 <td><?php _e('Set Login possible message', WCPGSK_DOMAIN); ?>:</td>
    1248                                 <td>
    1249                                     <input name="wcpgsk_settings[filters][woocommerce_checkout_login_message]" type="text" class="wcpgsk_textfield" value="<?php if (!empty($options['filters']['woocommerce_checkout_login_message'])) echo esc_attr( $options['filters']['woocommerce_checkout_login_message'] ); ?>" class="regular-text" />
    1250                                 </td>
    1251                                 <td>
    1252                                     <span class="description"><?php _e('Change the returning customer login message for the checkout form.', WCPGSK_DOMAIN); ?></span>
    1253                                 </td>
    1254                             </tr>
    1255                             <tr>
    1256                                 <td><?php _e('Set Coupon message', WCPGSK_DOMAIN); ?>:</td>
    1257                                 <td>
    1258                                     <input name="wcpgsk_settings[filters][woocommerce_checkout_coupon_message]" type="text" class="wcpgsk_textfield" value="<?php if (!empty($options['filters']['woocommerce_checkout_coupon_message'])) echo esc_attr( $options['filters']['woocommerce_checkout_coupon_message'] ); ?>" class="regular-text" />
    1259                                 </td>
    1260                                 <td>
    1261                                     <span class="description"><?php _e('Change the coupon message for the checkout form.', WCPGSK_DOMAIN); ?></span>
    12621503                                </td>
    12631504                            </tr>
     
    25002741                else:
    25012742                    if ($key != 'billing_email_validator' && $field['hideorder'] == 0) :
    2502                         if ($options['woofields']['billing'][$key]['custom_' . $key]) :
     2743                        if ( isset( $options['woofields']['billing'][$key]['custom_' . $key] ) && $options['woofields']['billing'][$key]['custom_' . $key] ) :
    25032744                            $configField = $this->createCustomStandardField($key, 'billing', $options['woofields']['type_' . $key]);
    25042745                            if (isset($configField['class'])) unset($configField['class']);
     
    25782819                else:
    25792820                    if ($key != 'shipping_email_validator') :
    2580                         if ($options['woofields']['shipping'][$key]['custom_' . $key]) :
     2821                        if ( isset( $options['woofields']['shipping'][$key]['custom_' . $key] ) && $options['woofields']['shipping'][$key]['custom_' . $key] ) :
    25812822                            $configField = $this->createCustomStandardField($key, 'shipping', $options['woofields']['type_' . $key]);
    25822823                            //unset(configField['placeholder']);
     
    37323973                        'label'  => __( 'Label', WCPGSK_DOMAIN ),
    37333974                        'placeholder' => __( 'Placeholder', WCPGSK_DOMAIN ))),
    3734                     'cart' => array(
     3975                    'cart' => array(
     3976                        'addemptycart' => 0,
    37353977                        'minmaxstepproduct' => 0,
    37363978                        'minitemscart' => 1,
     
    37754017                        'fastcart' => 0,
    37764018                        'fastcheckout' => 0,
    3777                         'paymentgateways' => 0),
     4019                        'paymentgateways' => 0,
     4020                        'onsalelabel' => 'Sale!',
     4021                        'emptycartlabel' => 'Empty cart?',
     4022                        'confirmemptycart' => 'Yes, empty cart'),
     4023                    'email' => array(
     4024                        'wc_cc_email' => '',
     4025                        'wc_bcc_email' => ''),
    37784026                    );
    37794027                //add default woocommerce billing and shipping field settings to wcpgsk settings to fix the problem of fields not showing up after activation of our plugin
     
    38344082            if ( function_exists( 'is_woocommerce' ) ) :
    38354083                //dequeue scripts and styles
    3836                 if ( !is_cart() && !is_checkout() && !is_account_page() ) :
     4084                if ( is_cart() ) :
     4085                    wp_enqueue_script( 'wcpgsk-cart', plugins_url('/assets/js/wcpgsk-cart.js', $this->file) , array('jquery'), '', false);
    38374086                endif;
    38384087                if ( is_checkout() || is_account_page() ) :
  • woocommerce-poor-guys-swiss-knife/trunk/readme.txt

    r972884 r976205  
    22Contributors: ulih
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KJ4K2X953H8CC
    4 Tags: WooCommerce checkout manager, WooCommerce cart manager, quantity management, file upload, color picker, WooCommerce color picker, WooCommerce file upload, cart manager, checkout manager, checkout, cart, shop, WooCommerce, shop settings, cart settings, checkout settings, variations bulk manager, variations manager, minimum items, maximum items, quantity input, product quantities, incremental quantities, minimum quantity, maximum quantity, wholesale, checkout personalization, checkout form, checkout customization, custom forms, custom fields, confirmation, confirmation fields, cart button, payment gateways, payment gateways customization, gateways, shipping, field editor, field, buy, pay, bulk management, variations, variation extender, custom fields per product, custom fields per variation, checkout localization
     4Tags: WooCommerce checkout manager, WooCommerce cart manager, quantity management, file upload, color picker, WooCommerce color picker, WooCommerce file upload, cart manager, checkout manager, checkout, cart, shop, WooCommerce, shop settings, cart settings, checkout settings, variations bulk manager, variations manager, minimum items, maximum items, quantity input, product quantities, incremental quantities, minimum quantity, maximum quantity, wholesale, checkout personalization, checkout form, checkout customization, custom forms, custom fields, confirmation, confirmation fields, cart button, payment gateways, payment gateways customization, gateways, shipping, field editor, field, buy, pay, bulk management, variations, variation extender, custom fields per product, custom fields per variation, checkout localization, label, label definition, email recipients
    55Requires at least: Wordpress 3.1 and WooCommerce 2.0
    66Tested up to: 3.9.1
    7 Stable tag: 1.9.6
     7Stable tag: 1.9.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2222
    2323* WooCommerce Checkout form customization (works also for billing and shipping fields on the customer's "My Account" page)
    24 * Drag and Drop for all Checkout form fields to order all fields (WooCommerce build-in fields and your custom fields)
     24* Drag and Drop for all Checkout form fields to order all fields (WooCommerce built-in fields and your custom fields)
    2525* Support for all input types and data (select, checkbox, radio, text, textarea, date picker, time picker, number ranges, password, email) without restrictions
    2626* Full i18n support to allow localization and translation of all labels, placeholders
    27 * Remove WooCommerce build-in fields
     27* Remove WooCommerce built-in fields
    2828* Manage required state for all fields
    2929* Handle minimum and maximum calendar offset for date fields
    30 * Separate build-in billing and shipping fields from your own custom fields adding a custom title
    31 * Manage build-in and custom field alignment and span for each field (left, right, full)
    32 * Add second email validator field for build-in email field
    33 * Add second validator field to custom input fields for passwords, additional email inputs, etc.
     30* Separate built-in billing and shipping fields from your own custom fields adding a custom title
     31* Manage built-in and custom field alignment and span for each field (left, right, full)
     32* Add second email validator field for built-in email field
     33* Add second validator field to custom input fields for passwords, custom email fields, etc.
    3434* Hide captured data in emails and receipts on a per field basis
    3535* Load values and options into inputs and selects via custom javascript
     
    3838Localization:
    3939
    40 * Configure and handle behaviour of vital build in fields for enabled countries (checkout form reconfigures dynamically when customer switches billing or shipping country and this allows you to handle labels and placeholders for enabled countries)
     40* Configure and handle behaviour of vital built-in fields for enabled countries (checkout form reconfigures dynamically when customer switches billing or shipping country and this allows you to handle labels and placeholders for enabled countries)
    4141
    4242General:
    4343
    44 * Set labels for shop buttons (Add to Cart, Read more, Select options, tax, etc.)
     44* Set labels for shop buttons (Add to Cart, Read more, On Sale, Select options, tax, etc.)
    4545* Manage available payment gateways on a per product basis with intelligent filter to show the most restrictive combination when a customer has more than one product in his cart
    46 * Configure number of items on shop pages, etc.
    47 * Filter products to be displayed on main shop page
     46* Add one cc and one bcc email to all emails send by WooCommerce
    4847
    4948Cart:
     
    5352* Set minimum, maximum and incremental steps on a per product basis
    5453* Switch off quantity input for product types
     54* Add empty cart button with/without confirmation
    5555
    5656= Features available with WooCommerce Rich Guys Swiss Knife (WCRGSK) =
     
    6565* Html injects (Add whatever you want in between your checkout form fields)
    6666* Color picker field
    67 * Acceptable terms and conditions on per product basis
     67* Acceptable terms and conditions on per product basis in checkout form
    6868* File uploads for checkout form sections and on a per product basis
    69 * Product terms and conditions
    7069* Advanced quantity and backorder management for products and variations
     70* Filter products to be displayed on main shop page
     71* Advanced email management to add more email recipients for specific contexts like new order, processing order, out of stock, backorder, etc.
     72* Set minimum amount and maximum amount needed or necessary to checkout a cart
    7173
    7274Data captured via customized (added) form fields is available within your order administration and will be added in the appropriate sections of the individual orders. What shows up can be configured for each individual custom field. Data captured will be shown to the customer on the order receipt page and in emails.
     
    7880= What's new? =
    7981   
    80 * Product display filters for main shop page
     82* Add one CC and/or BCC email recipient to all WooCommerce emails
    8183* Global minimum and maximum for item quantities
    8284* Year and month dropdown selection for calendars
    8385* Improved min/max/step settings with support for 0 for quantity inputs in all contexts
     86* Stylable representation of captured data
    8487
    8588= What's on its way? =
    8689
    87 Priceable fields for products and variations
     90* Priceable fields for products and variations will be available with version 1.5.0 of Woocommerce Rich Guys Swiss Knife
     91* Woocommerce Poor Guys Swiss Knife will include a package as gift along with gift text as appetizer
    8892
    8993== Usage ==
     
    9195= Shop Settings =
    9296
    93 * Set cart button label
    9497* Enable Fast Cart (show cart after a customer added something to the cart in the shop. Also available in WooCommerce)
    9598* Enable Fast Checkout (go directly to checkout, when a customer adds a product from the shop)
     
    97100* Filter products to be displayed on main shop page based on categories and attributes
    98101
     102= Label Settings =
     103
     104* Set cart button labels
     105* Set order button label
     106* Set product button labels
     107* Set on sale label
     108* And a lot more labels
    99109
    100110= Variation Overload and Bulk Settings =
     
    173183More Tools for your WooCommerce Swiss Knife are available with the Rich Guys Swiss Knife for WooCommerce:
    174184
     185*
    175186* Item personalization during checkout
    176187* Custom fields on a per product and per variation basis using Item personalization options
    177188* Bulk operations for variations
    178189* Variation Extender which allows to attach virtual variations meaningful to customers and to map these variations back to a more reduced set of internal variations. This allows you to overcome the resource (runtime) and management limits that most e-commerce stores show in the context of variable products.
    179 * File upload
     190* File upload (single and multiple)
     191* Html inject for checkout form
    180192* Color picker support for fields
    181193* Advanced (conditional) quantity input and backorder management for products and variations
     194* Advanced email handling: More than one cc and bcc email; specify contexts in which to use cc and bcc emails
    182195
    183196== Upgrade Notice ==
     
    246259 
    247260== Changelog ==
     261
     262= 1.9.7 =
     263
     264* Enhancement: Structured presentation of captured data in order-received page and email
     265* Enhancement: Add one CC and/or BCC email to all emails send out by WooCommerce
     266* Enhancement: Add empty cart button to cart
    248267
    249268= 1.9.6 =
  • woocommerce-poor-guys-swiss-knife/trunk/wcpgsk-af.php

    r972884 r976205  
    822822if ( !function_exists('wcpgsk_after_checkout_form') ) {
    823823function wcpgsk_after_checkout_form($checkout) {
    824     ?>
    825     <div id="wcpgsk-dialog-validation-errors" title="<?php _e('Validation errors' , WCPGSK_DOMAIN); ?>">
    826         <p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span><?php _e('Please check the fields marked with a red border. The values do not pass validation.' , WCPGSK_DOMAIN); ?></p>       
    827     </div>
    828     <?php
    829     $options = get_option( 'wcpgsk_settings' );
    830 
    831    
    832     echo '<script language="javascript">';
    833 
    834     echo 'jQuery(document).ready(function(){
    835             jQuery("#cartitemfields").tabs();
    836             var cT = "' . __('Close', WCPGSK_DOMAIN) . '";
    837             var pT = "' . __('<Prev', WCPGSK_DOMAIN) . '";
    838             var nT = "' . __('Next>', WCPGSK_DOMAIN) . '";
    839             var cTT = "' . __('Now', WCPGSK_DOMAIN) . '";
    840             var cTD = "' . __('Today', WCPGSK_DOMAIN) . '";
    841            
    842             var mN = ["' . __('January', WCPGSK_DOMAIN) . '",
    843                 "' . __('February', WCPGSK_DOMAIN) . '",
    844                 "' . __('March', WCPGSK_DOMAIN) . '",
    845                 "' . __('April', WCPGSK_DOMAIN) . '",
    846                 "' . __('May', WCPGSK_DOMAIN) . '",
    847                 "' . __('June', WCPGSK_DOMAIN) . '",
    848                 "' . __('July', WCPGSK_DOMAIN) . '",
    849                 "' . __('August', WCPGSK_DOMAIN) . '",
    850                 "' . __('September', WCPGSK_DOMAIN) . '",
    851                 "' . __('October', WCPGSK_DOMAIN) . '",
    852                 "' . __('November', WCPGSK_DOMAIN) . '",
    853                 "' . __('December', WCPGSK_DOMAIN) . '"];
    854 
    855             var mNS = ["' . __('Jan', WCPGSK_DOMAIN) . '",
    856                 "' . __('Feb', WCPGSK_DOMAIN) . '",
    857                 "' . __('Mar', WCPGSK_DOMAIN) . '",
    858                 "' . __('Apr', WCPGSK_DOMAIN) . '",
    859                 "' . __('May', WCPGSK_DOMAIN) . '",
    860                 "' . __('Jun', WCPGSK_DOMAIN) . '",
    861                 "' . __('Jul', WCPGSK_DOMAIN) . '",
    862                 "' . __('Aug', WCPGSK_DOMAIN) . '",
    863                 "' . __('Sep', WCPGSK_DOMAIN) . '",
    864                 "' . __('Oct', WCPGSK_DOMAIN) . '",
    865                 "' . __('Nov', WCPGSK_DOMAIN) . '",
    866                 "' . __('Dec', WCPGSK_DOMAIN) . '"];
    867 
    868             var dN = ["' . __('Sunday', WCPGSK_DOMAIN) . '",
    869                 "' . __('Monday', WCPGSK_DOMAIN) . '",
    870                 "' . __('Tuesday', WCPGSK_DOMAIN) . '",
    871                 "' . __('Wednesday', WCPGSK_DOMAIN) . '",
    872                 "' . __('Thursday', WCPGSK_DOMAIN) . '",
    873                 "' . __('Friday', WCPGSK_DOMAIN) . '",
    874                 "' . __('Saturday', WCPGSK_DOMAIN) . '"];
    875 
    876             var dNS = ["' . __('Sun', WCPGSK_DOMAIN) . '",
    877                 "' . __('Mon', WCPGSK_DOMAIN) . '",
    878                 "' . __('Tue', WCPGSK_DOMAIN) . '",
    879                 "' . __('Wed', WCPGSK_DOMAIN) . '",
    880                 "' . __('Thu', WCPGSK_DOMAIN) . '",
    881                 "' . __('Fri', WCPGSK_DOMAIN) . '",
    882                 "' . __('Sat', WCPGSK_DOMAIN) . '"];
    883            
    884 
    885 
    886             jQuery("input[display=\'date\']").each(function(i, cal) {
    887                 var minD = "' . $options['checkoutform']['mindate'] . '";
    888                 var maxD = "' . $options['checkoutform']['maxdate'] . '";
    889                 if (jQuery(this).attr("mindays")) minD = jQuery(this).attr("mindays");
    890                 if (jQuery(this).attr("maxdays")) maxD = jQuery(this).attr("maxdays");
     824    if ( is_checkout() || is_account_page() ) :
     825        ?>
     826        <div id="wcpgsk-dialog-validation-errors" title="<?php _e('Validation errors' , WCPGSK_DOMAIN); ?>">
     827            <p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span><?php _e('Please check the fields marked with a red border. The values do not pass validation.' , WCPGSK_DOMAIN); ?></p>       
     828        </div>
     829        <?php
     830        $options = get_option( 'wcpgsk_settings' );
     831
     832       
     833        echo '<script language="javascript">';
     834
     835        echo 'jQuery(document).ready(function(){
     836                jQuery("#cartitemfields").tabs();
     837                var cT = "' . __('Close', WCPGSK_DOMAIN) . '";
     838                var pT = "' . __('<Prev', WCPGSK_DOMAIN) . '";
     839                var nT = "' . __('Next>', WCPGSK_DOMAIN) . '";
     840                var cTT = "' . __('Now', WCPGSK_DOMAIN) . '";
     841                var cTD = "' . __('Today', WCPGSK_DOMAIN) . '";
    891842               
    892                 var dateF = "dd/mm/yy";
    893                 if (jQuery(this).attr("dateformat")) dateF = jQuery(this).attr("dateformat");
    894                 var exDays = "";
    895                 var exDates = "";
    896                 var exWeekend = "0";
    897                 if (jQuery(this).attr("daysexcluded")) exDays = jQuery(this).attr("daysexcluded");
    898                 if (jQuery(this).attr("datesexcluded")) exDates = jQuery(this).attr("datesexcluded");
    899                 if (jQuery(this).attr("exweekend")) exWeekend = jQuery(this).attr("exweekend");
    900 
    901 
    902                 if ( exDays != null && exDays != "" ) exDays = jQuery.map(exDays.split(","), jQuery.trim);
    903                 if ( exDates != null && exDates != "" ) exDates = jQuery.map(exDates.split(","), jQuery.trim);
    904                 jQuery(this).datepicker({
    905                     changeMonth: true,
    906                     changeYear: true,
    907                     yearRange: "-100:+100",
    908                      beforeShow: function() {
    909                        if ((selDate = jQuery(this).val()).length > 0)
    910                        {
    911                           iYear = selDate.substring(selDate.length - 4, selDate.length);
    912                           iMonth = jQuery.inArray(selDate.substring(0, selDate.length - 5),
    913                                    jQuery(this).datepicker("option", "monthNames"));
    914                           jQuery(this).datepicker("option", "defaultDate", new Date(iYear, iMonth, 1));
    915                           jQuery(this).datepicker("setDate", new Date(iYear, iMonth, 1));
    916                        }
    917                     },                 
    918                     beforeShowDay: function(date) {
    919                         show = true;
    920                         if ( exWeekend == "1" ) {
    921                             show = jQuery.datepicker.noWeekends(date)[0];
    922                         }
    923                         if ( show && exDays != null && exDays != "" && exDays.length > 0 ) {
    924                            
    925                             if ( jQuery.inArray( date.getDay().toString(), exDays ) !== -1 ) show = false;
    926                         }
    927                         if ( show && exDates != null && exDates != "" && exDates.length > 0 ) {
    928                             checkDate = jQuery.datepicker.formatDate(dateF, date);
    929                             if ( jQuery.inArray( checkDate.toString(), exDates ) !== -1 ) show = false;
    930                         }
    931                         return [show, "", (!show) ? "' . __('Date excluded', WCPGSK_DOMAIN) . '" : ""];
    932                     },
    933                     dateFormat: dateF,
    934                     minDate: minD,
    935                     maxDate: maxD,
    936                     dayNamesShort: dNS,
    937                     dayNames: dN,
    938                     monthNamesShort: mNS,
    939                     monthNames: mN,             
    940                     closeText: cT,
    941                     prevText: pT,
    942                     nextText: nT,
    943                     currentText: cTD,
    944                     firstDay: 1
    945                 });     
    946             });
    947 
    948             jQuery("input[display=\'time\']").each(function() {
    949                 var hMax = 23;
    950                 var hMin = 0;
    951                 if (jQuery(this).attr("maxhour")) hMax = parseInt(jQuery(this).attr("maxhour"));
    952                 if (jQuery(this).attr("minhour")) hMin = parseInt(jQuery(this).attr("minhour"));
     843                var mN = ["' . __('January', WCPGSK_DOMAIN) . '",
     844                    "' . __('February', WCPGSK_DOMAIN) . '",
     845                    "' . __('March', WCPGSK_DOMAIN) . '",
     846                    "' . __('April', WCPGSK_DOMAIN) . '",
     847                    "' . __('May', WCPGSK_DOMAIN) . '",
     848                    "' . __('June', WCPGSK_DOMAIN) . '",
     849                    "' . __('July', WCPGSK_DOMAIN) . '",
     850                    "' . __('August', WCPGSK_DOMAIN) . '",
     851                    "' . __('September', WCPGSK_DOMAIN) . '",
     852                    "' . __('October', WCPGSK_DOMAIN) . '",
     853                    "' . __('November', WCPGSK_DOMAIN) . '",
     854                    "' . __('December', WCPGSK_DOMAIN) . '"];
     855
     856                var mNS = ["' . __('Jan', WCPGSK_DOMAIN) . '",
     857                    "' . __('Feb', WCPGSK_DOMAIN) . '",
     858                    "' . __('Mar', WCPGSK_DOMAIN) . '",
     859                    "' . __('Apr', WCPGSK_DOMAIN) . '",
     860                    "' . __('May', WCPGSK_DOMAIN) . '",
     861                    "' . __('Jun', WCPGSK_DOMAIN) . '",
     862                    "' . __('Jul', WCPGSK_DOMAIN) . '",
     863                    "' . __('Aug', WCPGSK_DOMAIN) . '",
     864                    "' . __('Sep', WCPGSK_DOMAIN) . '",
     865                    "' . __('Oct', WCPGSK_DOMAIN) . '",
     866                    "' . __('Nov', WCPGSK_DOMAIN) . '",
     867                    "' . __('Dec', WCPGSK_DOMAIN) . '"];
     868
     869                var dN = ["' . __('Sunday', WCPGSK_DOMAIN) . '",
     870                    "' . __('Monday', WCPGSK_DOMAIN) . '",
     871                    "' . __('Tuesday', WCPGSK_DOMAIN) . '",
     872                    "' . __('Wednesday', WCPGSK_DOMAIN) . '",
     873                    "' . __('Thursday', WCPGSK_DOMAIN) . '",
     874                    "' . __('Friday', WCPGSK_DOMAIN) . '",
     875                    "' . __('Saturday', WCPGSK_DOMAIN) . '"];
     876
     877                var dNS = ["' . __('Sun', WCPGSK_DOMAIN) . '",
     878                    "' . __('Mon', WCPGSK_DOMAIN) . '",
     879                    "' . __('Tue', WCPGSK_DOMAIN) . '",
     880                    "' . __('Wed', WCPGSK_DOMAIN) . '",
     881                    "' . __('Thu', WCPGSK_DOMAIN) . '",
     882                    "' . __('Fri', WCPGSK_DOMAIN) . '",
     883                    "' . __('Sat', WCPGSK_DOMAIN) . '"];
    953884               
    954                 jQuery(this).timepicker({
    955                     timeFormat: "HH:mm",
    956                     hourMax: hMax,
    957                     hourMin: hMin,
    958                     stepHour: parseInt(jQuery(this).attr("hoursteps")),
    959                     stepMinute: parseInt(jQuery(this).attr("minutesteps")),
    960                     addSliderAccess: true,
    961                     sliderAccessArgs: { touchonly: false },
    962                     timeText: "' . __('Time', WCPGSK_DOMAIN) . '",
    963                     hourText: "' . __('Hour', WCPGSK_DOMAIN) . '",
    964                     minuteText: "' . __('Minute', WCPGSK_DOMAIN) . '",
    965                     currentText: cTT,
    966                     closeText: cT,
    967                     timeOnlyTitle: "' . __('Choose Time', WCPGSK_DOMAIN) . '"
    968                 });     
    969             });
    970 
    971             jQuery("input[display=\'number\']").each(function() {
    972                 var $this = this;
    973                 jQuery(this).after("<div id=\'slider_" + jQuery(this).attr("id") + "\'></div>");
    974 
    975                 if (jQuery($this).attr("numpres") == "true") {
    976                     jQuery("#slider_" + jQuery($this).attr("id")).slider({
    977                         range: true,
    978                         min: parseInt(jQuery($this).attr("minvalue")),
    979                         max: parseInt(jQuery($this).attr("maxvalue")),
    980                         step: parseInt(jQuery($this).attr("numstep")),
    981                         values: [ parseInt(jQuery($this).val()), parseInt(jQuery($this).attr("rangemax")) ],
    982                         slide: function( event, ui ) {
    983                             jQuery( $this ).val( ui.values[0] + " - " +  ui.values[1]);
    984                         }       
    985                     });
    986                 }
    987                 else {
    988                     jQuery("#slider_" + jQuery($this).attr("id")).slider({
    989                         range: jQuery($this).attr("numpres"),
    990                         min: parseInt(jQuery($this).attr("minvalue")),
    991                         max: parseInt(jQuery($this).attr("maxvalue")),
    992                         step: parseInt(jQuery($this).attr("numstep")),
    993                         value: parseInt(jQuery($this).val()),
    994                         slide: function( event, ui ) {
    995                             jQuery( $this ).val( ui.value );
    996                         }       
    997                     }).sliderAccess({ touchonly : false });
    998                 }
    999             });
    1000    
    1001             jQuery("select[presentation=\'radio\']").each(function(i, select){
    1002                 var $select = jQuery(select);
    1003                 $select.find("option").each(function(j, option){
    1004                     var $option = jQuery(option);
    1005                     // Create a radio:
    1006                     if ($option.val() != null && $option.val() != "") {
    1007                         var $radio = jQuery("<input type=\'radio\' />");
    1008                         // Set name and value:
    1009                         $radio.attr("name", $select.attr("name")).attr("value", $option.val()).attr("class", "radio").attr("style","width:10%");
    1010                         // Set checked if the option was selected
    1011                         if ($option.attr("selected") != null && $option.attr("selected") == "selected" && $select.attr("hasselected") != null && $select.attr("hasselected") == "true" ) $radio.attr("checked", "checked");
    1012                         //$radio.text($option.text());
    1013                         // Insert radio before select box:
    1014                         $select.before($radio);
    1015                         // Insert a label:
    1016                         $select.before(
    1017                           jQuery("<span />").attr("for", $select.attr("name")).text($option.text())
    1018                         );
    1019                         // Insert a <br />:
    1020                         $select.before("<br/>");
     885
     886
     887                jQuery("input[display=\'date\']").each(function(i, cal) {
     888                    var minD = "' . $options['checkoutform']['mindate'] . '";
     889                    var maxD = "' . $options['checkoutform']['maxdate'] . '";
     890                    if (jQuery(this).attr("mindays")) minD = jQuery(this).attr("mindays");
     891                    if (jQuery(this).attr("maxdays")) maxD = jQuery(this).attr("maxdays");
     892                   
     893                    var dateF = "dd/mm/yy";
     894                    if (jQuery(this).attr("dateformat")) dateF = jQuery(this).attr("dateformat");
     895                    var exDays = "";
     896                    var exDates = "";
     897                    var exWeekend = "0";
     898                    if (jQuery(this).attr("daysexcluded")) exDays = jQuery(this).attr("daysexcluded");
     899                    if (jQuery(this).attr("datesexcluded")) exDates = jQuery(this).attr("datesexcluded");
     900                    if (jQuery(this).attr("exweekend")) exWeekend = jQuery(this).attr("exweekend");
     901
     902
     903                    if ( exDays != null && exDays != "" ) exDays = jQuery.map(exDays.split(","), jQuery.trim);
     904                    if ( exDates != null && exDates != "" ) exDates = jQuery.map(exDates.split(","), jQuery.trim);
     905                    jQuery(this).datepicker({
     906                        changeMonth: true,
     907                        changeYear: true,
     908                        yearRange: "-100:+100",
     909                         beforeShow: function() {
     910                           if ((selDate = jQuery(this).val()).length > 0)
     911                           {
     912                              iYear = selDate.substring(selDate.length - 4, selDate.length);
     913                              iMonth = jQuery.inArray(selDate.substring(0, selDate.length - 5),
     914                                       jQuery(this).datepicker("option", "monthNames"));
     915                              jQuery(this).datepicker("option", "defaultDate", new Date(iYear, iMonth, 1));
     916                              jQuery(this).datepicker("setDate", new Date(iYear, iMonth, 1));
     917                           }
     918                        },                 
     919                        beforeShowDay: function(date) {
     920                            show = true;
     921                            if ( exWeekend == "1" ) {
     922                                show = jQuery.datepicker.noWeekends(date)[0];
     923                            }
     924                            if ( show && exDays != null && exDays != "" && exDays.length > 0 ) {
     925                               
     926                                if ( jQuery.inArray( date.getDay().toString(), exDays ) !== -1 ) show = false;
     927                            }
     928                            if ( show && exDates != null && exDates != "" && exDates.length > 0 ) {
     929                                checkDate = jQuery.datepicker.formatDate(dateF, date);
     930                                if ( jQuery.inArray( checkDate.toString(), exDates ) !== -1 ) show = false;
     931                            }
     932                            return [show, "", (!show) ? "' . __('Date excluded', WCPGSK_DOMAIN) . '" : ""];
     933                        },
     934                        dateFormat: dateF,
     935                        minDate: minD,
     936                        maxDate: maxD,
     937                        dayNamesShort: dNS,
     938                        dayNames: dN,
     939                        monthNamesShort: mNS,
     940                        monthNames: mN,             
     941                        closeText: cT,
     942                        prevText: pT,
     943                        nextText: nT,
     944                        currentText: cTD,
     945                        firstDay: 1
     946                    });     
     947                });
     948
     949                jQuery("input[display=\'time\']").each(function() {
     950                    var hMax = 23;
     951                    var hMin = 0;
     952                    if (jQuery(this).attr("maxhour")) hMax = parseInt(jQuery(this).attr("maxhour"));
     953                    if (jQuery(this).attr("minhour")) hMin = parseInt(jQuery(this).attr("minhour"));
     954                   
     955                    jQuery(this).timepicker({
     956                        timeFormat: "HH:mm",
     957                        hourMax: hMax,
     958                        hourMin: hMin,
     959                        stepHour: parseInt(jQuery(this).attr("hoursteps")),
     960                        stepMinute: parseInt(jQuery(this).attr("minutesteps")),
     961                        addSliderAccess: true,
     962                        sliderAccessArgs: { touchonly: false },
     963                        timeText: "' . __('Time', WCPGSK_DOMAIN) . '",
     964                        hourText: "' . __('Hour', WCPGSK_DOMAIN) . '",
     965                        minuteText: "' . __('Minute', WCPGSK_DOMAIN) . '",
     966                        currentText: cTT,
     967                        closeText: cT,
     968                        timeOnlyTitle: "' . __('Choose Time', WCPGSK_DOMAIN) . '"
     969                    });     
     970                });
     971
     972                jQuery("input[display=\'number\']").each(function() {
     973                    var $this = this;
     974                    jQuery(this).after("<div id=\'slider_" + jQuery(this).attr("id") + "\'></div>");
     975
     976                    if (jQuery($this).attr("numpres") == "true") {
     977                        jQuery("#slider_" + jQuery($this).attr("id")).slider({
     978                            range: true,
     979                            min: parseInt(jQuery($this).attr("minvalue")),
     980                            max: parseInt(jQuery($this).attr("maxvalue")),
     981                            step: parseInt(jQuery($this).attr("numstep")),
     982                            values: [ parseInt(jQuery($this).val()), parseInt(jQuery($this).attr("rangemax")) ],
     983                            slide: function( event, ui ) {
     984                                jQuery( $this ).val( ui.values[0] + " - " +  ui.values[1]);
     985                            }       
     986                        });
     987                    }
     988                    else {
     989                        jQuery("#slider_" + jQuery($this).attr("id")).slider({
     990                            range: jQuery($this).attr("numpres"),
     991                            min: parseInt(jQuery($this).attr("minvalue")),
     992                            max: parseInt(jQuery($this).attr("maxvalue")),
     993                            step: parseInt(jQuery($this).attr("numstep")),
     994                            value: parseInt(jQuery($this).val()),
     995                            slide: function( event, ui ) {
     996                                jQuery( $this ).val( ui.value );
     997                            }       
     998                        }).sliderAccess({ touchonly : false });
    1021999                    }
    10221000                });
    1023                 $select.remove();
     1001       
     1002                jQuery("select[presentation=\'radio\']").each(function(i, select){
     1003                    var $select = jQuery(select);
     1004                    $select.find("option").each(function(j, option){
     1005                        var $option = jQuery(option);
     1006                        // Create a radio:
     1007                        if ($option.val() != null && $option.val() != "") {
     1008                            var $radio = jQuery("<input type=\'radio\' />");
     1009                            // Set name and value:
     1010                            $radio.attr("name", $select.attr("name")).attr("value", $option.val()).attr("class", "radio").attr("style","width:10%");
     1011                            // Set checked if the option was selected
     1012                            if ($option.attr("selected") != null && $option.attr("selected") == "selected" && $select.attr("hasselected") != null && $select.attr("hasselected") == "true" ) $radio.attr("checked", "checked");
     1013                            //$radio.text($option.text());
     1014                            // Insert radio before select box:
     1015                            $select.before($radio);
     1016                            // Insert a label:
     1017                            $select.before(
     1018                              jQuery("<span />").attr("for", $select.attr("name")).text($option.text())
     1019                            );
     1020                            // Insert a <br />:
     1021                            $select.before("<br/>");
     1022                        }
     1023                    });
     1024                    $select.remove();
     1025                });
     1026               
     1027                jQuery("select[presentation=\'checkbox\']").each(function(i, select){
     1028                    var $select = jQuery(select);
     1029                    $select.find("option").each(function(j, option){
     1030                        var $option = jQuery(option);
     1031                        // Create a radio:
     1032                        if ($option.val() != null && $option.val() != "") {
     1033                            var $radio = jQuery("<input type=\'checkbox\' />");
     1034                            // Set name and value:
     1035                            $radio.attr("name", $select.attr("name") + "[" + j + "]").attr("value", $option.val()).attr("class", "checkbox").attr("style","width:10%");
     1036                            // Set checked if the option was selected
     1037                            if ($option.attr("selected") != null && $option.attr("selected") == "selected" && $select.attr("hasselected") != null && $select.attr("hasselected") == "true" ) $radio.attr("checked", "checked");
     1038                            //$radio.text($option.text());
     1039                            // Insert radio before select box:
     1040                            $select.before($radio);
     1041                            // Insert a label:
     1042                            $select.before(
     1043                              jQuery("<span />").attr("for", $select.attr("name")).text($option.text())
     1044                            );
     1045                            $select.before("<br/>");
     1046                        }
     1047                    });
     1048                    $select.remove();
     1049                });
     1050                jQuery("select[multiple=\'multiple\']").each(function(i, select){
     1051                    var $select = jQuery(select);
     1052                    $select.attr("name", $select.attr("name") + "[]");
     1053                });
     1054               
    10241055            });
    1025            
    1026             jQuery("select[presentation=\'checkbox\']").each(function(i, select){
    1027                 var $select = jQuery(select);
    1028                 $select.find("option").each(function(j, option){
    1029                     var $option = jQuery(option);
    1030                     // Create a radio:
    1031                     if ($option.val() != null && $option.val() != "") {
    1032                         var $radio = jQuery("<input type=\'checkbox\' />");
    1033                         // Set name and value:
    1034                         $radio.attr("name", $select.attr("name") + "[" + j + "]").attr("value", $option.val()).attr("class", "checkbox").attr("style","width:10%");
    1035                         // Set checked if the option was selected
    1036                         if ($option.attr("selected") != null && $option.attr("selected") == "selected" && $select.attr("hasselected") != null && $select.attr("hasselected") == "true" ) $radio.attr("checked", "checked");
    1037                         //$radio.text($option.text());
    1038                         // Insert radio before select box:
    1039                         $select.before($radio);
    1040                         // Insert a label:
    1041                         $select.before(
    1042                           jQuery("<span />").attr("for", $select.attr("name")).text($option.text())
    1043                         );
    1044                         $select.before("<br/>");
    1045                     }
    1046                 });
    1047                 $select.remove();
    1048             });
    1049             jQuery("select[multiple=\'multiple\']").each(function(i, select){
    1050                 var $select = jQuery(select);
    1051                 $select.attr("name", $select.attr("name") + "[]");
    1052             });
    1053            
    1054         });
    1055     </script><!--unit test after checkout end-->';
    1056     //load our user scripts from db...
    1057     $wcpgsk_checkoutjs = get_option('wcpgsk_checkoutjs');
    1058     if ( !empty($wcpgsk_checkoutjs) ) :
    1059         echo '<script language="javascript">';
    1060         echo $wcpgsk_checkoutjs;
    1061         echo '</script>';
    1062     endif;
    1063    
     1056        </script><!--unit test after checkout end-->';
     1057        //load our user scripts from db...
     1058        $wcpgsk_checkoutjs = get_option('wcpgsk_checkoutjs');
     1059        if ( !empty($wcpgsk_checkoutjs) ) :
     1060            echo '<script language="javascript">';
     1061            echo $wcpgsk_checkoutjs;
     1062            echo '</script>';
     1063        endif;
     1064    endif;
    10641065}
    10651066
  • woocommerce-poor-guys-swiss-knife/trunk/woocommerce-poor-guys-swiss-knife.php

    r972884 r976205  
    88 * Author: Uli Hake
    99 * Author URI: http://takebarcelona.com/authorship/uli-hake
    10  * Version: 1.9.6
     10 * Version: 1.9.7
    1111 * @package WordPress
    1212 * @subpackage WooCommerce Poor Guys Swiss Knife
     
    106106        //load into our global
    107107        $wcpgsk = new WCPGSK_Main( __FILE__ );
    108         $wcpgsk->version = '1.9.6';
     108        $wcpgsk->version = '1.9.7';
    109109        $wcpgsk->wcpgsk_hook_woocommerce_filters();
    110110       
Note: See TracChangeset for help on using the changeset viewer.