Commit Graph

5273 Commits

Author SHA1 Message Date
Mike Jolley 318f399081 Small tidy for scruitinizer 2015-08-10 14:56:02 +01:00
Mike Jolley d3f0fd1bb3 Correct docblocks 2015-08-10 14:42:10 +01:00
Mike Jolley 41e8cf74fb Unused vars 2015-08-10 14:40:14 +01:00
Mike Jolley f687a5a059 When setting up flat and international shipping during wizard, set availability based on base country 2015-08-10 11:03:36 +01:00
Mike Jolley 257010695e Readme, versions, develop blog links 2015-08-10 10:39:08 +01:00
Brent Shepherd a826330ad0 Reinstate default value for $items
That was (accidentally?) removed with SHA: 877e39064

Fixes "PHP Notice:  Undefined variable: items" when attempting to get
line items of a type that does not exist on the order, like coupons.
2015-08-07 12:12:08 -07:00
Claudio Sanches 8bc5e9e284 Merge pull request #8747 from thenbrent/add_api_permissions_filter
Add permissions in scope filter
2015-08-07 15:25:00 -03:00
Brent Shepherd 1681b0f9d5 Add permissions in scope filter
To allow extensions to display the permissions API keys will provide
for their objects, in addition to the permissions for core WC objects.
2015-08-07 11:19:21 -07:00
Claudio Sanches e9acb4f7cf Fixed api keys migration for 2.4, closes #8746 2015-08-07 15:15:34 -03:00
Doug Smith 46536b6374 Minor grammar fixes to the update welcome message 2015-08-07 11:21:49 -05:00
Claudio Sanches 0a657fdd96 Added missing dot 2015-08-07 10:37:45 -03:00
Claudio Sanches 38aa17b67b Fixed hardcoded string 2015-08-07 10:27:40 -03:00
Claudio Sanches c0179c8bb2 Fixed a typo/extra end of line 2015-08-07 10:18:30 -03:00
Mike Jolley 877e390646 Remove $type from prepare 2015-08-07 14:06:19 +01:00
Mike Jolley d6ceec0817 Flip esc_like and esc_sql, add % 2015-08-07 13:54:50 +01:00
Mike Jolley 800ae12552 Merge pull request #8742 from thenbrent/fix_truncated_key
Fix truncated_key value inserted on visual authentication request
2015-08-07 11:45:40 +01:00
Mike Jolley 5c9ac6a893 Avoid double escape when passing in arrays to sql queries. Use esc_sql 2015-08-07 11:37:19 +01:00
Mike Jolley c5cba283ed Remove numbered arguments from queries 2015-08-07 11:37:19 +01:00
Mike Jolley fcbdd35223 Clean and escape API search 2015-08-07 11:37:19 +01:00
Mike Jolley 4c8ef3ff33 Use esc_sql on item type instead of esc_attr 2015-08-07 11:37:19 +01:00
Brent Shepherd 19a91e3afc Fix truncated_key value inserted on visual auth
When inserting a new set of API keys via the visual API endpoint, only 5 format
values were specified in the 3rd param passed to the $wpdb->insert(); however,
6 values were specified in the 2nd param. This meant that the truncted_key value
was being formatted as an integer only the first numerical characters of the last
7 character of the consumer key were being stored. For example, given a consumer
key value of ck_e91f2aeae6c3dea3045293a3dbdf55c317ad762c the truncated_key value
should be 7ad762c but instead, it was being stored at 7.
2015-08-06 17:40:17 -07:00
Mike Jolley ddd97b64c3 Remove white space to fix appearance of new rows
Fixes #8730
2015-08-06 11:38:46 +01:00
Mike Jolley b91ccd32b9 Tweak wildcard tax handling to deal with 9 digit zip codes
Fixes #8736
2015-08-06 11:36:02 +01:00
Shiva Poudel 0d1c2dc4dc Fix - calls for esc_* 2015-08-06 02:04:21 +05:45
George Stephanis 9269fd7432 Retooling how this is escaped.
Sanitize early, escape late.  Rather than double escaping, I figured
it’d be better to sprintf it in, and then escape that string — closer
to the output.

Also, I’m not sure why `urlencode` was used to escape a name?
2015-08-05 15:18:47 -04:00
George Stephanis c938fa24da More missing esc_attr calls, :( 2015-08-05 15:17:52 -04:00
Claudio Sanches b091f12393 Fixed some js conding standards 2015-08-05 15:57:15 -03:00
George Stephanis 95e6b84fbb Make sure we esc_attr translation results
Part 2 of … 2, I think.
2015-08-05 14:15:00 -04:00
George Stephanis 29d9a7da8c Found two missing `esc_js()` calls as well. 2015-08-05 14:10:10 -04:00
George Stephanis c7ee929325 Partial _e() => esc_attr_e() changeover.
There’s a lot of them, so I’m breaking them into multiple commits.

This is safeguarding stuff in case some translation uses a double
quote, it will no longer risk breaking out of the attribute.
2015-08-05 14:10:09 -04:00
Claudio Sanches 47492fb273 Merge branch 'master' of github.com:woothemes/woocommerce 2015-08-05 15:03:05 -03:00
Claudio Sanches 054dfe0c7b Changed default Underscore's template for wp.template in API Keys 2015-08-05 15:02:55 -03:00
Mike Jolley 7f3c2a78c5 Get total functions should respect rounding settings.
Closes #8707
2015-08-05 14:33:53 +01:00
Mike Jolley 737769174e Customer class using wrong meta keys for address_1/shipping_address_1
Fixes #8717
2015-08-05 14:05:03 +01:00
Mike Jolley e8ea978e9e Merge pull request #8697 from JeroenSormani/define-ajax
Define DOING_AJAX early
2015-08-05 13:53:40 +01:00
Mike Jolley afd0e9edd4 Pass $this to filters
#8722
2015-08-05 13:49:27 +01:00
Mike Jolley ccbe22164b Merge pull request #8722 from SiR-DanieL/cross-up-sells
Added cross and up sells IDs filters
2015-08-05 13:48:46 +01:00
Mike Jolley c97f845d7f Merge pull request #8727 from SiR-DanieL/order-items-fix
Fix possible fatal error on the order admin page
2015-08-05 13:48:11 +01:00
Mike Jolley d222dd4c37 Don't apply product discount if price is already 0
Closes #8725
2015-08-05 13:45:32 +01:00
Nicola Mustone bfb0aa95b3 fix possible fatal error on the order admin page 2015-08-05 14:10:23 +02:00
Nicola Mustone 9822edda0b better naming 2015-08-05 13:54:20 +02:00
Nicola Mustone 9140ca0f76 added cross and up sells IDs filters 2015-08-05 11:01:47 +02:00
Claudio Sanches 2954707118 Fixed rest_api_allowed_post_types filter 2015-08-04 13:49:24 -03:00
Claudio Sanches 8bcc926c63 Allowed products into wp.com rest api to enable jetpack related posts feature, closes #8712 2015-08-03 18:36:25 -03:00
Mike Jolley d6bd46c55d Move expand_item_meta to own method
Fixes notices in some extensions (deposits)
2015-08-03 13:21:44 +01:00
Mike Jolley ef798921aa woocommerce_can_reduce_order_stock filter
Needed for extension (deposits)
2015-08-03 10:37:58 +01:00
toddlahman 50d659f380 fix for array_filter() expects parameter 1 to be array, boolean given
array_filter() expects parameter 1 to be array, boolean given
/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-duplicate-
product.php(171)

$exclude is evaluated as a boolean.
2015-08-02 00:35:58 -07:00
Fredrik Rossland 841beb95a6 Found a typo, "Permissons"
Changed "Permissons" to "Permissions"
2015-08-01 19:42:10 +02:00
Brent Shepherd 501f0b752f Save product type before saving variations
WooCommerce prior to WC 2.4 saved the product type before any variations were saved because
WC_Meta_Box_Product_Data::save_variations() was called by WC_Meta_Box_Product_Data::save().
However, in WC 2.4 the variations are saved independently of other data about the containing
variable product, including product type. Because the product type hasn't been saved yet,
extensions that need to save their own variation level meta data can't know when saving
variations if the product is of the type they want to act on. They also can't check `$_POST`
to find out when saving variations, because 'product-type' isn't passed to that as it's
variable level meta data, not variation level meta data.

This patch passes the product type along with the variation level meta data when saving variations.
It then uses that to save the product type if the variable product has not yet been saved (and
therefore the product type has never been stored, which means calling get_product() would instantiate
a 'simple' product, as that is the default product type). This can lead to fatal errors if callbacks
expect the product type to be variable and attempt to call methods that only exist on those product
types, like variable_product_sync().

It will also update the product type if it was previously saved but has since changed. This prevents
fatal errors like that mentioned above but caused by switching from one product type, like a simple
product, to another, like a variable product.
2015-07-31 11:42:21 -07:00
JeroenSormani 2c81a71f04 Define DOING_AJAX early 2015-07-31 20:15:17 +02:00
Mike Jolley e7dfff8687 Update wording and add tooltip
#8690
2015-07-31 17:14:28 +01:00
Mike Jolley 61cb48afd7 Tweak wc ajax to post to the CURRENT URL rather than a fixed endpoint 2015-07-31 12:56:27 +01:00
Mike Jolley 82f50cedb0 Allow menu_order sorting like in 2.3
Also allow setting manually to allow sorting between pages.

Fixes #8690
2015-07-31 12:39:23 +01:00
Mike Jolley 763c7dde35 Fix product image size saving
Fixes #8695
2015-07-31 11:29:04 +01:00
Claudio Sanches a215c4ed3c [API] Fixed variation without parent for v2 2015-07-30 21:53:00 -03:00
Claudio Sanches a42b25ec4e Merge pull request #8692 from Nils-Fredrik/master
Fix for #8691: Variation without parent will not cause 500.
2015-07-30 21:51:13 -03:00
Claudio Sanches 6c4893e0b2 Introduces the woocommerce_ajax_admin_get_variations_args filter, closes #8690 2015-07-30 19:11:53 -03:00
nils-fredrik@maksimer.no f4db67bcbc Fix for #8691: Variation without parent will not cause 500. 2015-07-30 23:32:24 +02:00
Claudio Sanches 09145181e5 [API] Removed deprecated products/sku endpoint 2015-07-30 17:35:14 -03:00
Claudio Sanches 002b5df763 Merge branch 'master' of github.com:woothemes/woocommerce 2015-07-30 15:07:52 -03:00
Claudio Sanches 0361a10e26 Removed instances of WC_Order in favor to wc_get_order(), closes #8689 2015-07-30 15:07:34 -03:00
Mike Jolley 64d38f6dd8 STOCK STATUS field for variations should never be hidden
Fixes #8687
2015-07-30 15:45:05 +01:00
Mike Jolley 622dc777f0 Correct number format in coupon total 2015-07-30 12:52:52 +01:00
Claudio Sanches b28c6db7f5 Added button to dismiss variation error notices 2015-07-29 19:56:33 -03:00
Mike Jolley 7b2aec4791 Take item qty into consideration when refunding orders
Fixes #8675
2015-07-29 13:13:41 +01:00
Mike Jolley b0ee9a8cc6 Handle text vs select attribute names vs slugs 2015-07-29 10:58:28 +01:00
Claudio Sanches ef5f41d748 Fixed textdomain for api key last access unknown, closes #8672 2015-07-28 12:44:20 -03:00
Mike Jolley 060fb16e2e Move Pre 2.4 handling for attributes - DRY
@claudiosmweb @franticpsyx
2015-07-28 16:20:51 +01:00
Mike Jolley 6626c68175 When syncing OLD products, update the attributes to 2.4 standard 2015-07-28 15:13:25 +01:00
Mike Jolley f19ba7a755 Send line item when no name is set
Closes #8666
2015-07-28 11:41:37 +01:00
Mike Jolley eb19532165 Show 'fee' label is empty 2015-07-28 11:32:53 +01:00
Mike Jolley e4a8602490 filter: woocommerce_widget_cart_is_hidden
Closes #8670
2015-07-28 11:06:31 +01:00
Mike Jolley 1b45bcde0b URL encode to preserve text attributes in permalinks 2015-07-28 10:37:24 +01:00
Mike Jolley 808c01cb90 Added woocommerce_single_variation hook for variation data and cart button to reduce code in template file and used hooks. @claudiosmweb
Removed woocommerce_before_variations_button @Ninos. Use
woocommerce_single_variation
2015-07-28 10:32:28 +01:00
WordCommerce 19205ec0e6 [2.4] Removed API status notification on the Settings 2015-07-27 23:59:08 +03:00
Claudio Sanches 30f9d81916 Fixed row actions to support WordPress 4.3, closes #8578 2015-07-27 16:14:41 -03:00
Mike Jolley 02243623ba Correct key for stock level
#8605
2015-07-27 19:07:11 +01:00
Mike Jolley 794af1c013 When the stock level is changed via update_post_meta ensure the stock_status is kept in sync
Closes #8605
2015-07-27 19:04:08 +01:00
Claudio Sanches b0ce578541 Show errors for admin ajax variations 2015-07-27 14:16:52 -03:00
Mike Jolley 236b493f3d Removed extract 2015-07-27 17:48:31 +01:00
Mike Jolley 7c9cae830a Populate variation_data with valid attributes only
@claudiosmweb
2015-07-27 17:48:30 +01:00
Mike Jolley 554a7f8141 Merge pull request #8657 from thenbrent/simplify_subscriptions_2_0
Update Simplify Commerce for Subscriptions v2.0
2015-07-27 16:57:03 +01:00
Mike Jolley 4d14ac8134 Missing closing tag 2015-07-27 16:50:55 +01:00
Mike Jolley 8d6858bb80 Sanitize not needed 2015-07-27 16:43:05 +01:00
Mike Jolley 9a7893ba23 Moved variation dropdowns logic into wc_dropdown_variation_attribute_options() 2015-07-27 16:42:22 +01:00
Mike Jolley 2ea6a2efab Merge branch 'pr/8607' 2015-07-27 13:17:27 +01:00
Mike Jolley 973c3d1d7a Tweak meta_is_product_attribute conditional to check for the existence of the get_variation_attributes method before running.
Closes #8660
2015-07-27 13:03:04 +01:00
Mike Jolley b425b9bce6 Avoid extract to keep original $file_path intact
Closes #8636
2015-07-27 12:44:29 +01:00
Mike Jolley 0ab151562a Fix issues with trailing slashes on permalinks
Closes #8658
2015-07-27 11:56:07 +01:00
Mike Jolley dcd273d343 Rename transient - 45 chars is max legnth 2015-07-27 10:57:14 +01:00
Claudio Sanches 506f87f138 Removed post filter count, closes #8654 2015-07-24 22:36:51 -03:00
Brent Shepherd aaaa5720f3 Simplify: Add support for multiple subscriptions
Nothing to see here. Easiest feature support ever.
2015-07-24 18:18:00 -07:00
Brent Shepherd 694929b0bf Simplify: Update change failling payment method
For Subscriptions v2.0.

 * Use new 'woocommerce_subscription_failing_payment_method_updated_' hook
 * Use new wcs_is_subscription() method to run process_subscription() when the
   transaction is for a subscription object.
 * Save the card and customer IDs on the 'shop_subscription' post from the renewal
   order rather than saving it on the order which purchased the subscription.
2015-07-24 18:17:57 -07:00
Brent Shepherd e6ccf437e9 Simplify: Update order_contains_subscription()
To use Subscriptions 2.0 methods to avoid deprecated notices and move
use of old methods to WC_Addons_Gateway_Simplify_Commerce_Deprecated
2015-07-24 18:17:57 -07:00
Brent Shepherd 73999c5daf Simplify: Remove meta from resubscribe orders
In Subscriptoins v2.0. Also deprecate the removal of it in 1.n, where
resubscribe orders were called "parent renewal orders".
2015-07-24 18:17:57 -07:00
Brent Shepherd 089485b3bf Simplify: Update renewal payments for Subs v2.0
* Add new save_subscription_meta() method to allow us to save customer ID both
  in Subscriptions 1.n on the original order and in 2.0 on the subscription/s
  created for the order)
* Use the new 'woocommerce_scheduled_subscription_payment_simplify' hook and
  deprecate use of the old 'scheduled_subscription_payment_simplify' hook by
  moving it to the WC_Addons_Gateway_Simplify_Commerce_Deprecated class
* Use core WC methods on the renewal order passed to scheduled_subscription_payment()
  to process the payment rather than having to call special Subscriptions API methods
  like WC_Subscriptions_Manager::process_subscription_payments_on_order() and
  WC_Subscriptions_Manager::process_subscription_payment_failure_on_order()
* Use the original order's total to determine the amount to charge up-front to
  save having to call WC_Subscriptions_Order::get_total_initial_payment()
* Use a description for recurring payments that is consistent with standard orders,
  i.e. "{Site Name} - Order {order_id}" instead of a description that does not include
  the renewal order's ID. This helps link payments to orders (which can then be traced
  to subscription/s).
2015-07-24 18:17:36 -07:00
Brent Shepherd 4c8e3788b3 Simplify: Support admin payment method changes
A new feature of Subscriptions v2.0.
2015-07-24 18:17:28 -07:00
Brent Shepherd e689fe8f15 Add WC_Addons_Gateway_Simplify_Commerce_Deprecated
To manage compatibility with Subscriptions 1.n
2015-07-24 18:06:35 -07:00
Tamara Zuk 1bd4cf8fad Define new `WC_DOING_AJAX` constant
This constant will allow extensions to selectively load files etc.
during a WC AJAX request.
2015-07-24 15:50:50 -04:00
Brent Shepherd c8405d3d29 Remove deprecated comments and commented out code
Because WC_Meta_Box_Product_Data::save_variations() doesn't need to be
deprecated.
2015-07-23 22:24:07 -07:00