Skip to content

Commit

Permalink
1.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
vendidero committed Oct 16, 2015
1 parent 5b45bae commit d197bdf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
28 changes: 14 additions & 14 deletions includes/class-wc-gzd-product-variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
exit; // Exit if accessed directly

/**
* WooCommerce Germanized Abstract Product
* WooCommerce Germanized Product Variable
*
* The WC_GZD_Product Class is used to offer additional functionality for every product type.
* The WC_GZD_Product_Variable Class is used to offer additional functionality for every variable product.
*
* @class WC_GZD_Product
* @version 1.0.0
Expand All @@ -15,39 +15,39 @@
class WC_GZD_Product_Variable extends WC_GZD_Product {

/**
* Get the min or max variation regular price.
* Get the min or max variation unit regular price.
* @param string $min_or_max - min or max
* @param boolean $display Whether the value is going to be displayed
* @return string
*/
public function get_variation_regular_price( $min_or_max = 'min', $display = false ) {
$prices = $this->get_variation_prices( $display );
public function get_variation_unit_regular_price( $min_or_max = 'min', $display = false ) {
$prices = $this->get_variation_unit_prices( $display );
$price = 'min' === $min_or_max ? current( $prices['regular_price'] ) : end( $prices['regular_price'] );
return apply_filters( 'woocommerce_get_variation_regular_price', $price, $this, $min_or_max, $display );
return apply_filters( 'woocommerce_gzd_get_variation_unit_regular_price', $price, $this, $min_or_max, $display );
}

/**
* Get the min or max variation sale price.
* Get the min or max variation unit sale price.
* @param string $min_or_max - min or max
* @param boolean $display Whether the value is going to be displayed
* @return string
*/
public function get_variation_sale_price( $min_or_max = 'min', $display = false ) {
$prices = $this->get_variation_prices( $display );
public function get_variation_unit_sale_price( $min_or_max = 'min', $display = false ) {
$prices = $this->get_variation_unit_prices( $display );
$price = 'min' === $min_or_max ? current( $prices['sale_price'] ) : end( $prices['sale_price'] );
return apply_filters( 'woocommerce_get_variation_sale_price', $price, $this, $min_or_max, $display );
return apply_filters( 'woocommerce_gzd_get_variation_unit_sale_price', $price, $this, $min_or_max, $display );
}

/**
* Get the min or max variation (active) price.
* Get the min or max variation (active) unit price.
* @param string $min_or_max - min or max
* @param boolean $display Whether the value is going to be displayed
* @return string
*/
public function get_variation_price( $min_or_max = 'min', $display = false ) {
$prices = $this->get_variation_prices( $display );
public function get_variation_unit_price( $min_or_max = 'min', $display = false ) {
$prices = $this->get_variation_unit_prices( $display );
$price = 'min' === $min_or_max ? current( $prices['price'] ) : end( $prices['price'] );
return apply_filters( 'woocommerce_get_variation_price', $price, $this, $min_or_max, $display );
return apply_filters( 'woocommerce_gzd_get_variation_unit_price', $price, $this, $min_or_max, $display );
}

/**
Expand Down
5 changes: 5 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ Bugs sowie Hilfe bei der Arbeit an WooCommerce Germanized werden gerne über uns

== Changelog ==

= 1.4.5 =
* Feature - WC_GZD_Product_Variable object containing get_variation_unit_price with min max option
* Fix - virtual vat calculation (vat exempt compatibility)
* Fix - email object $type check

= 1.4.4 =
* Fix - in_array default option checkout

Expand Down
4 changes: 2 additions & 2 deletions woocommerce-germanized.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Germanized
* Plugin URI: https://www.vendidero.de/woocommerce-germanized
* Description: Extends WooCommerce to become a legally compliant store for the german market.
* Version: 1.4.4
* Version: 1.4.5
* Author: Vendidero
* Author URI: https://vendidero.de
* Requires at least: 3.8
Expand All @@ -26,7 +26,7 @@ final class WooCommerce_Germanized {
*
* @var string
*/
public $version = '1.4.4';
public $version = '1.4.5';

/**
* Single instance of WooCommerce Germanized Main Class
Expand Down

0 comments on commit d197bdf

Please sign in to comment.