Commit Graph

5219 Commits

Author SHA1 Message Date
George Stephanis bba6f80d9d Don't set them for unexistent rates. 2015-08-07 17:06:50 -04:00
George Stephanis 5736d66a92 Pagination now works by first, prev, next, last.
Still need to get number based pagination working.
2015-08-07 16:58:42 -04:00
George Stephanis ba1d2d7bde Add in and populate pagination template.
The buttons don’t actually do anything yet, but it outputs accurately
and inherits core styles.
2015-08-07 16:36:50 -04:00
George Stephanis 2b2a54c5dc Pass rates in as an array, not an associative array, so it's an Array in js. 2015-08-07 16:01:57 -04:00
George Stephanis c627d49460 A default placeholder to show until the rendering code replaces it. 2015-08-07 15:44:23 -04:00
George Stephanis 4874408a98 Insert placeholder divs for search and pagination. 2015-08-07 15:25:09 -04:00
George Stephanis 56dc05d80e Whitespace tweaks 2015-08-07 15:24:49 -04:00
George Stephanis 516977bd01 JSHint fixes.
The other advantage of splitting js out of php files — jshint can run
on it! :) :) :)
2015-08-07 12:10:01 -04:00
George Stephanis b030927590 Extract 'No Rows Selected' string 2015-08-07 11:58:02 -04:00
George Stephanis bd30def6a1 Whitespace tidy! 2015-08-07 11:57:48 -04:00
George Stephanis 4221c7be24 Extract the autocomplete for states and countries data.
Localize it!
2015-08-07 11:57:38 -04:00
George Stephanis 65eb16fe8a Migrate csv columns to localize script. 2015-08-07 11:47:39 -04:00
George Stephanis 974b337fbb Move js in from php template file. 2015-08-07 11:42:49 -04:00
George Stephanis 64f48f8706 Rename and tweak how js is registered.
Thanks @claudiosmweb for the suggestion to match existing conventions.
2015-08-07 11:36:38 -04:00
George Stephanis cca93cd09e Prefix template name with `wc-`
Good call, @mikejolley
2015-08-07 11:14:55 -04:00
George Stephanis 729e6c924c Big changeover to JS templating for the table.
Switching over to building the table with JS — wp.template.

We are now using the same JS template for existing rows and newly
generated rows on the fly — this should simplify things moving forward.

I’ve also started building stuff in an external JS file rather than
straight on the page.  Will continue migrating things to it and
localizing as needed.

Saved ( 2 * displayed tax rates - 1 ) db queries per page load by doing
the locations all in one query and then parceling them out in php.

More coming.
2015-08-07 11:04:55 -04:00
George Stephanis f0656e7e38 Tax Rate Search: First whack.
This is by no means complete.  A number of things need to be relocated
and optimized still, but it does a rough search, purely in JS, and
highlights the results in yellow.
2015-08-06 17:41:12 -04: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