{"id":1766,"date":"2018-02-19T08:34:58","date_gmt":"2018-02-19T13:34:58","guid":{"rendered":"http:\/\/www.thatsoftwareguy.com\/blog\/?p=1766"},"modified":"2018-09-01T17:39:42","modified_gmt":"2018-09-01T21:39:42","slug":"zen-cart-edit-orders-and-my-discounting-mods-2","status":"publish","type":"post","link":"https:\/\/www.thatsoftwareguy.com\/blog\/2018\/02\/19\/zen-cart-edit-orders-and-my-discounting-mods-2\/","title":{"rendered":"Zen Cart Edit Orders and my Discounting Mods"},"content":{"rendered":"<p>Recent versions of Zen Cart Edit Orders (4.3.1, for example) will get the wrong total for orders using my discounting mods (such as <a href=\"https:\/\/www.thatsoftwareguy.com\/zencart_better_together.html\">Better Together<\/a>) when they edit an order.\u00a0 \u00a0The order is too low by the amount of the tax on the discount.\u00a0 For example, at a tax rate of 7%, a discount of $25 would produce an order total that was $1.75 too low &#8211; for example, $506.50 instead of $508.25.<\/p>\n<p>The fix is to change the function process() in the code file in includes\/modules\/order_total (e.g. includes\/modules\/order_total\/ot_quantity_discount.php for Quantity Discounts) as follows:<\/p>\n<pre class=\"bbcode_code\">  \r\nif ($this-&gt;calculate_tax != 'VAT') {\r\n     $order-&gt;info['total'] -= $od_amount[$key];\r\n}\r\n<\/pre>\n<p>to<\/p>\n<pre class=\"bbcode_code\">               \r\nif (!IS_ADMIN_FLAG) {\r\n   if ($this-&gt;calculate_tax != 'VAT') {\r\n      $order-&gt;info['total'] -= $od_amount[$key];\r\n   }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Recent versions of Zen Cart Edit Orders (4.3.1, for example) will get the wrong total for orders using my discounting mods (such as Better Together) when they edit an order.\u00a0 \u00a0The order is too low by the amount of the tax on the discount.\u00a0 For example, at a tax rate of 7%, a discount of &hellip; <a href=\"https:\/\/www.thatsoftwareguy.com\/blog\/2018\/02\/19\/zen-cart-edit-orders-and-my-discounting-mods-2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Zen Cart Edit Orders and my Discounting Mods<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,58,78],"tags":[],"class_list":["post-1766","post","type-post","status-publish","format-standard","hentry","category-discounting","category-that-software-guy","category-zen-cart"],"_links":{"self":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/comments?post=1766"}],"version-history":[{"count":1,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1766\/revisions"}],"predecessor-version":[{"id":1767,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1766\/revisions\/1767"}],"wp:attachment":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/media?parent=1766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/categories?post=1766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/tags?post=1766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}