Commit Graph

6116 Commits

Author SHA1 Message Date
Peter 0cc33c8186 Use !== instead of != in class-wc-ajax.php
Use !== here: if ( wc_tax_enabled() && $is_vat_exempt !== 'yes' ) {
2016-02-18 20:29:10 +01:00
Peter 516602b4e3 API should accept bool in is_vat_exempt
Add ? 'yes' : 'no' to force values. API should accept bool here: 
update_post_meta( $order->id, '_is_vat_exempt', $data['is_vat_exempt'] ? 'yes' : 'no' );
2016-02-18 20:14:07 +01:00
Peter b508a6f19f Remove space before bracket in class-wc-ajax.php
remove space before bracket here: $is_vat_exempt = get_post_meta( $order_id, '_is_vat_exempt', true );
2016-02-18 19:57:55 +01:00
Peter de1ecf9f78 Use === instead of == in abstract-wc-order.php
Use === here: 	if ( 'yes' === $this->is_vat_exempt or ! wc_tax_enabled() )
2016-02-18 19:56:55 +01:00
Peter 01e55cd7a4 is_vat_exempt and wc_tax_enabled handling in ajax
Tax is calculated in front-end only if tax is enabled and order is not vat exempted.
2016-01-05 21:43:26 +01:00
Peter c5e3e018c3 is_vat_exempt and wc_tax_enabled handling in abstract-wc-order
If is_vat_exempt is 'yes', or wc_tax_enabled is false, then do not calculate tax.
2016-01-05 21:36:06 +01:00
Peter ba32ce62ba is_vat_exempt data in API Orders
Save and get is_vat_exempt data in API Orders
2016-01-05 21:24:43 +01:00
Peter fc5e1ded54 Revert "Orders API tax exempt status"
This reverts commit 41b6ae07ed.
2016-01-05 21:18:03 +01:00
Peter 41b6ae07ed Orders API tax exempt status
At this moment we cannot find a way how to create an order using the Orders API with tax exempt status. An additional “is_vat_exempt” API field could be used for this reason. If it is set and true then VAT is not calculated.
2015-12-30 15:30:40 +01:00
Peter 36b3fdcc68 VAT exempt and TAX enabled handling in back-end
Additional condition for checking if tax is enabled and there is not vat exempt. If this is true, then calculate taxes on front-end, otherwise not.
TAX exempt can be filtered by a new woocommerce_ajax_calc_line_taxes_is_vat_exempt filter.
2015-12-30 15:20:09 +01:00
Mike Jolley 03ba8539f6 Stop coupon logic when 0 is hit so coupons can apply to other lines
Fixes #9870
2015-12-29 13:16:43 +00:00
Claudio Sanches 3cbe88082f Fixed simplify commerce admin notices position, closes #9911 2015-12-28 16:07:05 -02:00
Mike Jolley c1b8a20d39 Order attributes by name
Closes #9879
2015-12-27 21:32:55 +00:00
Mike Jolley 1eb9f83f77 Hide attributes and shipping classes from quick edit
Closes #9882
2015-12-24 12:16:02 +00:00
Mike Jolley 0b678ab2af Tweak save logic to set _price for variables/groups via sync functions only
Closes #9892
2015-12-23 13:08:45 +00:00
Mike Jolley 9db40dcda0 Merge remote-tracking branch 'origin/master' 2015-12-23 12:51:06 +00:00
Mike Jolley 4bf40cedb1 Tweak logic 2015-12-23 12:50:28 +00:00
Mike Jolley 9a700f8b48 Merge pull request #9891 from capuderg/master
Added a filter for disabling automatic redirect to the setup wizard
2015-12-23 12:32:51 +00:00
Peter 00341a30b3 Revert "[API] Additional hooks in API Orders"
This reverts commit fb798aca49.
2015-12-22 23:55:03 +01:00
Peter fb798aca49 [API] Additional hooks in API Orders
Add some additional hooks to handle custom order data

The new hooks:
woocommerce_api_create_order_item
woocommerce_api_set_order_addresses
woocommerce_api_set_line_item

The new woocommerce_api_create_order_item action contains the id-s of the new items ($new_item_id). The following functions have to be returned the item id-s to be able to pass them to the filter:
* set_item(..) function - return $item_id; 
* set_line_item(..) function - return $item_id;
* set_shipping(..) function - return $shipping_id;
* set_fee(..) functuion - return $fee_id;
* set_coupon(..) functuion - return $coupon_id;
2015-12-22 23:49:01 +01:00
Caleb Burks bedcedcc3d Sanitize the shipping tax class 2015-12-22 08:59:42 -06:00
Gregor Capuder f785561f5f Added a filter for disabling automatic redirect to the setup wizard, after plugin activation. 2015-12-22 12:03:31 +01:00
Peter 458c755b5f Update abstract-wc-order.php
If the order has no shipping line, there must not generate an unnecessary shipping tax line with 0 value. It was happened if there is set a different tax class for shipping than tax classes of the actual product line items of the order, and the order has not got any shipping line.
The aim is to have the same tax calculation behavior if we create orders using the GUI (front end or back end), and the API.

This condition prevents to create the unnecessary tax line if there is no shipping methods of the order:

// Now calculate shipping tax
$matched_tax_rates = array();
$shipping_methods = $this->get_shipping_methods();
if ( ! empty( $shipping_methods ) ) {
	......
}


This conditional solution is similar than calc_line_taxes() in WC_AJAX class:

// Get shipping taxes
if ( isset( $items['shipping_method_id'] ) ) {
	.....
}
2015-12-21 23:42:59 +01:00
Claudio Sanches 997d1caa50 Fixed several new variations admin actions, closes #9886 2015-12-21 03:36:36 -02:00
Claudio Sanches a81f0f6eea Use blockui while saving taxes 2015-12-19 12:12:31 -02:00
Claudio Sanches 7adafc77c9 [API] Improved product attribute terms params 2015-12-18 21:39:30 -02:00
Claudio Sanches d85c643150 [API] Delete tax rates when deleting a tax class 2015-12-18 20:46:28 -02:00
Claudio Sanches b8a6090d05 [API] Fixed tax rate id type 2015-12-18 19:15:56 -02:00
Claudio Sanches 032265b1ed [API] Fixed build taxes return 2015-12-18 19:08:09 -02:00
Claudio Sanches 89581d1541 Setup Wizard and no Onboarding Wizard 2015-12-18 17:05:16 -02:00
Mike Jolley 8cde0cbcb1 Merge pull request #9876 from reigelgallarde/patch-1
adding $loop_name to woocommerce_shortcode_products_query filter
2015-12-18 11:57:01 +00:00
Mike Jolley bf06b6d7c3 Filter non-images from gallery
Fixes #9875
2015-12-18 11:55:51 +00:00
Reigel Gallarde f8dd887001 Update class-wc-shortcodes.php
adding $loop_name to woocommerce_shortcode_products_query filter.. so that we have a way to add a filter to a specific shortcode that uses product_loop.
2015-12-18 13:43:03 +09:00
Mike Jolley c7e104115f unused code 2015-12-17 12:58:02 +00:00
Claudio Sanches c04443c2d3 Added upgrade script for #9868
cc @mikejolley
2015-12-17 08:30:06 -02:00
Claudio Sanches b2712d6ae8 Merge pull request #9868 from shivapoudel/lao-kip-symbol
Updated the currency code for 'Lao Kip'
2015-12-17 08:13:32 -02:00
Claudio Sanches b03280e230 [API] Manage product order_menu, closes #9866 2015-12-17 08:08:17 -02:00
Nicola Mustone 7ed6eb2cb9 typo 2015-12-17 08:23:58 +01:00
Shiva Poudel 4146558fd6 Updated the currency code for 'Lao Kip'
See: https://en.wikipedia.org/wiki/ISO_4217
2015-12-17 11:52:38 +05:45
Claudio Sanches f7ef9c0cec [API] Stop unset things in API 2015-12-16 16:46:31 -02:00
Claudio Sanches 55e4ef50b9 [API] Fixed errors and improved edit product categories endpoint 2015-12-16 16:44:41 -02:00
Claudio Sanches ee990de153 [API] Fixed errors and improved create product category endpoint 2015-12-16 16:35:46 -02:00
Claudio Sanches e097ff7b56 Oops 2015-12-16 14:25:11 -02:00
Claudio Sanches b2eadf0322 Better way to handle currency symbols
cc @mikejolley
2015-12-16 13:23:44 -02:00
Mike Jolley 8aec02f625 Remove shipping select box option, tidy up logic and add filters from #9797
closes #9797
2015-12-16 13:00:16 +00:00
Mike Jolley 9aee0ac1cb Functions and filters to determine which coupons need product and cart validation rules.
Closes #9854
2015-12-16 11:47:56 +00:00
Mike Jolley 992f1176bd wc_get_template_part filter should always run regardless of whether a matching template was found.
Closes #9851
2015-12-16 11:28:34 +00:00
Fulvio Notarstefano d7d70298c5 #9857 change get_class to 2015-12-16 14:25:17 +08:00
Claudio Sanches c001d5b274 Make tooltips consistent, closes #9856 2015-12-16 03:38:53 -02:00
Claudio Sanches b7b6254bf4 [CLI] Added docs about product reviews fields 2015-12-15 15:36:57 -02:00