Commit Graph

342 Commits

Author SHA1 Message Date
Mike Jolley effbf87e22 API should generate or set file ID when setting downloads. Closes #18330 2018-01-03 11:02:38 +00:00
Mike Jolley 320392fc59 is_visible should ensure product is is not trashed
Closes #18023
2017-12-06 13:47:09 +00:00
claudiulodro 5513dc4546 Update with master 2017-11-22 11:02:14 -08:00
claudiulodro 99aefc91f3 Changes from feedback 2017-11-21 14:08:17 -08:00
Mike Jolley 8b02185596
Merge pull request #17817 from JeroenSormani/exclude-virtual-from-shipping-tax
Exclude virtual tax classes from calcluation for shipping taxes
2017-11-21 13:21:13 +00:00
claudiulodro a73436bdcd Merge remote-tracking branch 'origin/master' into HEAD 2017-11-20 14:43:12 -08:00
claudiulodro b64b26d030 Variable products are on backorder if all children are backordered 2017-11-20 11:19:06 -08:00
JeroenSormani 14e5bcd51d Exclude virtual tax classes from calcluation for shipping taxes 2017-11-20 20:14:23 +01:00
Mike Jolley 21e51b9fc6
Merge pull request #17692 from woocommerce/update/16925
Add add_to_cart_description method and aria-labels to cart buttons in the loop
2017-11-17 12:35:50 +00:00
claudiulodro 0390cf3e26 Bring up-to-date with master 2017-11-16 10:06:07 -08:00
claudiulodro bb7f1b1273 Logic tweaks 2017-11-15 13:04:24 -08:00
claudiulodro be6f9d68bc Automatic transitions for variables 2017-11-15 12:08:19 -08:00
claudiulodro 68e23911ba Automatically transition stock statuses 2017-11-15 10:48:39 -08:00
claudiulodro db117d6344 Backordered products should count as in stock 2017-11-14 14:54:11 -08:00
claudiulodro cf7bc61b99 Better code 2017-11-14 13:49:22 -08:00
claudiulodro c312cc35b1 Add new onbackorder stock status 2017-11-14 13:40:03 -08:00
Mike Jolley babde741db Add add_to_cart_description method and aria-labels to cart buttons in the loop 2017-11-14 11:45:16 +00:00
Mike Jolley 3e7968d37b Merge branch 'master' into pr/16418 2017-11-13 14:37:18 +00:00
Mike Jolley db4e630600 Replace thumbnail names 2017-11-07 18:48:51 +00:00
Tim Howe abea378245 Variation Displayed in Cross-Sell and Upsells with Parent's Post Status set to 'draft' and 'pending review' (#17423)
* Fix - #17413
Update the `json_search_products` function to use the
`wc_products_array_filter_visible` filter rather then the
`wc_products_array_filter_editable` filter

Added an additional if condition to the `is_visible` function to check
if the product had a parent and it's post status

* remove additional comment from code to keep it clean

* Reverted filter

* Updated the is_visable to check parent product post status using WooCommerce class methods

* Updated the `if empty` check to make it is compatible with older versions of php

* Removed the empty check infavor of just testing on the returned value
Updated the way we are retrieving the partent product object

* Moved the `$parent_product` variable assigment out of the if statement.
2017-11-01 12:52:58 +00:00
Rodrigo Primo fa0e5569f8 Add 'parent' to the list of valid tax classes for product variations
Commit d9f9e74bd added a check to `WC_Product::set_tax_class()` to only accept valid tax classes, but this created a bug for product variations as this type of product has an extra tax class called 'parent'.

This commit fixes this problem by adding a new method to `WC_Product` that returns a list of valid tax classes. `WC_Product_Variation` then override this method, returning another list including the tax class 'parent'.

Fixes #17024
2017-10-09 16:20:03 -03:00
Rodrigo Primo d769ef24f2 Coding standards fixes 2017-10-09 16:19:24 -03:00
Mike Jolley d09d7d1358 wc_get_relative_url/wc_is_external_resource helpers 2017-09-08 12:20:03 +01:00
Mike Jolley ee3ea1b739 Only make http resources relative - https can be left alone.
Closes #16737
2017-09-07 16:55:29 +01:00
Josh Smith 49c7449e8b Merge remote-tracking branch 'upstream/master' 2017-08-23 22:41:04 +00:00
Mike Jolley c60859bf3c types 2017-08-23 14:27:10 +01:00
Josh Smith 148fa16055 [#12517] Removing unnecessary isset on check for download id in WC_Product 2017-08-23 02:27:42 +00:00
Josh Smith 413444c616 Merge remote-tracking branch 'upstream/master' 2017-08-20 04:09:17 +00:00
Mike Jolley d9f9e74bd9 Only set valid tax classes in product abstract 2017-08-18 17:06:22 +01:00
Josh Smith fe01910b8b Fixing spacing on WC_Product and WC_Install 2017-08-11 16:49:49 +00:00
Josh Smith 644ac674d7 [#12517] Replace download_id on customer download and product download with static UUID instead of filename based hash, to preserve download links, logs, and permissions across filename changes 2017-08-05 04:42:31 +00:00
Jaydeep Rami 46d3638089 Fix missing return statement (#16148)
* Fix missing return statement

* Fix missing return statement

* Fix missing return statement

* Fix missing return statement

* Fix missing return statement

* Fix missing return statement
2017-07-20 18:01:14 +01:00
Jaydeep Rami 3522857d23 Fix typo in WooCommerce plugin (#16135)
* Fixed typo

* Fixed more typo

* Fixed more typo

* Fix tyop

* Fix more typo

* Fix more typo

* Fix typo

* Fix typo

* Fix typo

* Fix typo datatime object

* Fix short name of compat

* Fix typo: update short name

* Fix typo "deactive" to "deactivate" and short BW - Compat

* Fix typo "Backwards compat"

* Fix typo 'parameters'

* Fix more typo 'pararmeters'

* Fix typo 'compund'

* FIx typo order

* Fix typo

* Fix typo 'incorrecly'

* Fix typo 'genarate'

* Fix typo 'reletive'

* Fix typo 'Handly'

* Fix typo 'rotatated'

* Fix typo

* Fix typo 'additonal'

* Fix typos
2017-07-17 11:10:52 +01:00
Akeda Bagus 53807185a8
Fixed typos.
These typos are catched by `misspell` program.

```
find . -type f | grep -v assets | grep -v dummy-data | grep -v i18n | grep -v node_modules | grep -v .git | grep -v apigen |  xargs misspell -w
```

Some results were excluded because of 3rd party ownership and non-english
sentences.
2017-07-10 12:56:28 +07:00
Mike Jolley 38bcdcfb28 Use get_max_purchase_quantityin cart template and fix logic
Closes #15329
2017-05-30 11:02:56 +01:00
Mike Jolley a3b89a9efc Merge pull request #15144 from timondavis/fix/15103-cannot_set_default_variation_to_string_zero
#15103 Variation default value of '0' fails to save on product.
2017-05-23 19:31:38 +01:00
Timon Davis af308da6b9 Fix bug #15103 where site operator cannot assign a variation with value of '0' as the default choice on the customer facing form.
The WC_Product::set_default_attributes function uses an array_filter (using the default callback for filtration)
to remove null and false values from the defaults array for a given product.  The issue here is that, in the above use case,
the array_filter will evaluate '0' as 0 and therefore as false.  Ultimately, array_filter then prevents the value from being
recorded, moving forward.

I've added a new filter callback to includes/wc-attribute-functions which will disregard all FALSE PHP equivalents except for
'0' (as a a string).  Also, I've updated the filter_array call in WC_Product::set_default_attributes so that it uses this new callback,
instead of the PHP default. Finally, I've added a phpunit test to assert that, when storing default variations / attributes on a product,
the false/true PHP synonyms are evaluating and storing like one would normally expect, with the exception that (string) '0'
evaluates as true in this special case.

This solution could potentially be broadened to facililate similar rules elsewhere, but the need raised in the bug is specific and
this is a specific solution.
2017-05-18 02:43:14 -07:00
Rasmus Bengtsson 185934fad9 Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
Rasmus 98833fa9c5 Fix param documentation for WC_Product::is_type 2017-05-09 14:10:27 +02:00
Mike Jolley eedcdd97ba Compare with timestamp and remove start date once passed for sale products
Fixes #14753
2017-04-27 14:35:33 +01:00
Mike Jolley a6329fa68c Merge pull request #14752 from woocommerce/pr/14732
revert price handling of get_price_html()
2017-04-27 13:03:15 +01:00
Mike Jolley db5e2572f6 clean up 2017-04-27 13:01:52 +01:00
Kathy Darling 36dbe64170 revert price handling so null price still is filtered by woocommerce_get_price_html. closes #14727. 2017-04-26 12:37:30 -05:00
Mike Jolley 69a8b6c9b5 When on backorder without notifications, hide the text
Fixes #14530
2017-04-19 16:57:49 +01:00
Claudiu Lodromanean 94814a0b03 Dont throw exceptions when reading 2017-04-06 13:39:36 -07:00
Mike Jolley fe42b2565c Defer variation parent sync to shutdown rather than cron 2017-04-06 12:25:34 +01:00
Gregory Karpinsky 37c7e2a615 Docblock fix
`get_availability` returns array of strings
2017-04-06 00:32:36 -04:00
Mike Jolley c06fdc2e2e If product has_options, don't show qty in grouped product add to cart form
Fixes #13875
2017-04-03 12:05:28 +01:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
Mike Jolley d55653a408 Merge branch 'master' into fix-13498
# Conflicts:
#	includes/class-wc-order.php
#	tests/unit-tests/crud/data.php
2017-03-15 15:52:40 +00:00