Skip to content

Commit

Permalink
Multicurrency: Do not modify deposit percentage for display. (#7247)
Browse files Browse the repository at this point in the history
Co-authored-by: Mayisha <[email protected]>
  • Loading branch information
peterwilsoncc and Mayisha authored Oct 23, 2023
1 parent a49b5ce commit dec5477
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelog/deposits-506-percentage-display
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Improve multi-currency compatibility with WooCommerce Deposits
13 changes: 13 additions & 0 deletions includes/multi-currency/Compatibility/WooCommerceDeposits.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ class WooCommerceDeposits extends BaseCompatibility {
*/
protected function init() {
if ( class_exists( 'WC_Deposits' ) ) {
/*
* Multi-currency support was added to WooCommerce Deposits in version 2.0.1.
*
* This prevents the loading of the compatibility class for Deposits in versions
* of Deposits that support multi-currency.
*
* @see https://github.com/woocommerce/woocommerce-deposits/pull/425
* @see https://github.com/woocommerce/woocommerce-deposits/issues/506
*/
if ( version_compare( WC_DEPOSITS_VERSION, '2.0.1', '>=' ) ) {
return;
}

// Add compatibility filters here.
add_action( 'woocommerce_deposits_create_order', [ $this, 'modify_order_currency' ] );
add_filter( 'woocommerce_get_cart_contents', [ $this, 'modify_cart_item_deposit_amounts' ] );
Expand Down

0 comments on commit dec5477

Please sign in to comment.