WooCommerce Germanized - Version 1.3.1

Version Description

  • Fix - Variation shipping time
Download this release

Release Info

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

Code changes from version 1.3.0 to 1.3.1

includes/wc-gzd-cart-functions.php CHANGED
@@ -25,10 +25,10 @@ function wc_gzd_get_tax_rate( $tax_rate_id ) {
25
  * @param array $cart_item
26
  * @return string
27
  */
28
- function wc_gzd_cart_product_item_desc( $title, $cart_item ) {
29
  $product_desc = "";
30
  if ( isset( $cart_item[ 'data' ] ) ) {
31
- $product = wc_get_product( $cart_item[ 'data' ] );
32
  if ( $product->gzd_product->get_mini_desc() )
33
  $product_desc = $product->gzd_product->get_mini_desc();
34
  } else if ( isset( $cart_item[ 'item_desc' ] ) )
@@ -45,10 +45,10 @@ function wc_gzd_cart_product_item_desc( $title, $cart_item ) {
45
  * @param array $cart_item
46
  * @return string
47
  */
48
- function wc_gzd_cart_product_delivery_time( $title, $cart_item ) {
49
  $delivery_time = "";
50
  if ( isset( $cart_item[ 'data' ] ) ) {
51
- $product = wc_get_product( $cart_item[ 'data' ] );
52
  if ( $product->gzd_product->get_delivery_time_term() )
53
  $delivery_time = $product->gzd_product->get_delivery_time_html();
54
  } else if ( isset( $cart_item[ 'delivery_time' ] ) )
@@ -65,10 +65,10 @@ function wc_gzd_cart_product_delivery_time( $title, $cart_item ) {
65
  * @param array $cart_item
66
  * @return string
67
  */
68
- function wc_gzd_cart_product_unit_price( $price, $cart_item ) {
69
  $unit_price = "";
70
  if ( isset( $cart_item[ 'data' ] ) ) {
71
- $product = wc_get_product( $cart_item[ 'data' ] );
72
  if ( $product->gzd_product->has_unit() )
73
  $unit_price = $product->gzd_product->get_unit_html( false );
74
  } else if ( isset( $cart_item[ 'unit_price' ] ) )
@@ -91,7 +91,7 @@ function wc_gzd_get_cart_tax_share( $type = 'shipping' ) {
91
  // Get tax classes and tax amounts
92
  if ( ! empty( $cart ) ) {
93
  foreach ( $cart as $key => $item ) {
94
- $_product = wc_get_product( $item['data'] );
95
  // Dont calculate share if is shipping and product is virtual or vat exception
96
  if ( $type == 'shipping' && $_product->is_virtual() || ( $_product->gzd_product->is_virtual_vat_exception() && $type == 'shipping' ) )
97
  continue;
25
  * @param array $cart_item
26
  * @return string
27
  */
28
+ function wc_gzd_cart_product_item_desc( $title, $cart_item, $cart_item_key = '' ) {
29
  $product_desc = "";
30
  if ( isset( $cart_item[ 'data' ] ) ) {
31
+ $product = apply_filters( 'woocommerce_cart_item_product', $cart_item[ 'data' ], $cart_item, $cart_item_key );
32
  if ( $product->gzd_product->get_mini_desc() )
33
  $product_desc = $product->gzd_product->get_mini_desc();
34
  } else if ( isset( $cart_item[ 'item_desc' ] ) )
45
  * @param array $cart_item
46
  * @return string
47
  */
48
+ function wc_gzd_cart_product_delivery_time( $title, $cart_item, $cart_item_key = '' ) {
49
  $delivery_time = "";
50
  if ( isset( $cart_item[ 'data' ] ) ) {
51
+ $product = apply_filters( 'woocommerce_cart_item_product', $cart_item[ 'data' ], $cart_item, $cart_item_key );
52
  if ( $product->gzd_product->get_delivery_time_term() )
53
  $delivery_time = $product->gzd_product->get_delivery_time_html();
54
  } else if ( isset( $cart_item[ 'delivery_time' ] ) )
65
  * @param array $cart_item
66
  * @return string
67
  */
68
+ function wc_gzd_cart_product_unit_price( $price, $cart_item, $cart_item_key = '' ) {
69
  $unit_price = "";
70
  if ( isset( $cart_item[ 'data' ] ) ) {
71
+ $product = apply_filters( 'woocommerce_cart_item_product', $cart_item[ 'data' ], $cart_item, $cart_item_key );
72
  if ( $product->gzd_product->has_unit() )
73
  $unit_price = $product->gzd_product->get_unit_html( false );
74
  } else if ( isset( $cart_item[ 'unit_price' ] ) )
91
  // Get tax classes and tax amounts
92
  if ( ! empty( $cart ) ) {
93
  foreach ( $cart as $key => $item ) {
94
+ $_product = apply_filters( 'woocommerce_cart_item_product', $item[ 'data' ], $item, $key );
95
  // Dont calculate share if is shipping and product is virtual or vat exception
96
  if ( $type == 'shipping' && $_product->is_virtual() || ( $_product->gzd_product->is_virtual_vat_exception() && $type == 'shipping' ) )
97
  continue;
includes/wc-gzd-template-functions.php CHANGED
@@ -178,7 +178,7 @@ if ( ! function_exists( 'woocommerce_gzd_digital_checkbox' ) ) {
178
  $is_downloadable = false;
179
  if ( ! empty( $items ) ) {
180
  foreach ( $items as $cart_item_key => $values ) {
181
- $_product = wc_get_product( $values['data'] );
182
  if ( $_product->is_downloadable() )
183
  $is_downloadable = true;
184
  }
@@ -207,7 +207,7 @@ if ( ! function_exists( 'woocommerce_gzd_checkout_validation' ) ) {
207
  $is_downloadable = false;
208
  if ( ! empty( $items ) && get_option( 'woocommerce_gzd_checkout_legal_digital_checkbox' ) == 'yes' ) {
209
  foreach ( $items as $cart_item_key => $values ) {
210
- $_product = wc_get_product( $values['data'] );
211
  if ( $_product->is_downloadable() )
212
  $is_downloadable = true;
213
  }
178
  $is_downloadable = false;
179
  if ( ! empty( $items ) ) {
180
  foreach ( $items as $cart_item_key => $values ) {
181
+ $_product = apply_filters( 'woocommerce_cart_item_product', $values[ 'data' ], $values, $cart_item_key );
182
  if ( $_product->is_downloadable() )
183
  $is_downloadable = true;
184
  }
207
  $is_downloadable = false;
208
  if ( ! empty( $items ) && get_option( 'woocommerce_gzd_checkout_legal_digital_checkbox' ) == 'yes' ) {
209
  foreach ( $items as $cart_item_key => $values ) {
210
+ $_product = apply_filters( 'woocommerce_cart_item_product', $values[ 'data' ], $values, $cart_item_key );
211
  if ( $_product->is_downloadable() )
212
  $is_downloadable = true;
213
  }
includes/wc-gzd-template-hooks.php CHANGED
@@ -43,12 +43,12 @@ if ( get_option( 'woocommerce_gzd_display_listings_link_details' ) == 'yes' )
43
  * Cart
44
  */
45
  add_action( 'woocommerce_cart_totals_after_order_total', 'woocommerce_gzd_template_cart_total_tax', 1 );
46
- add_filter( 'woocommerce_cart_item_price', 'wc_gzd_cart_product_unit_price', 0, 2 );
47
- add_filter( 'woocommerce_cart_item_subtotal', 'wc_gzd_cart_product_unit_price', 0, 2 );
48
  // Remove cart item name filter within checkout
49
  add_action( 'woocommerce_review_order_before_cart_contents', 'woocommerce_gzd_template_checkout_remove_cart_name_filter' );
50
  // Add item name filter within cart
51
- add_filter( 'woocommerce_cart_item_name', 'wc_gzd_cart_product_delivery_time', 0, 2 );
52
  add_filter( 'woocommerce_cart_item_name', 'wc_gzd_cart_product_item_desc', 0, 3 );
53
  // Small enterprises
54
  if ( get_option( 'woocommerce_gzd_small_enterprise' ) == 'yes' ) {
@@ -124,9 +124,9 @@ add_action( 'woocommerce_after_checkout_validation', 'woocommerce_gzd_checkout_v
124
  // Remove order again button (legally incompliant)
125
  remove_action( 'woocommerce_order_details_after_order_table', 'woocommerce_order_again_button' );
126
  add_action( 'woocommerce_thankyou_order_received_text', 'woocommerce_gzd_template_order_success_text', 0, 1 );
127
- add_action( 'woocommerce_order_item_quantity_html', 'wc_gzd_cart_product_delivery_time', 0, 2 );
128
- add_action( 'woocommerce_order_item_quantity_html', 'wc_gzd_cart_product_item_desc', 0, 2 );
129
- add_filter( 'woocommerce_order_formatted_line_subtotal', 'wc_gzd_cart_product_unit_price', 0, 2 );
130
  if ( get_option( 'woocommerce_gzd_hide_order_success_details' ) == 'yes' )
131
  remove_action( 'woocommerce_thankyou', 'woocommerce_order_details_table', 10 );
132
  if ( get_option( 'woocommerce_gzd_trusted_shops_id' ) )
43
  * Cart
44
  */
45
  add_action( 'woocommerce_cart_totals_after_order_total', 'woocommerce_gzd_template_cart_total_tax', 1 );
46
+ add_filter( 'woocommerce_cart_item_price', 'wc_gzd_cart_product_unit_price', 0, 3 );
47
+ add_filter( 'woocommerce_cart_item_subtotal', 'wc_gzd_cart_product_unit_price', 0, 3 );
48
  // Remove cart item name filter within checkout
49
  add_action( 'woocommerce_review_order_before_cart_contents', 'woocommerce_gzd_template_checkout_remove_cart_name_filter' );
50
  // Add item name filter within cart
51
+ add_filter( 'woocommerce_cart_item_name', 'wc_gzd_cart_product_delivery_time', 0, 3 );
52
  add_filter( 'woocommerce_cart_item_name', 'wc_gzd_cart_product_item_desc', 0, 3 );
53
  // Small enterprises
54
  if ( get_option( 'woocommerce_gzd_small_enterprise' ) == 'yes' ) {
124
  // Remove order again button (legally incompliant)
125
  remove_action( 'woocommerce_order_details_after_order_table', 'woocommerce_order_again_button' );
126
  add_action( 'woocommerce_thankyou_order_received_text', 'woocommerce_gzd_template_order_success_text', 0, 1 );
127
+ add_action( 'woocommerce_order_item_quantity_html', 'wc_gzd_cart_product_delivery_time', 0, 3 );
128
+ add_action( 'woocommerce_order_item_quantity_html', 'wc_gzd_cart_product_item_desc', 0, 3 );
129
+ add_filter( 'woocommerce_order_formatted_line_subtotal', 'wc_gzd_cart_product_unit_price', 0, 3 );
130
  if ( get_option( 'woocommerce_gzd_hide_order_success_details' ) == 'yes' )
131
  remove_action( 'woocommerce_thankyou', 'woocommerce_order_details_table', 10 );
132
  if ( get_option( 'woocommerce_gzd_trusted_shops_id' ) )
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: woocommerce, german market, german, germany, deutsch, deutschland, de, de_
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=info@vendidero.de&item_name=Donation+for+WooCommerce+Germanized
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
- Stable tag: 1.3.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -154,6 +154,9 @@ Bugs sowie Hilfe bei der Arbeit an WooCommerce Germanized werden gerne über uns
154
 
155
  == Changelog ==
156
 
 
 
 
157
  = 1.3.0 =
158
  * Feature - Better theme compatibility (no template overriding required any longer)
159
  * Feature - Unit editor (taxonomy)
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=info@vendidero.de&item_name=Donation+for+WooCommerce+Germanized
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
+ Stable tag: 1.3.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
154
 
155
  == Changelog ==
156
 
157
+ = 1.3.1 =
158
+ * Fix - Variation shipping time
159
+
160
  = 1.3.0 =
161
  * Feature - Better theme compatibility (no template overriding required any longer)
162
  * Feature - Unit editor (taxonomy)
templates/single-product/delivery-time-info.php CHANGED
@@ -14,4 +14,6 @@ global $product;
14
 
15
  <?php if ( $product->gzd_product->get_delivery_time_term() ) : ?>
16
  <p class="wc-gzd-additional-info delivery-time-info"><?php echo $product->gzd_product->get_delivery_time_html();?></p>
 
 
17
  <?php endif; ?>
14
 
15
  <?php if ( $product->gzd_product->get_delivery_time_term() ) : ?>
16
  <p class="wc-gzd-additional-info delivery-time-info"><?php echo $product->gzd_product->get_delivery_time_html();?></p>
17
+ <?php elseif ( $product->is_type( 'variable' ) ) : ?>
18
+ <p class="wc-gzd-additional-info delivery-time-info"></p>
19
  <?php endif; ?>
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.3.0
7
  * Author: Vendidero
8
  * Author URI: https://vendidero.de
9
  * Requires at least: 3.8
@@ -26,7 +26,7 @@ final class WooCommerce_Germanized {
26
  *
27
  * @var string
28
  */
29
- public $version = '1.3.0';
30
 
31
  /**
32
  * Single instance of WooCommerce Germanized Main Class
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.3.1
7
  * Author: Vendidero
8
  * Author URI: https://vendidero.de
9
  * Requires at least: 3.8
26
  *
27
  * @var string
28
  */
29
+ public $version = '1.3.1';
30
 
31
  /**
32
  * Single instance of WooCommerce Germanized Main Class