Skip to content

Commit be1e856

Browse files
committed
Updated Compatibility Class
added wc_trim_zeroes()
1 parent 0965bfd commit be1e856

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

woocommerce/changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*** SkyVerge WooCommerce Plugin Framework Changelog ***
22

3+
2014.01.29 - version 2.0.1
4+
* Tweak - Additional WC 2.1 compatibility helpers
5+
36
2014.01.20 - version 2.0
47
* Feature - Generalized Plugin Framework
58
* Feature - Support for "tokenize with sale" gateways

woocommerce/class-sv-wc-plugin-compatibility.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,23 @@ public static function get_checkout_order_received_url( $order ) {
727727
}
728728

729729

730+
/**
731+
* Trim trailing zeros off prices.
732+
*
733+
* @since 2.0.1
734+
* @param string $price the price
735+
* @return string price with zeroes trimmed
736+
*/
737+
public static function wc_trim_zeroes( $price ) {
738+
739+
if ( self::is_wc_version_gte_2_1() ) {
740+
return wc_trim_zeroes( $price );
741+
} else {
742+
return woocommerce_trim_zeroes( $price );
743+
}
744+
}
745+
746+
730747
/**
731748
* Compatibility function to get the version of the currently installed WooCommerce
732749
*

woocommerce/class-sv-wc-plugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@
4848
* + `get_settings_url()` - return the plugin admin settings URL, if any
4949
* + `render_admin_notices()` - override to perform custom admin plugin requirement checks (defaults to checking for php extension depenencies). Use the is_message_dismissed() and add_dismissible_notice() methods
5050
*
51-
* @version 2.0
51+
* @version 2.0.1
5252
*/
5353
abstract class SV_WC_Plugin {
5454

5555
/** Plugin Framework Version */
56-
const VERSION = '2.0';
56+
const VERSION = '2.0.1';
5757

5858
/** @var string plugin id */
5959
private $id;

0 commit comments

Comments
 (0)