Skip to content

Commit

Permalink
Merge pull request #41 from wirecard/TPWDCEE-1098
Browse files Browse the repository at this point in the history
Update unit tax rate calculation
  • Loading branch information
jpy authored Apr 4, 2018
2 parents 08fda15 + 34fe179 commit bbbef7d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
require_once( WOOCOMMERCE_GATEWAY_WCP_BASEDIR . 'classes/class-woocommerce-wcp-payments.php' );

define( 'WOOCOMMERCE_GATEWAY_WCP_NAME', 'Woocommerce2_WirecardCheckoutPage' );
define( 'WOOCOMMERCE_GATEWAY_WCP_VERSION', '1.3.8' );
define( 'WOOCOMMERCE_GATEWAY_WCP_VERSION', '1.3.9' );
define( 'WOOCOMMERCE_GATEWAY_WCP_WINDOWNAME', 'WirecardCheckoutPageFrame' );
define( 'WOOCOMMERCE_GATEWAY_WCP_TABLE_NAME', 'woocommerce_wcp_transaction' );

Expand Down Expand Up @@ -826,7 +826,7 @@ protected function get_shopping_basket() {
$item->setUnitGrossAmount( $item_unit_gross_amount )
->setUnitNetAmount( wc_format_decimal( $item_unit_net_amount, wc_get_price_decimals() ) )
->setUnitTaxAmount( wc_format_decimal( $item_unit_tax_amount, wc_get_price_decimals() ) )
->setUnitTaxRate( number_format( ( $item_unit_tax_amount / $item_unit_net_amount ), 2, '.', '' ) )
->setUnitTaxRate( number_format( ( $item_unit_tax_amount / $item_unit_net_amount ), 2, '.', '' ) * 100 )
->setDescription( substr( strip_tags( $cart_item['data']->get_short_description() ), 0, 127 ) )
->setName( substr( strip_tags( $cart_item['data']->get_name() ), 0, 127 ) )
->setImageUrl( isset( $image_url ) ? $image_url : '' );
Expand All @@ -841,7 +841,7 @@ protected function get_shopping_basket() {
wc_get_price_decimals() ) )
->setUnitNetAmount( wc_format_decimal( $cart->shipping_total, wc_get_price_decimals() ) )
->setUnitTaxAmount( wc_format_decimal( $cart->shipping_tax_total, wc_get_price_decimals() ) )
->setUnitTaxRate( number_format( ( $cart->shipping_tax_total / $cart->shipping_total ), 2, '.', '' ) )
->setUnitTaxRate( number_format( ( $cart->shipping_tax_total / $cart->shipping_total ), 2, '.', '' ) * 100 )
->setName( 'Shipping' )
->setDescription( 'Shipping' );
$basket->addItem( $item );
Expand Down

0 comments on commit bbbef7d

Please sign in to comment.