Commit Graph

611 Commits

Author SHA1 Message Date
Mike Jolley 76b32c9aa5 WIP - Product CRUD (#12065)
* Created function to get the catalog visibility options

* First methods for WP_Product crud

* Product set methods

* Fixed several erros while setting data

* First methods for WP_Product crud

* Product set methods

* Fixed several erros while setting data

* Hardcode the get_type per product class

* Initial look through getters and setters and abstract data

* Missing var

* Add related product functions and deprecate those in class.

* No need to exclude ID

* Fixed coding standards and improved the docblocks

* Get cached terms from wc_get_related_terms()

* Fixed wrong variable in wc_get_related_terms

* Use count() instead of sizeof()

* Sanitize ids later

* Remove unneeded comments

* wc_get_product_term_ids instead of related wording and use in other places.

get_the_terms is used here and also handles caching, something
wp_get_post_terms does not.

* Clean up the abstract product class a bit, deprecate two functions we have renamed, make update & create work properly, and add some tests for it.

* Bump template version

* Handle PR feedback: Remove duplicate regular_price update, allow changing of post status for products, remove deprecation for get_title since we might still offer it as a function

* Made abstract function useful

* External Product CRUD

* _virtual meta should be 'no', not taxable, in product unit test helper

* Grouped product class

* Tests

* Move children to meta and update test

* Use get_upsell_ids

* Spacing in query

* Moving and refactoring methods

* Availability html

* Tidy/add todos

* Rename method

* Put back review functions (still todo)

* missing $this

* get_price_including_tax/excluding_tax functions

* wc_get_price_to_display

* Price handling

* [Product CRUD] Variable (#12146)

* [Product CRUD] Variable Products

* Handle PR feedback.

* [Product CRUD] Grouped Handling (#12151)

* Handle grouped product saving

* Update routine

* [Product CRUD] Product crud terms (#12149)

* Category and tag id handling

* Replace template functions

* Remove todo

* Handle default name in save function

* Product crud admin save routine (#12174)

* Initial props

* Work on admin saving

* Set/get attributes

* Atom was moaning about this before but no longer.

* Update get_shipping_class

* WC_Product_Attribute

* Use getter in admin panel

* Fix attribute saving

* Spacing

* Fix comment

* wc_implode_text_attributes helper function

* [Product CRUD] Product crud admin use getters (#12196)

* Initial props

* Work on admin saving

* Set/get attributes

* Atom was moaning about this before but no longer.

* Update get_shipping_class

* WC_Product_Attribute

* Use getter in admin panel

* Fix attribute saving

* Move settings into new files

* Refactor panels and use getters

* Use getters for variation panel

* Revert save variation changes for now

* Add todos

* Fix downloads

* REST API CRUD Updates

* Additional API updates/fixes. Added some todos

* Fix final failing tests and implementing setters/getters and attributes functionality.

* Fix comparison for is_on_sale and remove download_type from WC_Product.

* Add a wc_get_products wrapper.

* Remove the download type input from the product data metabox for downloadable products. (#12221)

* [Product CRUD] Variations - setters, getters and admin. (#12228)

* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* Feedback fixes

* Implement CRUD in the legacy REST API

* Handle PR feedback

* [Product CRUD] Getter setter proxy methods (#12236)

* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* get_prop implementation in abstract and data classes

* Implement set_prop

* Change handling

* Array key exists

* set_object_read

* Use get_the_terms() instead of wp_get_post_terms()

wp_get_post_terms() is a wrapper around wp_get_object_terms() which does not
use the object cache, and generates a database query every time it is used.

get_the_terms() however can use data from the object cache if present.

* Allow WP_Query to preload post data, and meta in wc_get_products()

Allow WP_Query to bulk query for post data and meta if more than
just IDs are requested from wc_get_products(). Reduces query count
significantly.

* [Product CRUD] Variable, variation, notices, and stock handling (#12277)

* No longer needed

* Remove old todos

* Use getters in admin list

* Related and upsells update for CRUD

* Fix notice in gallery

* Variable fixes and todos

* Context

* Price sync

* Revert variation attributes change

* Return parent data in view context

* Defer term counting

* wc_find_matching_product_variation

* Stock manage tweaks

* Stock fixes

* Correct id

* correct id

* Better sync

* Data logic setter fix

* feedback

* First methods for WP_Product crud

* Product set methods

* Fixed several erros while setting data

* Hardcode the get_type per product class

* Initial look through getters and setters and abstract data

* Missing var

* Fixed coding standards and improved the docblocks

* Get cached terms from wc_get_related_terms()

* Fixed wrong variable in wc_get_related_terms

* Use count() instead of sizeof()

* Add related product functions and deprecate those in class.

* No need to exclude ID

* Sanitize ids later

* Clean up the abstract product class a bit, deprecate two functions we have renamed, make update & create work properly, and add some tests for it.

* Remove unneeded comments

* wc_get_product_term_ids instead of related wording and use in other places.

get_the_terms is used here and also handles caching, something
wp_get_post_terms does not.

* Handle PR feedback: Remove duplicate regular_price update, allow changing of post status for products, remove deprecation for get_title since we might still offer it as a function

* External Product CRUD

* _virtual meta should be 'no', not taxable, in product unit test helper

* Bump template version

* Made abstract function useful

* Grouped product class

* Tests

* Move children to meta and update test

* Use get_upsell_ids

* Spacing in query

* Moving and refactoring methods

* Availability html

* Tidy/add todos

* Rename method

* Put back review functions (still todo)

* missing $this

* get_price_including_tax/excluding_tax functions

* wc_get_price_to_display

* Price handling

* [Product CRUD] Variable (#12146)

* [Product CRUD] Variable Products

* Handle PR feedback.

* [Product CRUD] Grouped Handling (#12151)

* Handle grouped product saving

* Update routine

* [Product CRUD] Product crud terms (#12149)

* Category and tag id handling

* Replace template functions

* Remove todo

* Handle default name in save function

* Product crud admin save routine (#12174)

* Initial props

* Work on admin saving

* Set/get attributes

* Atom was moaning about this before but no longer.

* Update get_shipping_class

* WC_Product_Attribute

* Use getter in admin panel

* Fix attribute saving

* Spacing

* Fix comment

* wc_implode_text_attributes helper function

* [Product CRUD] Product crud admin use getters (#12196)

* Initial props

* Work on admin saving

* Set/get attributes

* Atom was moaning about this before but no longer.

* Update get_shipping_class

* WC_Product_Attribute

* Use getter in admin panel

* Fix attribute saving

* Move settings into new files

* Refactor panels and use getters

* Use getters for variation panel

* Revert save variation changes for now

* Add todos

* Fix downloads

* REST API CRUD Updates

* Additional API updates/fixes. Added some todos

* Fix final failing tests and implementing setters/getters and attributes functionality.

* Fix comparison for is_on_sale and remove download_type from WC_Product.

* Add a wc_get_products wrapper.

* Remove the download type input from the product data metabox for downloadable products. (#12221)

* [Product CRUD] Variations - setters, getters and admin. (#12228)

* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* Feedback fixes

* Implement CRUD in the legacy REST API

* Handle PR feedback

* [Product CRUD] Getter setter proxy methods (#12236)

* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* get_prop implementation in abstract and data classes

* Implement set_prop

* Change handling

* Array key exists

* set_object_read

* Use get_the_terms() instead of wp_get_post_terms()

wp_get_post_terms() is a wrapper around wp_get_object_terms() which does not
use the object cache, and generates a database query every time it is used.

get_the_terms() however can use data from the object cache if present.

* [Product CRUD] Variable, variation, notices, and stock handling (#12277)

* No longer needed

* Remove old todos

* Use getters in admin list

* Related and upsells update for CRUD

* Fix notice in gallery

* Variable fixes and todos

* Context

* Price sync

* Revert variation attributes change

* Return parent data in view context

* Defer term counting

* wc_find_matching_product_variation

* Stock manage tweaks

* Stock fixes

* Correct id

* correct id

* Better sync

* Data logic setter fix

* feedback

* Prevent notices

* Handle image_id from parent

* Fix error

* Remove _wc_save_product_price

* Remove todo

* Fixed wrong variation URLs

* Fixed undefined $image_id in WC_Product_Variation::get_image_id()

* Allow wc_rest_prepare_date_response() handle timestamps

* Updated get methods on REST API for variations

* Use variations CRUD to save variations metadata

* [Product CRUD] Abstract todos (#12305)

* Get dimensions and weights, with soft deprecation

* Product attributes

* Ratings

* Fix read method

* Downloads

* Feedback

* Revert "[Product CRUD] Abstract todos (#12305)"

This reverts commit 9a6136fcf8.

* Remove deprecated get_variation_id()

* New default attributes method

* [Product CRUD] Product Datastore (#12317)

* Fix up tests in the product/* folder.

* Handle data store updates for grouped, variable, external, simple, and general data store updates for products.

* Variations & variable changes.

* Update -functions.php calls to use data store.

* Add an interface for the public product data store methods.

* Finished product factory tests

* Correctly delete in the api, fix up some comments, and implement an interface for the public variable methods.

* Fix up delete in all versions of the api

* Handle feedback

* Match protected decloration to parent

* Product crud abstract todos (#12316)

* Get dimensions and weights, with soft deprecation

* Product attributes

* Ratings

* Fix read method

* Downloads

* Feedback

* Fix up store

* Fixed method returning in write context

* Fix error in variation admin

* Check for parent value - fixes tax class

* Remove old/complete todos

* Allow set tax class as "parent"

* Removed duplicated sync

* Fixed wrong variation URLs

* Fixed undefined $image_id in WC_Product_Variation::get_image_id()

* Allow wc_rest_prepare_date_response() handle timestamps

* Updated get methods on REST API for variations

* Use variations CRUD to save variations metadata

* Remove deprecated get_variation_id()

* New default attributes method

* Fixed method returning in write context

* Allow set tax class as "parent"

* Removed duplicated sync

* Fixed coding standards

* TODO is not accurate.

* Should pass WC_Product instancies to WC_Comments methods (#12327)

* Use new method in abstract order class to prevent headers sent issue in tests

* Fixed variable description in REST API

* Updated how create initial product variation

* Fixed a few fatal errors and warnings in Products CRUD (#12329)

* Fixed a few fatal errors and warnings in Products CRUD

* Fixed sync functions

* Add variations CRUD to legacy API (#12331)

* Apply crud to variable products in legacy API v1

* New REST API do not need fallback for default attributes

* Apply variations CRUD to legacy API v2

* Legacy v2 - save default attributes

* Variations in legacy API v2 do not have descriptions

* Fixed legacy API v2 variations params

* Applied variations CRUD to legacy API v3

* Sync before save in legacy apis

* Punc

* Removed API todos

* Removed test

* Products endpoint tweaks (#12354)

* Var type already normalized on CRUD

* Let Product CRUD handle with validation, sanitization and conditional checks

* Set downloads using WC_Product_Download

* Stop try catch exceptions more than one time

* Handle WC_Data_Exception in legacy API

* Complete remove products when fails on creating

* On creating I mean!

* Already have a method to complete delete products

* Fixed standards using WP CodeSniffer

* get_the_terms() returns false when empty

* get_manage_stock returns boolean

@claudiosanches

* Merge conflict

* Variations API endpoint fixes

* Product CRUD improvements (#12359)

* args is not used any more - remove todo

* Added test for attributes

* wc_get_price_excluding_tax usage

* parent usage

* Fix rating counts

* Test fixes

* Cleanup after tests

* Make sure status transition code runs even during API calls, not just in admin.

* Default visibility

* Fix attribute setting in API

* Use get name instead of get title

* variation id usage

* Improved cross sell templates

* variation_data

* Grouped product sync

* Notices

* Sync is not needed in API

* Delete

* Rename interfaces

* Update counts in data store
2016-11-16 12:38:24 +00:00
Sabbir Ahmed 7cd5488f26 Fix toggle download and virtual in variation bulk action #12333 2016-11-13 11:45:12 +06:00
Rami Yushuvaev 6cc301e58c add translators comments 2016-10-29 13:16:03 +03:00
Rami Yushuvaev fec057c993 Use get_admin_page_title() function to display admin titles (#12077)
*  Use get_admin_page_title() function to display admin titles

* revert

* i18n: use sprintf() in translation strings
2016-10-13 13:34:48 -03:00
Mike Jolley 0829200299 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	includes/admin/class-wc-admin-help.php
2016-10-12 11:18:27 +01:00
Rami Yushuvaev eae583fc3c Update wp.org plugin directory links 2016-10-12 11:16:58 +01:00
Claudio Sanches 657c312cae Fix strings case (#12069)
* Fixed case for all _e, esc_attr_e and esc_html_e strings

* Fixed case for all _n_noop strings

* Fixed case for all _x strings

* Fixed case for all __, esc_html__ and esc_attr__ strings

* Fixed a few more strings

* Fixed strings in unit tests

* Fix PayPal Standard case.

* Save Order text
2016-10-12 11:16:30 +01:00
Mike Jolley 321a72b957 Add missing comma 2016-10-11 11:53:47 +01:00
Mike Jolley 2d270fb405 Fix saving and rest of world 2016-10-10 18:41:07 +01:00
Mike Jolley 160049eddd Remove save button from zones screen. 2016-10-10 17:50:29 +01:00
Mike Jolley 83cc0c7066 Work on shipping zone screens 2016-09-24 03:22:57 +01:00
Aristeides Stathopoulos 734f284fa4 WordPress.PHP.YodaConditions.NotYoda 2016-09-08 01:32:24 +03:00
Aristeides Stathopoulos d4e3faf014 PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket 2016-09-02 04:51:31 +03:00
Aristeides Stathopoulos 0516e96843 PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket 2016-09-02 04:33:57 +03:00
Aristeides Stathopoulos fde1037757 fix failing tests. 2016-09-01 23:50:14 +03:00
Mike Jolley 1b2df3dd3b Merge branch 'pr/11797'
# Conflicts:
#	includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php
#	includes/api/class-wc-rest-coupons-controller.php
#	includes/class-wc-coupon.php
#	tests/unit-tests/api/coupons.php
#	tests/unit-tests/coupon/crud.php
2016-09-01 11:46:05 +01:00
Mike Jolley 7439f6d79f Use set_props 2016-08-30 17:59:41 +01:00
Aristeides Stathopoulos f2730eea02 WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd 2016-08-27 08:57:05 +03:00
Aristeides Stathopoulos 82f3cc221e WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeOpenParenthesis 2016-08-27 07:23:02 +03:00
Aristeides Stathopoulos ff852038c9 WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys 2016-08-27 06:11:30 +03:00
Aristeides Stathopoulos ec8a0b288b PHPCS: WordPress.Arrays.ArrayDeclaration.NoCommaAfterLast 2016-08-27 05:08:49 +03:00
Aristeides Stathopoulos b063bcfe4c last item in a multiline-array should end in a comma 2016-08-27 04:46:45 +03:00
Mike Jolley b4e05154d7 Error handling for adding items 2016-08-25 14:22:27 +01:00
Mike Jolley 938361535f Exception handling 2016-08-24 16:02:19 +01:00
Mike Jolley 2cea613566 Fix shipping meta save
#11601
2016-08-22 18:07:52 +01:00
Mike Jolley 7cf75f5085 Remove use of deprecated functions 2016-08-22 16:57:54 +01:00
Mike Jolley 95b11606fc get_product_from_item -> get_product 2016-08-22 16:51:24 +01:00
Mike Jolley c88984eb0e Replace add methods 2016-08-22 16:48:19 +01:00
Mike Jolley 9e45927803 Create refund with crud 2016-08-22 13:15:15 +01:00
Mike Jolley 21ad196297 Use CRUD in wc_save_order_items 2016-08-19 13:43:33 +01:00
Mike Jolley 97618fa2af Made stock notes consistent
Fixes #11673
2016-08-12 10:47:01 +01:00
Mike Jolley 8d58febaf8 Merge branch 'master' into orders-crud-function-update
# Conflicts:
#	includes/class-wc-checkout.php
2016-08-09 14:03:06 +01:00
Mike Jolley a8759fc0aa Meta/product handling 2016-08-08 16:20:15 +01:00
Mike Jolley 7685587b22 payment_method 2016-08-05 16:04:41 +01:00
Mike Jolley 84c52370fa more getters 2016-08-05 15:57:40 +01:00
Justin Shreve e3b1f6dbc9 A few fixes to customer CRUD:
* Implement some missing legacy functions
* Stop calling legacy functions from some pages
* Prevent extra meta from being deleted, unless requested by the CRUD (was causing problems with user/customer)
* Prevent save when loading from session AND logged out
2016-08-04 13:13:07 -07:00
Mike Jolley 1bc9da3e91 Merge branch 'master' into WC-CRUD
# Conflicts:
#	includes/class-wc-coupon.php
2016-08-04 12:10:04 +01:00
Lee Willis 15c6389326 Delete method options when deleting method 2016-07-27 18:14:50 +01:00
Mike Jolley 53511e36ec Use permission id to revoke access to downloads to prevent removing wrong rows.
Fixes #11423 @claudiosmweb
2016-07-14 15:54:28 +02:00
danielvonmitschke 857647cc06 Added '$_product' argument to 'woocommerce_restock_refunded_item' hook
currently the hook is only using $_product->id but it might be useful
not to only know the product but also the explicit variation that was
refunded.
2016-07-01 12:53:08 +02:00
danielvonmitschke abce9cc8b6 Added a filter hook for the wc_ajax endpoint url
This might come in handy for some custom ajax implementations
2016-07-01 12:51:37 +02:00
Mike Jolley 78142a8ebb Merge branch 'master' into WC-CRUD
# Conflicts:
#	includes/class-wc-checkout.php
#	includes/class-wc-coupon.php
#	includes/class-wc-customer.php
#	tests/unit-tests/cart/cart.php
#	tests/unit-tests/cart/functions.php
#	tests/unit-tests/coupon/coupon.php
#	woocommerce.php
2016-06-13 15:01:58 +01:00
Mike Jolley 30c4d3ab77 docblock 2016-06-07 14:19:36 +01:00
Mike Jolley 548fe93a97 Make use of unused $x var 2016-06-07 14:10:23 +01:00
Mike Jolley 730019ef18 scrutinizer best practice 2016-06-06 19:39:23 +01:00
Mike Jolley 3fd15ad50f Unused vars and code docs 2016-06-06 18:57:24 +01:00
Mike Jolley d4d6f3181c Best practice tweaks 2016-06-06 17:24:31 +01:00
Mike Jolley a40fb29eca wc_set_time_limit helper function 2016-06-06 16:55:27 +01:00
Claudio Sanches e39274e753 HTTPS for everybody 2016-05-26 22:48:49 -03:00
Mike Jolley 54231c2946 Allow shipping classes interface to be extended. 2016-05-19 12:38:28 +01:00
Caleb Burks 75dfae2bf2 Return to shop if session expires and escape url. 2016-05-17 17:00:09 -05:00
Mike Jolley 986bd5abc7 Fix save and striping 2016-05-12 12:18:35 +01:00
Mike Jolley 2cc0ac294e Fix return on add_metadata
Fixes #10892
2016-05-11 15:28:40 +01:00
Joey Kudish 7f71376418 add action hooks for shipping zone method actions
Adds action hooks for shipping zone methods added, deleted and status
toggled
2016-05-10 11:43:47 -07:00
Harald Rosberg 84887409a0 added a filter to make it possible to override if an attribute is variation by default, #10869 2016-05-06 13:22:32 +02:00
Mike Jolley 4901117f64 Data must exist 2016-04-20 15:02:41 +01:00
Diego Zanella 531f644f5f Added safeguard check for shipping methods post data 2016-04-20 10:21:28 +01:00
Diego Zanella a506909822 Backward compatibility with WC 2.5 and earlier
* Slightly altered previous change to maintain the exact logic used before (i.e. the WC_Ajax class sets the POST data for the shipping method explicitly).
2016-04-20 08:49:32 +01:00
Diego Zanella ba46a5275f Backward compatibility with WC 2.5 and earlier
* Restored signature of WC_Settings_API::process_admin_options() method.
2016-04-20 08:48:29 +01:00
Mike Jolley 6ae2fea045 Allow default address to be empty.
Fixes #10664
2016-04-18 14:51:39 +01:00
Mike Jolley 70d334395d Shipping calculation in backend should be based on line items
Fixes #10718
2016-04-18 12:56:59 +01:00
Mike Jolley dd99c7fb17 Redirect to product screen if referer is missing.
Fixes #10713
2016-04-18 11:48:57 +01:00
EmilEriksen a0ae25ca24 Change AJAX add coupon generic error notice type 2016-04-12 17:07:11 +02:00
Mike Jolley d3ac3f4073 Modals first pass 2016-03-24 17:26:40 +00:00
Mike Jolley ca5a46a2f9 Allow bulk deletion of refunds 2016-03-23 16:32:12 +00:00
Mike Jolley 3205975a24 Fix manual addition of shipping to orders 2016-03-23 15:16:09 +00:00
Mike Jolley f73149feaf Tweak variation display and reenable bulk editing 2016-03-22 17:13:39 +00:00
Mike Jolley 7be2b129b6 Removed bulk actions from order items panel
Reduce/increase order item stock is less important these days do to
automatic stock reduction (when status changes) and because when you
refund items you can restock items via checkbox. Manual stock changes
can be performed by editing products.

Decreases complexity of order items box.
2016-03-21 14:58:14 +00:00
Justin Shreve ffc80ccd15 Start updating some usage, and start implementing the actual CRUD functions, and some new get/setters for username, email, etc. 2016-03-17 09:41:12 -07:00
Mike Jolley 1549158981 Add 'is_enabled' column to instances table and allow toggle in zones screen
@allendav
2016-03-15 17:23:06 +00:00
ConfusedTA 8495d98275 Add filter to output from json_search_customers
Add filter to admin ajax customer search, to allow modification of search result output via plugin or theme.
2016-03-10 12:15:44 +00:00
Mike Jolley 03872e953b [2.5] Round refund values.
Fixes #10456.
2016-03-03 13:40:50 +00:00
Mike Jolley c21b0eda82 Merge pull request #10361 from shivapoudel/ajax-customer-search
Feature to exclude certain users from ajax customer search box
2016-03-03 12:54:19 +00:00
Mike Jolley 73f71191fc [2.5] current class fix on some servers when empty 2016-02-22 15:19:44 +00:00
Mike Jolley e9703da300 Merge pull request #9921 from peterrath/vat-exempt-and-tax-enabled-handling
VAT exempt and “TAX enabled” handling in back end and Orders API
2016-02-19 14:53:39 +00:00
Peter 5a9cec18ee Indent the new if statement 2016-02-18 20:35:33 +01:00
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 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
Shiva Poudel 5fb5a7ded2 We need to check for ID in array to exclude user ID as search_columns are of different 2016-02-17 00:25:06 +05:45
Shiva Poudel a88caf5b72 Feature to exclude certain users from ajax customer search box
Closes #10360
CC @mikejolley
2016-02-16 19:40:36 +05:45
Kevin Killingsworth e99e75b5b9 Fix spacing.
Add space after !
2016-02-14 21:56:42 -06:00
Kevin Killingsworth ce90c440cb Cart ajax: apply coupon
Adds an ajax call for applying coupons while on the cart
screen (not checkout, as it already has this.)

This is the first commit to add ajax calls to the cart update
functions. See issue #6734
2016-02-12 15:43:05 -06:00
Mike Jolley 75c264837f Justins feedback/code tidy 2016-02-10 13:21:16 +00:00
Mike Jolley 352184cc06 Merge branch 'master' into shipping-zones
# Conflicts:
#	assets/css/admin.css
#	i18n/languages/woocommerce.pot
#	includes/abstracts/abstract-wc-payment-gateway.php
#	includes/abstracts/abstract-wc-shipping-method.php
#	includes/admin/settings/class-wc-settings-shipping.php
#	includes/wc-core-functions.php
#	uninstall.php
2016-02-05 14:58:48 +00:00
Mike Jolley 3b43a53546 Don't format stock if empty 2016-01-28 11:31:53 +00:00
Mike Jolley a550c77dba [2.5] Remove stock bw compat code which was preventing manage stock being disabled.
Fixes #10167
2016-01-25 18:17:28 +00:00
Mike Jolley 55c8f91c14 [2.5] Set has calculated shipping to true when setting country
Closes #10148
2016-01-25 10:16:39 +00:00
Mike Jolley a26af7b801 [2.5] Unset reload_checkout once processed.
Fixes #10134
2016-01-21 20:29:14 +00:00
Florian Ludwig 6074ea3355 Formatted variation stock with wc_stock_amount 2016-01-20 23:37:22 +01:00
Mike Jolley 6050b204fc Support qty display in cart messages
Closes #10114
2016-01-20 11:32:49 +00:00
Mike Jolley d821b87f8a Move shipping classes to custom UI in shipping section 2016-01-13 16:52:28 +00:00
Mike Jolley 8064b35350 Add methods from zones screen 2016-01-13 15:04:10 +00:00
Mike Jolley 1076854608 Merge branch 'master' into shipping-zones
# Conflicts:
#	assets/css/admin.css
#	includes/abstracts/abstract-wc-shipping-method.php
#	includes/class-wc-shipping.php
#	includes/shipping/flat-rate/class-wc-shipping-flat-rate.php
#	includes/shipping/flat-rate/includes/class-wc-eval-math.php
#	includes/shipping/free-shipping/class-wc-shipping-free-shipping.php
#
includes/shipping/legacy-international-delivery/class-wc-shipping-legacy
-international-delivery.php
#
includes/shipping/legacy-local-delivery/class-wc-shipping-legacy-local-d
elivery.php
2016-01-11 11:48:18 +00: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
Shiva Poudel a3889d1a17 Fix - Typo in docblock for 'gruoped' -> 'grouped' 2016-01-05 11:16:54 +05:45
Mike Jolley 62ca37f651 Merge branch 'master' into shipping-zones
# Conflicts:
#	includes/admin/class-wc-admin-assets.php
#	includes/class-wc-install.php
2016-01-04 14:35:45 +00: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 9aa34330ac Fix sorting and saving for methods 2015-12-16 16:09:52 +00:00
Mike Jolley 571469f44c Add methods to zones 2015-12-16 15:16:52 +00:00
Mike Jolley e25d876779 List and sort methods within zones 2015-12-15 17:48:03 +00:00
Manos Psychogyiopoulos 5597a2750b orphaned variations cause "failed to load results" issue 2015-12-12 16:37:32 +02:00
Manos Psychogyiopoulos 2a6a26f800 allow searching from predefined set and introduce search limit
Makes it possible to search from a pre-defined set of known ids without returning all results, avoiding an excessive amount of product instantiations with large result sets.
2015-12-12 14:28:45 +02:00
Mike Jolley 66d4065ae4 postcode saving 2015-12-10 18:33:59 +00:00
Mike Jolley cf5381083d Started on zone regions selector 2015-12-10 15:09:37 +00:00
Mike Jolley 41042e94a7 Sort zones 2015-12-10 12:31:03 +00:00
Mike Jolley 14eeb9f936 Zones first draft with backbone saving of zone names 2015-12-10 11:55:03 +00:00
Mike Jolley 5f940f7877 Send status headers to prevent 404s on wc-ajax
Fixes #9703
2015-11-30 12:10:31 +00:00
Mike Jolley 48f8665e2d Hide SQL errors during ajax requests
Avoids invalid JSON
2015-11-04 13:35:32 +00:00
Mike Jolley 7eb45ba16f Added wc_array_cartesian function to generate variations in a logical order.
Fixes #9515 @claudiosmweb
2015-11-04 12:14:51 +00:00
Claudio Sanches ee30b5b308 Fixed php docs standards 2015-11-03 11:31:20 -02:00
Mike Jolley 5b6e16682c Handle partial/full refund for orders containing free items
Also adds helper method to determine if such as free item exists or
not. Closes #9460
2015-10-29 15:34:33 +00:00
Biont bf4c5b1d91 Provide a filter after tax calculations are done #9313 2015-10-09 15:46:23 +02:00
Mike Jolley 0197a99065 Merge branch 'issue/8587'
Conflicts:
	assets/css/admin.css
	assets/css/woocommerce.css
	includes/admin/class-wc-admin-assets.php
	includes/admin/settings/views/html-settings-tax.php
2015-10-08 13:26:52 +01:00
Mike Jolley abaa8f47d8 Moved refund hooks to avoid emails after API refund failure 2015-10-06 14:43:36 +01:00
Mike Jolley 1f6260a880 Use tax settings in backend and default to base country
Closes #9186
2015-10-05 15:31:58 +01:00
Mike Jolley 786c87523f Improve product search and use WPDB instead of several get_posts queries
Fixes #9203 @claudiosmweb
2015-10-02 10:00:29 +02:00
Mike Jolley d4fbe0e45c Use SKU for stock order notes
Fixes #9133
2015-10-01 18:13:37 +02:00
Florian Ludwig 2d39a91fdc Add username on marking order status
At the moment the status updates via the order list action buttons are
not linked to the correct user. Lets fix that :)
2015-10-01 16:15:29 +02:00
Mike Jolley 7a3bd70c8b Allow bulk edit price to 0
Fixes #9143
2015-09-16 13:20:59 +01:00
Mike Jolley a056e3e649 Unslash key description
Closes #9068
2015-09-07 16:29:03 +01:00
Mike Jolley b111331686 Allow line breaks in non-variation attributes 2015-09-04 14:00:42 +01:00
Florian Ludwig b50a75ce23 Use wc_stock_amount for ajax response in variation admin
My previous pull request of old WC 2.3 didn’t get applied in the new
2.4 AJAX method for the variation admin. So let’s do it again ;) (old
pull request see #8304)
2015-08-28 18:17:54 +02:00
Mike Jolley 0cf74b5dba Set ajax endpoint headers like admin_ajax
@claudiosmweb does this make sense to you?
2015-08-23 21:17:03 +01:00
Mike Jolley 07b1f9329d Bulk update variation: Allow stock to be set to 0. 2015-08-21 16:48:25 +01:00
Mike Jolley bbb00d9a3a Bulk update variation manage stock when _manage_stock meta data is missing. 2015-08-21 16:33:55 +01:00
Mike Jolley ecc50f78ab Don't clean keys - avoids destroying special chars 2015-08-19 11:33:42 +01:00
Mike Jolley dc37e49c02 Suppress set_time_limit errors to prevent issues in some environments
“Warning: Cannot set max_execution_time above master value of 30 (tried
to set unlimited) in
/var/www/web1043/html/wordpress/wp-content/plugins/woocommerce/includes/
class-wc-download-handler.php on line 337</p>”
2015-08-18 13:16:25 +01:00
Mike Jolley a5a7c71aa7 Keep new variation in sync so actions can modify data Closes #8858 2015-08-17 15:11:34 +01:00
Claudio Sanches 934808fc37 Created new wc_sanitize_term_text_based() for properly sanitize term text based before save, closes #8823 2015-08-14 15:22:16 -03:00
Claudio Sanches dc666f6b27 Added missing $menu_order on WC_Ajax::add_variation() 2015-08-14 14:40:46 -03:00
George Stephanis 2aa1650f54 Rearrange things to get ajax working.
Spread them out throughout WooCommerce.
2015-08-13 17:49:59 -04:00
Mike Jolley fb64e6e66e Use wp_unslash and only decode when getting attributes, not saving 2015-08-13 13:03:51 +01:00
Mike Jolley 4908131b86 stripslashes_deep attributes 2015-08-13 12:07:05 +01:00
Mike Jolley 8f759c8af1 Order variations by menu_order by fallback to ID. 2015-08-13 10:40:50 +01:00
Mike Jolley d3e2217227 Allow errors with debug on
Closes #8805
2015-08-13 10:27:22 +01:00
Mike Jolley 19e8cc4634 display_errors > error_reporting 2015-08-12 17:45:49 +01:00
Mike Jolley 457283bc3c Ajax variations: stripslashes to fix attributes with quotes. 2015-08-12 17:08:21 +01:00
Mike Jolley 6a3f4ee969 Disable error_reporting during ajax requests to prevent malformed JSON. 2015-08-12 11:51:05 +01:00
Mike Jolley fafb6d5dca Tweak cart fix to avoid munging %%endpoint%% 2015-08-11 14:04:42 +01:00
Mike Jolley 3eedab457d return; don't break 2015-08-11 13:47:12 +01:00
Mike Jolley 1078564fca Prevent double add to cart due to ajax endpoints. 2015-08-11 11:53:36 +01:00
Mike Jolley c5cba283ed Remove numbered arguments from queries 2015-08-07 11:37:19 +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 d6bd46c55d Move expand_item_meta to own method
Fixes notices in some extensions (deposits)
2015-08-03 13:21:44 +01: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 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
Claudio Sanches 6c4893e0b2 Introduces the woocommerce_ajax_admin_get_variations_args filter, closes #8690 2015-07-30 19:11:53 -03: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 060fb16e2e Move Pre 2.4 handling for attributes - DRY
@claudiosmweb @franticpsyx
2015-07-28 16:20:51 +01:00
Claudio Sanches b0ce578541 Show errors for admin ajax variations 2015-07-27 14:16:52 -03:00
Mike Jolley 0ab151562a Fix issues with trailing slashes on permalinks
Closes #8658
2015-07-27 11:56:07 +01: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 ffdc13fb4b Remove duplication in WC_Ajax::save_variations()
And use the original WC_Meta_Box_Product_Data::save_variations() method instead.
2015-07-23 22:15:44 -07:00
Claudio Sanches 948c5c9cfc Fixed the sanitization for text-based default attributes 2015-07-22 21:40:06 -03:00
Claudio Sanches f3ac5657a4 Fixed link all variations when use text-based attributes 2015-07-22 18:57:50 -03:00
Claudio Sanches 7787673d33 Fix excluded posts ID in json_search_products() 2015-07-20 18:46:37 -03:00
Claudio Sanches 791c20ae51 Added param for exclude posts from wc-product-search, closes #8613 2015-07-20 13:41:14 -03:00
Claudio Sanches 9e41552342 Removed all "@return void" 2015-07-16 16:55:48 -03:00
Claudio Sanches 8d2a98eab1 Improved some docblocks 2015-07-16 16:29:01 -03:00
Claudio Sanches e0be5a2e9f Added truncated consumer key and last access fields in woocommerce_api_keys table 2015-07-16 15:42:00 -03:00
Mike Jolley 47c47ab93c Avoid set_time_limit error supression 2015-07-15 16:14:32 +01:00
Mike Jolley c412a2eb3e Set $post during variation addition 2015-07-14 13:49:13 +01:00
Mike Jolley 8bf1cf60c5 Set $post global so its available like within the admin screens
@claudiosmweb
2015-07-14 12:28:31 +01:00
Mike Jolley 015ace770d Split up bulk edit ajax methods 2015-07-14 11:39:48 +01:00
Max Rice a9f6f7fdfe Introduce woocommerce_order_full_refunded_status filter
In certain situations it’s undesirable to automatically change the
order status for an order that has been fully refunded. For example, an
order processed with a credit card whose charge has been authorized but
not yet captured is typically voided, not refunded since no funds have
actually been transferred. In that case, it’s ideal to allow gateways
to change the status to cancelled instead.
2015-07-10 19:51:02 -04:00
Mike Jolley 2834eff221 Merge branch 'variations-8477'
Conflicts:
	assets/js/frontend/add-to-cart-variation.js
	assets/js/frontend/add-to-cart-variation.min.js
	assets/js/frontend/add-to-cart.min.js
	assets/js/frontend/checkout.min.js
	assets/js/frontend/geolocation.min.js
2015-07-10 11:37:05 +01:00
Mike Jolley a976d8e2ba Don't add hyphens for cities
Closes #8547
2015-07-10 11:02:08 +01:00
Claudio Sanches 3394277a86 Admin variations - Set _stock_status when link all variations 2015-07-09 18:28:02 -03:00
Claudio Sanches c5ae7b18c7 Created woocommerce_ajax_save_product_variations action 2015-07-09 17:43:46 -03:00
Mike Jolley 5f8a5bcb63 We don't need get_transient_version for children transients because other products do not affect this. 2015-07-09 16:02:26 +01:00
Mike Jolley 65f19d5ca7 Ajax variation handling
If there are more variations than the threshold allows (set to 20
currently) this loads the matching variation via ajax instead of inline
in the HTML. #8477
2015-07-09 15:56:20 +01:00
Claudio Sanches 042a6644e2 Ajaxify grouped product option, closes #7751 2015-07-08 18:38:17 -03:00
Claudio Sanches bed51c6d0c Removed code test on WC_AJAX::save_variations() 2015-07-08 14:17:33 -03:00
Claudio Sanches ffef95f56f Fixed ajax variations posted data 2015-07-08 13:55:29 -03:00
Claudio Sanches 2ec12a7985 Prevent errors when variation don't have sale price dates 2015-07-08 04:05:08 -03:00
Claudio Sanches 843a55a6b5 Admin ajax variations 2015-07-07 20:53:36 -03:00
Claudio Sanches c03ea5625d Fixed the delete all variable products action 2015-07-07 19:51:50 -03:00
Claudio Sanches bbe3cb5b1b Added bulk variation edit for increase and decrease prices 2015-07-07 17:35:21 -03:00
Claudio Sanches 8b681fddf7 Created bulk edit actions for variable sale schedule 2015-07-07 16:39:59 -03:00
Claudio Sanches e69d172f6c Fixed bulk variation edit and added cases to save regular and sales prices 2015-07-07 16:07:09 -03:00
Claudio Sanches 268a696918 Initial bulk edit variations actions 2015-07-06 22:50:35 -03:00
Claudio Sanches de01133142 Save only updated/edited variations and fixed the variations sync and product cache/transients 2015-07-06 19:07:01 -03:00
Claudio Sanches ae18af8cc7 Added method to save variations via ajax 2015-07-06 01:50:20 -03:00
Claudio Sanches c3b5ad2337 Refactored the link all variations, remove variation and add variation methods 2015-07-05 23:55:08 -03:00
Mohaiminul Islam 653bb17414 Add new parameter on refund deleted hook
This hook parameter dose not helps to get order id when trigger in action due to delete that post. This should add '$order_id' as parameter
2015-07-04 15:22:19 +06:00
Mohaiminul Islam 64f2e2bed0 Refund deleted hook parameter fix
This hook parameter dose not trigger in action due to delete that post. This should set '$order_id' as parameter
2015-07-04 14:17:05 +06:00
Claudio Sanches 3d59933d6b Created initial methods to load variations by ajax 2015-07-02 17:42:22 -03:00
Mike Jolley 84bc6e1b1a Merge branch 'geolocate-cache'
Conflicts:
	includes/class-wc-customer.php

Closes #7939
2015-06-23 12:26:03 +01:00
Mike Jolley 1801f57a39 Fix for permalink structures containing index.php 2015-06-23 11:45:04 +01:00
Mike Jolley f988aae387 Use hashes and server side redirection 2015-06-22 14:55:15 +01:00
Mike Jolley 7e2ba5e05a Ajax endpoint should always be relative 2015-06-19 13:30:57 +01:00
Mike Jolley 33c298fea7 Experiment with appending geolocation to query string to prevent caching 2015-06-17 12:12:49 +01:00
Mike Jolley f8151f416c Merge branch 'text-attribute-handling' 2015-06-16 15:11:58 +01:00
Justin Shreve 12a3a9d305 Return the 'Invalid refund amount' error for negative refunds. 2015-06-15 20:19:52 +00:00
Mike Jolley 89f7e15052 Save full version of text based attributes when dealing with variations 2015-06-11 14:43:02 +01:00
Justin Shreve a7891750b7 Switch the permissions check for json_search_products to use the read_product capability. 2015-06-09 12:35:33 +00:00
Justin Shreve 3233eb471e Switch the json_search_products and json_search_downloadable_products_and_variations ajax functions to check for the `edit_shop_orders` cap instead of `edit_products`. 2015-06-09 12:35:33 +00:00
Claudio Sanches 4698111dd2 Hide api key fields when generate a new keys 2015-06-08 20:22:49 -03:00
Claudio Sanches 91bb8c7ba9 Updated the api authentication 2015-06-08 19:58:38 -03:00
Claudio Sanches 89ddda9ff6 Added new api key generation methods 2015-06-08 19:41:35 -03:00
Mike Jolley 68974655d6 Tweak visible child product query and cache 2015-06-08 13:18:23 +01:00
Justin Shreve e88c1bfb9e When the status is changed via bulk actions or by the status button, execute order.updated. 2015-06-05 16:43:24 +00:00
Mike Jolley a4c2a73050 Max array keys 2015-06-05 13:37:45 +01:00
Claudio Sanches b433f5e2ce Removed duplicated code in WC_AJAX::increase_order_item_stock() 2015-06-04 21:02:03 -03:00
Claudio Sanches 2d5c53942b Removed duplicated code in WC_AJAX::reduce_order_item_stock() 2015-06-04 20:57:43 -03:00
Shiva Poudel db107fac45 Check array in expression for json_search_* events 2015-06-02 22:58:52 +05:45
Shiva Poudel 27adbb2a0b Best practise to check array in expression :) 2015-06-02 22:55:02 +05:45
Mike Jolley 2febc8f20a Add capability checks to ajax requests
Closes #15
2015-06-01 13:38:00 +01:00
Mike Jolley 803f4a9e85 [2.3] Delete correct transient when linking variations
Closes #8241
2015-05-29 15:34:27 +01:00
Nicola Mustone b5e193956b added action woocommerce_refund_deleted 2015-05-27 15:23:59 +02:00
Mike Jolley c01bc43369 Adjust #8165 to deal with 0 2015-05-19 12:53:03 -04:00
Mike Jolley a08b2e5968 Loop over all posted attributes by referencing max posted key
Closes #8165
2015-05-19 12:46:32 -04:00
Nikki DelRosso 940c2369b0 Added method to check if cart is empty 2015-05-14 14:18:53 -07:00
Byron Dokimakis 17af14ef9a Fix for #8034 2015-04-25 02:14:44 +03:00
Mike Jolley 5beeb578a2 Select 'parent' tax class as default for new variations
Closes #8017
2015-04-24 11:05:14 +01:00
Mike Jolley 467a269175 Only set author for user added notes so system notes can be distinguished 2015-04-17 11:23:09 +01:00
Mike Jolley 36a49f87c2 Improve save_attributes ajax function to correctly save text attributes.
Closes #7832
2015-04-10 14:50:23 +01:00
Mike Jolley 0cff7e57cd Run ajax events during template_redirect
Found cases where if you used get_posts during parse_query, you would
get infinite loops.
2015-04-09 12:47:37 +01:00
Mike Jolley 17ca08c020 add endpoints on install 2015-03-20 14:20:12 +00:00
Mike Jolley 94335db2a6 Support default permalinks 2015-03-20 13:10:47 +00:00
Mike Jolley b729480838 Prevent cart hash becoming invalidated due to product/post data 2015-03-20 13:00:05 +00:00
Mike Jolley 21c5513526 Added endpoint for faster ajax requests 2015-03-20 12:28:26 +00:00
Mike Jolley 10c047d38a Send back correct slug after adding term
Fixes #7685
2015-03-13 09:21:55 +00:00
Nicola Mustone 147ccf3ef8 replace int cast with absint 2015-03-03 17:36:47 +01:00
Mike Jolley 7d23acf381 Merge pull request #7597 from woothemes/hotfix-partial-refunds-rounding
Pass max_refund through wc_format_decimal
2015-03-02 10:03:50 +00:00
Gerhard 368bfd97d1 Pass max_refund through wc_format_decimal 2015-03-02 11:54:43 +02:00
Will de6c986953 Filter the default attribute availability 2015-02-26 11:23:19 -05:00
Claudio Sanches 742a48c3eb Fixed the json_search_products when the product title is numeric
@mikejolley
2015-02-23 15:23:53 -03:00
Claudio Sanches 966ca94e41 Fixed non-ASCII variation names in WC_AJAX::json_search_products(), closes #7490 2015-02-19 11:21:02 -02:00
Mike Jolley 2caf287258 Tweak rating prompt text on click, and change once rated
@bftrick This is to keep the .org folk happy and look less spammy :)
2015-02-19 11:38:35 +00:00
Mike Jolley 4feb5fbda9 Restock after refund is successful Closes #7449 2015-02-17 14:56:22 +00:00
Mike Jolley 3691a8fdfb Fix thumbnail notice
Closes #7292
2015-02-04 14:04:02 +00:00
Claudio Sanches d3ac28fbb3 Check if product is published, closes #7220 2015-01-29 16:30:07 -02:00
Brent Shepherd 3a1dc68ff9 Fix typo 2015-01-27 14:42:36 -08:00
Brent Shepherd 60a161aa93 Fix session expired notice on checkout 2015-01-27 14:14:17 -08:00
Claudio Sanches 505501912f Fixed "PHP Notice: Undefined variable: metabox_class" error for non-taxonomy attributes 2015-01-19 11:38:47 -02:00
Claudio Sanches 2d768f9553 Stop "Undefined variable: thepostid" error when add a new attribute 2015-01-13 13:09:43 -02:00
Mike Jolley 2e82cbb311 Customer ajax searches 2015-01-12 13:04:19 +00:00
Claudio Sanches 0accdf6f10 Set order status to refunded when completely refunded, closes #6981 2015-01-02 10:43:47 -02:00
Mike Jolley 22cc1fb0c7 Add attributes with ajax and don't load all attributes at once.
Significantly improves performance with many attributes in admin.
Closes #6852 cc @claudiosmweb
2014-12-22 14:16:15 +00:00
Claudio Sanches 7e780a64b1 Introduces the woocommerce_restock_refunded_item and woocommerce_order_refunded actions, closes #6922 2014-12-19 10:29:47 -02:00
tc33 fb51984a6b Fixes #6979 by fetching attribute slugs instead of names. 2014-12-18 20:09:07 +00:00
Barry Kooij 3f0a8be3d2 Merge branch 'master' into enhancement/checkout-order-review-error-handling 2014-12-11 12:10:53 +01:00
Brent Shepherd 1e8f25defa Use wc_get_order() not new WC_Order()
Because an order might be a custom order type
2014-12-10 18:46:32 -08:00
splashingpixels 25b6377298 ajaxified coupon removal on checkout page for better UX closes #6881 2014-12-07 22:15:03 -08:00
Barry Kooij 438988d9c7 Added the possibility to display notices and/or force reload on order review. 2014-12-04 09:40:49 +01:00
Barry Kooij 36c98dae6d Merge branch 'master' of github.com:woothemes/woocommerce 2014-12-02 12:58:00 +01:00
Barry Kooij f105664805 Introduced 'woocommerce_ajax_calc_line_taxes' filter. 2014-12-02 12:57:53 +01:00
claudiosmweb 3ce620e4f3 Removed eXtremeGoHorse practices from WC_AJAX::calc_line_taxes() and wc_save_order_items()
cc @barrykooij
2014-12-01 21:55:48 -02:00
Mike Jolley 2c1c9896c5 Remove remove_variation and replace with remove_variations 2014-11-27 15:44:51 +00:00
Mike Jolley 44af56ff75 Simplify feature_product() 2014-11-27 15:40:39 +00:00
Mike Jolley e3c1ebc927 Simplify mark_order_status() 2014-11-27 15:37:42 +00:00
Mike Jolley 2e398a3a79 Decoupled the order summary and payments area. Both are updated independently via ajax fragments and can be moved around via actions. TEMPLATES OVERRIDING THESE TEMPLATES WILL NEED TO UPDATE THEIR FILES.
Closes #5781
Closes #6570
2014-11-26 14:19:53 +00:00
Mike Jolley 8b4332a037 Refactors to shipping tax rate methods 2014-11-21 13:06:33 +00:00
Illimar Tambek d510372d64 DRY up mark_order_{$status} 2014-11-19 14:13:24 +02:00
Mike Jolley b3782fa1a5 Removing Mijireh from core 2.3 2014-11-18 16:37:43 +00:00
Mike Jolley 3d1285c8c4 Allow some limited html in text attributes
Fixes #6620. @claudiosmweb @barrykooij see any issues with adding this
one? Doesn’t appear to break anything…
2014-10-29 10:29:51 +00:00
Mike Jolley d90aee6685 Add fallbacks for wp_get_referer()
Closes #6609
2014-10-23 12:13:42 +01:00
Mike Jolley 6f7ff36940 Prefix filter names #6576 2014-10-20 16:12:35 +01:00
Primoz Cigler bbdcdc923a Added the filter for the ajax cart_hash, because in some cases (for example when using WPML) the empty string does not refresh the page fragments properly. 2014-10-18 20:54:25 +02:00
claudiosmweb bc1ea4fdea woocommerce_ prefix in refund actions, related #6477 2014-10-09 13:15:42 -03:00
75nineteen Media f57de2cf9a Added two hooks to support refund Followup Emails 2014-10-07 15:58:21 -07:00
Mike Jolley 700369c386 Refund report changes
1. Ensure refund order_total is negative and reflects the full amount,
not just line items
2. Ensure transients are cleared when doing refunds
3. sales-reports order types so we can exclude refunds from pure
‘sales’ reporting
4. Tweak placement of refunds in legend.

Closes #6411
2014-10-06 13:39:53 +01:00
Nicola Mustone 1337c9cd7b Added $user_id 2014-09-29 09:13:56 +02:00
Nicola Mustone 12129218fb woocommerce_found_customer_details filter improvement
Adding $type_to_load attr to woocommerce_found_customer_details filter
2014-09-26 10:28:46 +02:00
Mike Jolley 4803937222 Fix adding items to orders
* Fix - When manually adding items to an order, show tax columns.
* Fix - When manually adding items to an order, include variation data.

Closes #6313
2014-09-19 12:52:26 +01:00
Mike Jolley 955f497dd7 Prevent headers being sent by wp_send_json()
Fixes #6244
2014-09-16 13:24:05 +01:00
Mike Jolley 79ce7ab926 If a refund fails, delete refund post.
Fixes #6238
2014-09-12 10:09:26 +01:00
claudiosmweb cfb8d42bcb Added missing vars in ajax add_variation() method, closes #6234
@mikejolley
2014-09-11 18:16:37 -03:00
Mike Jolley ebed8dbc85 Correction to last commit to deal with tax arrays 2014-09-08 12:45:32 +01:00
Mike Jolley a588442cbb Format refund amounts as decimals
Fixes #6187
2014-09-08 12:42:30 +01:00
Mike Jolley 265ffee23a Remove $can_be_edited in favour of ->is_editable()
For #6154
2014-09-03 10:09:04 +01:00
thenbrent 78d932e6d2 Add WC_Abstract_Order::is_editable()
To centralise logic used to determine if an order can be edited from
the Edit Order screen
2014-09-02 11:47:56 -07:00
thenbrent 30e95ab16e Fix "remote" typo - should be "remove" 2014-08-27 13:05:35 -07:00
claudiosmweb b08a0cf1f3 stopped deprecated warnings about like_escape() function since WP 4.0 2014-08-21 14:00:39 -03:00
Barry Kooij 94365791af Changed all use of get_product to wc_get_product 2014-08-19 12:09:29 +02:00
Barry Kooij 6655188f0b Changed use of get_order with wc_get_order 2014-08-15 14:29:21 +02:00
Mike Jolley 3f53512c7f Fix up visibility of stock options, drop downs, and get_availability() when parent is managing stock for a variation.
Fixes #6017
2014-08-13 15:03:30 +01:00
claudiosmweb 066ba904cb added $reason param in WC_Payment_Gateway::process_refund() 2014-08-07 15:57:29 -03:00
Mike Jolley 6e540c3bda Pass is_ajax through from the ajax handler
Fixes #5910
2014-07-31 10:00:16 +01:00
Mike Jolley ab5af6f930 Merge pull request #5827 from grey-rsi/master
class-wc-ajax.php
2014-07-30 12:20:42 +01:00
Mike Jolley 710a570525 Coded in Restore stock option 2014-07-25 11:29:24 +01:00
claudiosmweb e634efa958 fixed tax calc when exists tax columns 2014-07-24 18:09:13 -03:00
claudiosmweb 2d61126502 added add_shipping and add_fee ajax actions 2014-07-24 17:55:25 -03:00
claudiosmweb 93b464cb29 improved the add_order_tax ajax method 2014-07-24 17:37:02 -03:00
claudiosmweb 5b3f69de0a fixed the "calculate tax" action #3164 2014-07-24 17:33:26 -03:00
Mike Jolley a10204894d Clear transients after refunding 2014-07-24 16:03:52 +01:00
Mike Jolley 19b6922044 Refund line items and taxes 2014-07-24 15:34:14 +01:00
Mike Jolley 11835826de A start on negative line items
@claudiosmweb
2014-07-23 17:41:35 +01:00
claudiosmweb 8edbd8fed5 fixed undefined variable $can_be_edited when add new line items via ajax 2014-07-22 17:33:49 -03:00
claudiosmweb 144d094ad2 created method for delete order tax 2014-07-20 22:57:23 -03:00
claudiosmweb d875cfa1ac created ajax method to add new taxes 2014-07-20 22:36:12 -03:00
claudiosmweb 5152457d9d improved the saving the new tax data 2014-07-20 01:28:16 -03:00
claudiosmweb f3ef446678 improved the order totals display 2014-07-17 18:17:42 -03:00
claudiosmweb d321395946 created new methods to save and load the order items in shop_order screen 2014-07-17 17:17:54 -03:00
claudiosmweb d7133035e1 added order items add shipping cost button 2014-07-16 15:41:18 -03:00
Mike Jolley 755001f19b Use order types where required 2014-07-11 12:43:42 +01:00