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.
* 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
* 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
* 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
* 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
* use %s in translations strings
* merge simmilar error strings
* i18n: use sprintf() in translation strings to make them easier to understand for translators
* i18n: remove sprintf() function from translation string with unused parameter
* i18n: move colons and brackets into the translation strings
* revert comit addaa5d
* Fix broken sprintf()
* i18n: move colons into the translation strings on error messages
* Fix Travis-CI Error: operator must be surrounded by a single space
* Replace some context function with translation comments
* Remove two more context function
* Replace another context function with translation comments
* use set_stock to reset stock meta when not managing stock
Ensures that the 'woocommerce_{ variation | product }_set_stock' hooks fire to refllect the fact that stock becomes infinite.
* track state of Manage Stock? option
* quick/bulk edit fixes
* reapply quick and bulk edit fixes
* improve conditional reset logic that prevents actions from *_set_stock actions from firing with every save
If taxes are disabled in the “General settings tab”, then the “Tax” tab
disappears, and the suffix can no longer be edited, but is still
displayed in the store
This fix makes sure that the suffix is only displayed if taxes are
enabled
@claudiosmweb This removes ‘in stock’ when not needed, and I broke the
methods up for clarity.
Also removed the variation specific logic as it was near identical and
not needed.
It's possible to change backorder status using filters via `woocommerce_product_backorders_allowed`.
However, it's not possible to set `$product->backorder` to `"notify"`.
Added a filter similar to `woocommerce_product_backorders_allowed`
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.
Since expect return an integer value, we can't return an empty string.
This can generate some kinds of errors like:
'' >= 1 returns false
'' >= -1 returns true
This can be a problem comparing stock quantity like we do in
WC_Product::has_enough_stock()
But using null we have:
null >= 1 returns false
null >= -1 returns false
cc @mikejolley
ref #9598
All product prices are wrapped in `span class=“amount”`. To make
themers lives easier let’s be consistent. When the product is free the
price should still be wrapped.
Remove real randomness and add transient caching to improve performance.
The above was not worth the cost of the query - only users refreshing a
product page would see a difference.
If ratings are not required, the total rating count was counting all
reviews which skewed the average rating. In other words, reviews with
no rating were counted as a “zero” rating in the average rating
calculation. This bug was introduced in
83a457b29c which provided a fix for #6839.
This change introduces a new product method `get_review_count()` which
can be used to accurately calculate the total number of reviews for a
product. Some instances of `get_rating_count()` were replaced with
`get_review_count()` where appropriate. Additionally, the
`single-product/rating.php` template was adjusted to display the
correct number of customer reviews and ratings in rich snippets. I’ve
also included the `bestRating` rich snippet detailed
[here](http://schema.org/AggregateRating). The version number was
adjusted to 2.3.2 on that template as I think this is a larger change.
SHA: 100b95a tweaked the `__get()` magic method in `WC_Product` to:
* only call `get_post_meta()` once; and
* set `$this->$key` to save the overhead of calling `__get()` every
time that property needs to be accessed.
However, in the process, it also set an empty value (`''`) - the default
return value of `get_post_meta()` for every single value accessed on
the product object, meaning that any calls to `isset()` after attempting
to get that value would return `true`, even if `metadata_exists()` for
that property would return false (and no value is set in memory).
- Renamed some 2.3 methods for consistency
- Allow more args to be passed to wc_price to control output
- Filter wc_price args which Closes#7188
- wc_get_price_decimal_separator function
- wc_get_price_thousand_separator function
- wc_get_price_decimals function
The commit introduces 3 changes:
1. It adds 2 extra fields to the available_variations array,
display_price and display_regular_price, to be used by extensions in
cases like
https://github.com/woothemes/woocommerce-product-addons/issues/19
2. Introduces a get_display_price() function in WC_Product to retrieve
product prices incl or excl tax relative to the
woocommerce_tax_display_shop setting.
3. Fixes a minor issue where passing a 0 price to
get_price_including_tax() or get_price_excluding_tax() results in a
wrong output.