WooCommerce Germanized - Version 1.7.3

Version Description

  • Fix - Variations Unit Price Saving
  • Fix - Better Performance by using get_the_terms
  • Fix - Cancel Order Button Removal if option has been activated
  • Fix - Digital Extended Type Check
  • Fix - PHP < 5.3 check for SEPA Gateway (not supported)
Download this release

Release Info

Developer vendidero
Plugin Icon 128x128 WooCommerce Germanized
Version 1.7.3
Comparing to
See all releases

Code changes from version 1.7.2 to 1.7.3

assets/js/admin/product-variations.js CHANGED
@@ -6,6 +6,24 @@ jQuery( function ( $ ) {
6
  $( '#woocommerce-product-data' ).on( 'click', '.woocommerce_variation', this.show_or_hide_unit_variation );
7
  $( '#general_product_data' ).on( 'blur', 'input#_unit_base', this.show_or_hide_unit_variation );
8
  $( '#general_product_data' ).on( 'change', 'select#_unit', this.show_or_hide_unit_variation );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  },
10
 
11
  show_or_hide_unit_variation: function() {
6
  $( '#woocommerce-product-data' ).on( 'click', '.woocommerce_variation', this.show_or_hide_unit_variation );
7
  $( '#general_product_data' ).on( 'blur', 'input#_unit_base', this.show_or_hide_unit_variation );
8
  $( '#general_product_data' ).on( 'change', 'select#_unit', this.show_or_hide_unit_variation );
9
+
10
+ $( document ).bind( 'woocommerce_variations_save_variations_button', this.save_variations );
11
+ $( document ).bind( 'woocommerce_variations_save_variations_on_submit', this.save_variations );
12
+ },
13
+
14
+ save_variations: function() {
15
+
16
+ var fields = [ 'unit', 'unit_base', 'unit_product' ];
17
+ var variations = $( '.woocommerce_variations' ).find( '.woocommerce_variation' );
18
+
19
+ $.each( fields, function( index, id ) {
20
+ var parent_val = $( '#_' + id ).val();
21
+
22
+ variations.each( function() {
23
+ $( this ).find( '.wc-gzd-parent-' + id ).val( parent_val );
24
+ });
25
+ });
26
+
27
  },
28
 
29
  show_or_hide_unit_variation: function() {
assets/js/admin/product-variations.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(a){var b={init:function(){a("#woocommerce-product-data").on("click",".woocommerce_variation",this.show_or_hide_unit_variation),a("#general_product_data").on("blur","input#_unit_base",this.show_or_hide_unit_variation),a("#general_product_data").on("change","select#_unit",this.show_or_hide_unit_variation)},show_or_hide_unit_variation:function(){b.is_variable()&&(a(".variable_pricing_unit").hide(),!b.has_unit_price()&&b.has_unit()?(a(".variable_pricing_unit").show(),a(".variable_pricing_unit .form-row").hide(),a(".variable_pricing_unit").find("input[name*=variable_unit_product]").parents(".form-row").show()):b.has_unit_price()&&(a(".variable_pricing_unit .form-row").show(),a(".variable_pricing_unit").show()))},is_variable:function(){return"variable"===a("select#product-type").val()},has_unit:function(){return"0"!==a("#_unit").val()},has_unit_price:function(){return"0"!==a("#_unit").val()&&0!==a("#_unit_base").val().length}};b.init()});
1
+ jQuery(function(a){var b={init:function(){a("#woocommerce-product-data").on("click",".woocommerce_variation",this.show_or_hide_unit_variation),a("#general_product_data").on("blur","input#_unit_base",this.show_or_hide_unit_variation),a("#general_product_data").on("change","select#_unit",this.show_or_hide_unit_variation),a(document).bind("woocommerce_variations_save_variations_button",this.save_variations),a(document).bind("woocommerce_variations_save_variations_on_submit",this.save_variations)},save_variations:function(){var b=["unit","unit_base","unit_product"],c=a(".woocommerce_variations").find(".woocommerce_variation");a.each(b,function(b,d){var e=a("#_"+d).val();c.each(function(){a(this).find(".wc-gzd-parent-"+d).val(e)})})},show_or_hide_unit_variation:function(){b.is_variable()&&(a(".variable_pricing_unit").hide(),!b.has_unit_price()&&b.has_unit()?(a(".variable_pricing_unit").show(),a(".variable_pricing_unit .form-row").hide(),a(".variable_pricing_unit").find("input[name*=variable_unit_product]").parents(".form-row").show()):b.has_unit_price()&&(a(".variable_pricing_unit .form-row").show(),a(".variable_pricing_unit").show()))},is_variable:function(){return"variable"===a("select#product-type").val()},has_unit:function(){return"0"!==a("#_unit").val()},has_unit_price:function(){return"0"!==a("#_unit").val()&&0!==a("#_unit_base").val().length}};b.init()});
i18n/languages/woocommerce-germanized-de_DE.mo CHANGED
Binary file
i18n/languages/woocommerce-germanized-de_DE.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WooCommerce Germanized v1.5.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2016-11-11 15:47+0100\n"
6
- "PO-Revision-Date: 2016-11-11 15:49+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "Language: de_DE\n"
@@ -3574,7 +3574,7 @@ msgstr ""
3574
  "\n"
3575
  "<hr/>\n"
3576
  "\n"
3577
- "Bitte beachte: Die First für die Vorabinformation der SEPA-Lastschrift wird "
3578
  "auf einen Tag verkürzt. "
3579
 
3580
  #: /Users/dennis/Documents/localhost/vendidero/wp-content/plugins/woocommerce-germanized/includes/gateways/direct-debit/class-wc-gzd-gateway-direct-debit.php:136
2
  msgstr ""
3
  "Project-Id-Version: WooCommerce Germanized v1.5.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2016-11-14 10:51+0100\n"
6
+ "PO-Revision-Date: 2016-11-14 10:51+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "Language: de_DE\n"
3574
  "\n"
3575
  "<hr/>\n"
3576
  "\n"
3577
+ "Bitte beachte: Die Frist für die Vorabinformation der SEPA-Lastschrift wird "
3578
  "auf einen Tag verkürzt. "
3579
 
3580
  #: /Users/dennis/Documents/localhost/vendidero/wp-content/plugins/woocommerce-germanized/includes/gateways/direct-debit/class-wc-gzd-gateway-direct-debit.php:136
includes/abstracts/abstract-wc-gzd-product.php CHANGED
@@ -364,10 +364,12 @@ class WC_GZD_Product {
364
  */
365
  public function get_delivery_time() {
366
 
367
- $terms = wp_get_post_terms( $this->id, 'product_delivery_time' );
368
 
369
  if ( $this->child->is_type( 'variation' ) ) {
370
- $variation_terms = wp_get_post_terms( $this->child->variation_id , 'product_delivery_time' );
 
 
371
  if ( ! empty( $variation_terms ) && ! is_wp_error( $variation_terms ) )
372
  $terms = $variation_terms;
373
  }
364
  */
365
  public function get_delivery_time() {
366
 
367
+ $terms = get_the_terms( $this->id, 'product_delivery_time' );
368
 
369
  if ( $this->child->is_type( 'variation' ) ) {
370
+
371
+ $variation_terms = get_the_terms( $this->child->variation_id , 'product_delivery_time' );
372
+
373
  if ( ! empty( $variation_terms ) && ! is_wp_error( $variation_terms ) )
374
  $terms = $variation_terms;
375
  }
includes/admin/meta-boxes/class-wc-gzd-meta-box-product-data-variable.php CHANGED
@@ -73,7 +73,7 @@ class WC_Germanized_Meta_Box_Product_Data_Variable {
73
  $variation_data[ $field ] = isset( $variation_meta[ $field ][0] ) ? maybe_unserialize( $variation_meta[ $field ][0] ) : $value;
74
  }
75
 
76
- $delivery_time = wp_get_post_terms( $variation_id, 'product_delivery_time' );
77
 
78
  if ( $delivery_time && ! empty( $delivery_time ) && is_array( $delivery_time ) )
79
  $delivery_time = $delivery_time[0];
73
  $variation_data[ $field ] = isset( $variation_meta[ $field ][0] ) ? maybe_unserialize( $variation_meta[ $field ][0] ) : $value;
74
  }
75
 
76
+ $delivery_time = get_the_terms( $variation_id, 'product_delivery_time' );
77
 
78
  if ( $delivery_time && ! empty( $delivery_time ) && is_array( $delivery_time ) )
79
  $delivery_time = $delivery_time[0];
includes/class-wc-gzd-checkout.php CHANGED
@@ -65,6 +65,7 @@ class WC_GZD_Checkout {
65
  add_filter( 'woocommerce_get_cancel_order_url_raw', array( $this, 'cancel_order_url' ), PHP_INT_MAX, 1 );
66
  add_filter( 'user_has_cap', array( $this, 'disallow_user_order_cancellation' ), 15, 3 );
67
  add_action( 'woocommerce_germanized_order_confirmation_sent', array( $this, 'maybe_reduce_order_stock' ), 5, 1 );
 
68
  }
69
 
70
  // Free Shipping auto select
@@ -81,6 +82,14 @@ class WC_GZD_Checkout {
81
  if ( wc_gzd_is_parcel_delivery_data_transfer_checkbox_enabled() )
82
  add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'order_parcel_delivery_data_transfer' ), 10, 2 );
83
  }
 
 
 
 
 
 
 
 
84
 
85
  public function order_parcel_delivery_data_transfer( $order_id, $posted ) {
86
  if ( isset( $_POST[ 'parcel-delivery' ] ) ) {
65
  add_filter( 'woocommerce_get_cancel_order_url_raw', array( $this, 'cancel_order_url' ), PHP_INT_MAX, 1 );
66
  add_filter( 'user_has_cap', array( $this, 'disallow_user_order_cancellation' ), 15, 3 );
67
  add_action( 'woocommerce_germanized_order_confirmation_sent', array( $this, 'maybe_reduce_order_stock' ), 5, 1 );
68
+ add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'remove_cancel_button' ), 10, 2 );
69
  }
70
 
71
  // Free Shipping auto select
82
  if ( wc_gzd_is_parcel_delivery_data_transfer_checkbox_enabled() )
83
  add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'order_parcel_delivery_data_transfer' ), 10, 2 );
84
  }
85
+
86
+ public function remove_cancel_button( $actions, $order ) {
87
+
88
+ if ( isset( $actions[ 'cancel' ] ) )
89
+ unset( $actions[ 'cancel' ] );
90
+
91
+ return $actions;
92
+ }
93
 
94
  public function order_parcel_delivery_data_transfer( $order_id, $posted ) {
95
  if ( isset( $_POST[ 'parcel-delivery' ] ) ) {
includes/wc-gzd-product-functions.php CHANGED
@@ -87,15 +87,19 @@ function wc_gzd_is_revocation_exempt( $product, $type = 'digital' ) {
87
 
88
  function wc_gzd_product_matches_extended_type( $type, $product ) {
89
 
 
 
90
  // Support Variations
91
  if ( $product->parent ) {
92
- $product = wc_get_product( $product->parent );
93
  }
94
 
95
  if ( $type === $product->get_type() )
96
  return true;
97
  else if ( is_callable( array( $product, 'is_' . $type ) ) )
98
  return ( call_user_func_array( array( $product, 'is_' . $type ), array() ) === true ? true : false );
 
 
99
 
100
  return false;
101
  }
87
 
88
  function wc_gzd_product_matches_extended_type( $type, $product ) {
89
 
90
+ $parent = null;
91
+
92
  // Support Variations
93
  if ( $product->parent ) {
94
+ $parent = wc_get_product( $product->parent );
95
  }
96
 
97
  if ( $type === $product->get_type() )
98
  return true;
99
  else if ( is_callable( array( $product, 'is_' . $type ) ) )
100
  return ( call_user_func_array( array( $product, 'is_' . $type ), array() ) === true ? true : false );
101
+ else if ( $parent )
102
+ return wc_gzd_product_matches_extended_type( $type, $parent );
103
 
104
  return false;
105
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: vendidero
3
  Tags: woocommerce, german market, german, germany, deutsch, deutschland, de, de_DE, shop, commerce, e-commerce, ecommerce, woothemes, sepa, invoice
4
  Requires at least: 3.8
5
  Tested up to: 4.6
6
- Stable tag: 1.7.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -157,6 +157,13 @@ Bug reports may be filed via our [GitHub repository](https://github.com/vendider
157
 
158
  == Changelog ==
159
 
 
 
 
 
 
 
 
160
  = 1.7.2 =
161
  * Feature - Optionally do not allow customers to switch payment gateway after ordering
162
  * Feature - Better Woo Subscriptions Compatibility
3
  Tags: woocommerce, german market, german, germany, deutsch, deutschland, de, de_DE, shop, commerce, e-commerce, ecommerce, woothemes, sepa, invoice
4
  Requires at least: 3.8
5
  Tested up to: 4.6
6
+ Stable tag: 1.7.3
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
157
 
158
  == Changelog ==
159
 
160
+ = 1.7.3 =
161
+ * Fix - Variations Unit Price Saving
162
+ * Fix - Better Performance by using get_the_terms
163
+ * Fix - Cancel Order Button Removal if option has been activated
164
+ * Fix - Digital Extended Type Check
165
+ * Fix - PHP < 5.3 check for SEPA Gateway (not supported)
166
+
167
  = 1.7.2 =
168
  * Feature - Optionally do not allow customers to switch payment gateway after ordering
169
  * Feature - Better Woo Subscriptions Compatibility
woocommerce-germanized.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce Germanized
4
  * Plugin URI: https://www.vendidero.de/woocommerce-germanized
5
  * Description: Extends WooCommerce to become a legally compliant store for the german market.
6
- * Version: 1.7.2
7
  * Author: Vendidero
8
  * Author URI: https://vendidero.de
9
  * Requires at least: 3.8
@@ -28,7 +28,7 @@ final class WooCommerce_Germanized {
28
  *
29
  * @var string
30
  */
31
- public $version = '1.7.2';
32
 
33
  /**
34
  * Single instance of WooCommerce Germanized Main Class
@@ -745,7 +745,10 @@ final class WooCommerce_Germanized {
745
 
746
  public function register_gateways( $gateways ) {
747
 
748
- $gateways[] = 'WC_GZD_Gateway_Direct_Debit';
 
 
 
749
  $gateways[] = 'WC_GZD_Gateway_Invoice';
750
 
751
  return $gateways;
3
  * Plugin Name: WooCommerce Germanized
4
  * Plugin URI: https://www.vendidero.de/woocommerce-germanized
5
  * Description: Extends WooCommerce to become a legally compliant store for the german market.
6
+ * Version: 1.7.3
7
  * Author: Vendidero
8
  * Author URI: https://vendidero.de
9
  * Requires at least: 3.8
28
  *
29
  * @var string
30
  */
31
+ public $version = '1.7.3';
32
 
33
  /**
34
  * Single instance of WooCommerce Germanized Main Class
745
 
746
  public function register_gateways( $gateways ) {
747
 
748
+ // Do only load gateway for PHP >= 5.3 because of Namespaces
749
+ if ( version_compare( phpversion(), '5.3', '>=' ) )
750
+ $gateways[] = 'WC_GZD_Gateway_Direct_Debit';
751
+
752
  $gateways[] = 'WC_GZD_Gateway_Invoice';
753
 
754
  return $gateways;