Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

Commit

Permalink
Fix adding shipping tax to new orders
Browse files Browse the repository at this point in the history
  • Loading branch information
megawebmaster committed Sep 16, 2014
1 parent 3ad4b0e commit c35863c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## Changelog

* 1.11.9:
* 1.11.9 - 2014-09-16:
* Fix: EU VAT handling for same country orders.
* Fix: Tax for shipping is properly added on new orders using PayPal standard.
* 1.11.8 - 2014-09-12:
* Fix: Paying for pending orders.
* Fix: Proper checkbox saving in admin panel.
Expand Down
16 changes: 15 additions & 1 deletion classes/jigoshop_order.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function get_total_tax($with_currency = false, $with_price_options = true
foreach ($this->get_tax_classes() as $tax_class) {
$order_tax += $this->order_tax[$tax_class]['amount'];
}
$order_tax += (float)$this->_fetch('order_shipping_tax');
$order_tax += $this->get_shipping_tax();
}

if ($with_price_options) {
Expand Down Expand Up @@ -608,4 +608,18 @@ public function reduce_order_stock()
}
$this->add_order_note(__('Order item stock reduced successfully.', 'jigoshop'));
}

private function get_shipping_tax()
{
$tax = (float)$this->_fetch('order_shipping_tax');
if ($tax == 0 && isset(jigoshop_session::instance()->chosen_shipping_method_id) && isset(jigoshop_session::instance()->selected_rate_id)) {
foreach($this->get_tax_classes() as $class) {
if (isset($this->order_tax[$class][jigoshop_session::instance()->chosen_shipping_method_id.jigoshop_session::instance()->selected_rate_id])) {
$tax += (float)$this->order_tax[$class][jigoshop_session::instance()->chosen_shipping_method_id.jigoshop_session::instance()->selected_rate_id];
}
}
}

return $tax;
}
}
5 changes: 3 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: Jigoshop
Tags: e-commerce, wp e-commerce, ecommerce, wordpress ecommerce, store, shop, shopping, cart, checkout, widgets, reports, shipping, tax, paypal, jigoshop, shipping, inventory, stock, online, sell, sales, weights, dimensions, configurable, variable, downloadable, external, affiliate, download, virtual, physical
Requires at least: 3.8
Tested up to: 4.0
Stable tag: 1.11.8
Stable tag: 1.11.9

A feature-packed eCommerce plugin built upon WordPress core functionality ensuring excellent performance and customizability.

Expand Down Expand Up @@ -113,8 +113,9 @@ However, if you want priority, dedicated support from Jigoshop staff, we dp offe

== Changelog ==

= 1.11.9 =
= 1.11.9 - 2014-09-16 =
* Fix: EU VAT handling for same country orders.
* Fix: Tax for shipping is properly added on new orders using PayPal standard.

= 1.11.8 - 2014-09-12 =
* Fix: Paying for pending orders.
Expand Down

0 comments on commit c35863c

Please sign in to comment.