Commit Graph

268 Commits

Author SHA1 Message Date
Claudio Sanches 777a004a1f Allow max of 15 products in Recent Viewed Products widget 2017-11-29 19:24:39 -02:00
Claudio Sanches 929eb48fcd Always save last viewed product ID into woocommerce_recently_viewed cookie
Currently if you already visited a product will not be listed at the top
of the "Recent Viewed Products" widget.

This happens because we only include new items if they are not already
in the list of viwed products.

This code changes a little the logic excluding the ID from viewed
products list and adding again.

Closes #17951
2017-11-29 19:21:04 -02:00
claudiulodro c312cc35b1 Add new onbackorder stock status 2017-11-14 13:40:03 -08:00
Mike Jolley db4e630600 Replace thumbnail names 2017-11-07 18:48:51 +00:00
Mike Jolley e025caf177 Widths and aspect ratios 2017-11-07 18:32:43 +00:00
Mike Jolley 130d719d90 Small rounding error in items table 2017-11-02 15:03:43 +00:00
Rodrigo Primo a3f14c7256 Caches call to load product variation attributes
This commit adds product variation attributes to WP cache when they are first loaded to avoid running the same database queries when the same product is loaded multiple times. This cache will be invalidated whenever product attributes are changed.

Fixes #17120
2017-10-27 10:01:23 -02:00
Rodrigo Primo fb70ae3fea Coding standards fixes 2017-10-25 17:53:17 -02:00
Mike Jolley 8eb500b8c1 Allow wc_get_formatted_variation to skip attributes used in the variation's name
Alternative fix for #17004

This matches the cart logic.
2017-10-02 15:50:10 +01:00
Claudio Sanches 03a189726e Introduces woocommerce_get_product_id_by_sku filter
Closes #16559
2017-08-22 15:04:21 -03:00
Rami Yushuvaev d1f4acc730 i18n: Simpler translation string with placeholders
Replace:

`wc_get_product should not be called before the woocommerce_init action.`

With:

`%1$s should not be called before the %2$s action.`
2017-08-16 00:26:14 +03:00
Mike Jolley 39af6fbe94 Add precision to price filter
Closes #16253
2017-08-03 08:17:23 +02:00
claudiulodro e1fad0d7eb Bring up to date with master 2017-07-28 14:27:19 -07:00
claudiulodro d9c2b2cdea Cleanup 2017-07-28 13:38:12 -07:00
claudiulodro 8dc0641149 Remove uneeded parse args 2017-07-28 13:31:53 -07:00
claudiulodro e335724c50 Finalize product query 2017-07-28 11:59:44 -07:00
claudiulodro 96bc5e6f95 cleanup 2017-07-14 10:07:18 -07:00
claudiulodro f66198c37d Initial working wc_get_products 2017-07-14 09:50:20 -07:00
Claudiu Lodromanean 14aaebd3f5 Merge pull request #16094 from woocommerce/fix/15256
Check we have an object before using product props
2017-07-12 08:25:04 -07:00
Mike Jolley b3e0804462 Check we have an object before using product props
Fixes #15256
2017-07-12 15:58:54 +01:00
Mike Jolley 022c528b3e Remove value renaming code 2017-07-12 15:18:05 +01:00
Mike Jolley ae0e03ef53 wc_products_array_filter_visible_grouped method 2017-06-20 15:00:58 +01:00
Mike Jolley 4a4e201888 Copy tweaks for catalog visibility
Ref #15604
2017-06-14 12:07:20 +01:00
Mike Jolley 282bf0fd68 Cleanup 2017-06-13 11:41:44 +01:00
yachmenov_c_ ab7a3b625c #15584 - is_wp_error() checking added to prevent fatal 2017-06-13 11:19:56 +03:00
Mike Jolley d3666738d8 Merge branch 'pr/15069' 2017-05-23 18:56:58 +01:00
Rasmus Bengtsson 185934fad9 Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
Rasmus Bengtsson 6a7fc8650f Remove unused local variables 2017-05-15 12:06:52 +02:00
Claudio Sanches 58fa8542b6 Merge pull request #14933 from woocommerce/fix/14815
Use numeric, not decimal
2017-05-08 15:36:39 -03:00
Mike Jolley bdd3eba7c4 Use correct full size for variation images
Closes #14866
2017-05-08 14:35:07 +01:00
Mike Jolley 885e332f5a Use numeric, not decimal
Closes #14815
2017-05-08 12:34:00 +01: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 aacb01d1e7 Merge branch 'pr/13503'
# Conflicts:
#	assets/css/twenty-seventeen.css
#	assets/css/woocommerce-layout.css
#	assets/css/woocommerce-layout.scss
#	assets/css/woocommerce.css
2017-04-27 12:46:05 +01:00
Mike Jolley c454abc787 Remove attribute_ prefix from names in wc_get_formatted_variation
Fixes #14469
2017-04-18 13:08:39 +01:00
Mike Jolley f9dd3310b2 Unfiltered context rather than true 2017-04-13 12:38:54 +01:00
Mike Jolley 7274c14591 Use correct thumbnail for variation images in gallery
Fixes #14213
2017-04-10 23:02:53 +01:00
Mike Jolley 47411f7397 wc_deferred_product_sync queue function 2017-04-06 12:25:54 +01:00
Mike Jolley 489ebedfcd Use floats for qty
Fixes #13728
2017-03-23 11:18:41 +00:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
Manos Psychogyiopoulos 5e8df27945 fix wc_get_price_{in/ex}cluding tax behavior with zero/empty inputs 2017-03-08 18:21:36 +02:00
Aristeides Stathopoulos 10ffc92a73 Inline control structures are not allowed 2017-03-07 22:24:24 +02:00
Claudio Sanches bf51da64d7 Merge branch 'master' into fix-13335 2017-02-24 16:07:00 -03:00
Mike Jolley 6bc97dce91 wc_product_force_unique_sku edit context 2017-02-24 11:43:58 +00:00
Mike Jolley 2f44e5769b Don't adjust empty skus 2017-02-23 10:04:58 +00:00
Mike Jolley c44fffe35b If woocommerce_adjust_non_base_location_prices is false, remove modded tax, not base tax 2017-02-06 16:56:14 +00:00
Mike Jolley dc82ea9c77 Add some functions to handle unique sku after untrash 2017-01-11 15:41:31 +00:00
Manos Psychogyiopoulos 022fbe4183 add 'include' arg to wc_get_products 2017-01-09 14:10:47 +02:00
Mike Jolley fdbb36bb93 Support deprecated args again 2017-01-05 16:16:19 +00:00
Justin Shreve e4937b898d Fix PHP 7.1 warnings/notices. 2017-01-04 10:45:45 -08:00
Mike Jolley a3f8ffb101 Ensure price is set 2016-12-23 14:30:47 +00:00
Manos Psychogyiopoulos 1b65b793d2 fix non-object error when clearing transients 2016-12-20 22:29:17 +02:00
Oliver Juhas 6b5330e16e Checking if we got the attachment post
Fixing issue #12568
2016-12-10 20:45:04 +01:00
Mike Jolley 47fbae4d26 Product Visibility Taxonomies (#12527)
* Convert visibility and featured to taxonomy

* Comment

* Add missing tax_queries

* Only check SKU after read.

* Added visibility term for outofstock products to speed those queries up al

* wc_bool_to_string
2016-12-08 10:56:45 +00:00
Mike Jolley 7583965af2 Use wp_list_sort vs _usort_terms_by_ID
Fixes #12525
2016-12-07 10:21:03 +00:00
Mike Jolley 1a632cda1f Missing space and incorrect comment 2016-11-25 10:43:56 +00:00
Mike Jolley 9087a45f29 Remove attribute_ prefix rather than add so that get_attributes has better return values, and don't show duplicate data in cart. 2016-11-24 14:20:48 +00:00
Mike Jolley ac62cffe16 Refactor ajax search for CRUD 2016-11-24 11:50:58 +00:00
David Lawson 1d955938f2 Fixing incorrect prices around tax
Missing `!` when moving code from `abstract-wc-product.php`. See https://github.com/woocommerce/woocommerce/blob/release/2.6/includes/abstracts/abstract-wc-product.php#L869-L919
2016-11-24 21:19:21 +11:00
Mike Jolley d7dfdd3d10 Wrap all deprecation calls. 2016-11-23 16:15:00 +00:00
Mike Jolley 73287b08a0 Move product query to store
Closes #12402
2016-11-21 12:25:00 +00:00
Lee Willis 837007af83 Make docs for wc_get_products() match implementation 2016-11-16 13:24:01 -02:00
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
Claudio Sanches 8339e9ca25 Introduces wc_get_min_max_price_meta_query() function 2016-10-14 11:19:20 +01:00
Claudio Sanches d627d7f764 Created function to get the catalog visibility options 2016-10-11 14:11:37 +01:00
Claudio Sanches 226482baf5 Fixed coding standards 2016-10-04 14:36:18 -03:00
Toros Tarpinyan 4c61ed03e5 fix comment spacing 2016-10-04 11:20:49 -04:00
Toros Tarpinyan 2fc3c62943 fix issue 12004 (sales price does not automatically revert to regular price on the store front at the end of the sales event) 2016-10-04 08:25:12 -04:00
Claudio Sanches e0572c782d Included @since in wc_get_product() 2016-09-21 20:19:04 -03:00
Aristeides Stathopoulos 734f284fa4 WordPress.PHP.YodaConditions.NotYoda 2016-09-08 01:32:24 +03:00
Mike Jolley 311c540662 Merge pull request #11833 from aristath/master
Coding Standards (2nd pass)
2016-09-07 10:14:17 +01:00
Mike Jolley 0c78ed7f9b [2.6] Start sale on variation save if applicable
Fixes #11804
2016-09-06 11:37:20 +01:00
Aristeides Stathopoulos d4e3faf014 PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket 2016-09-02 04:51:31 +03:00
Aristeides Stathopoulos 82f3cc221e WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeOpenParenthesis 2016-08-27 07:23:02 +03:00
Aristeides Stathopoulos 58b9df6564 WordPress.Arrays.ArrayDeclaration.NoSpaceAfterOpenParenthesis 2016-08-27 05:23:54 +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
Scrutinizer Auto-Fixer 7cef8ae4c9 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2016-06-06 16:50:18 +00:00
Mike Jolley c0dc352df1 Clear parent transients when clearing own transients
Fixes #10996
2016-05-27 11:12:23 +01:00
Mike Jolley fce8dc0868 Ensure alt text is set for product attachments
@claudiosmweb Fixes #10822
2016-05-03 16:41:51 +01:00
Mike Jolley e2139a5c5e Clear prices transient for variable products after scheduled sale. 2016-03-31 12:03:03 +01:00
Mike Jolley 83d2f64e9e Tweak wc_get_product_variation_attributes to ignore non variation attributes 2016-02-25 14:13:56 +00:00
Mike Jolley 5ddc0b1a9a [2.5] Fix CLI when setting a single category
Fixes #10409
2016-02-23 11:32:18 +00:00
Shiva Poudel db50998f80 Period in comments 2016-02-12 23:58:23 +05:45
Shiva Poudel 70c755c09e Can remove parent assignment as its not used 2016-02-12 23:50:06 +05:45
Fredrik Forsmo 676525c2b7 Improve docblock comments in various functions
* Added missing param tags to functions
* Added comments to `wc_get_attachment_image_attributes` and
`wc_prepare_attachment_for_js`
* Fixed return type value for functions where it says bool but the code
returns array
* Renamed boolean to bool
2016-01-06 17:11:09 +01:00
Mike Jolley 9890c18b5d Notice if called early.
Closes #9923
2016-01-04 10:43:51 +00:00
Mike Jolley 4b87b0fbdc [2.4] Fix SKU slash madness
Fixes #9721
2015-12-02 11:22:11 +00:00
Mike Jolley 3b409f1bbf For coupons with category restrictions, respect the category hierarchy.
Closes #9704
2015-11-30 12:29:16 +00:00
Mike Jolley 3082c5bba6 wc_related_ and get_related method tweaks
Remove use of multiple expiring transients. See function docblock for
explanation.
2015-11-13 21:14:42 +00:00
Mike Jolley 70d9f58811 Version not needed for wc_var_prices
This transient doesn’t need to expire often because the hashes will be
unique if taxes change.

This change means a variable product will only use 1 transient rather
than many.
2015-11-13 20:01:42 +00:00
Nicola Mustone c9da4f928a check if ABSPATH is defined 2015-11-06 10:22:19 +01:00
Claudio Sanches 5893875b0c Removed period for file headers 2015-11-03 11:53:50 -02:00
Claudio Sanches ee30b5b308 Fixed php docs standards 2015-11-03 11:31:20 -02:00
Claudio Sanches 52787c282c [2.3] Prevent "Trying to get property of non-object" in Sensei 2015-09-18 02:18:15 -03:00
Mike Jolley 9330176865 Flush product cache so prices are regenerated
Fixes #8851
2015-08-17 14:19:58 +01:00
Mike Jolley d9f9da955d empty checking 2015-08-13 16:58:23 +01:00
Mike Jolley cbb89fa4b9 wc_get_product_variation_attributes should only get parent attributes which are for variations.
Closes #8796
2015-08-12 18:02:13 +01:00
George Stephanis c938fa24da More missing esc_attr calls, :( 2015-08-05 15:17:52 -04:00
Mike Jolley 060fb16e2e Move Pre 2.4 handling for attributes - DRY
@claudiosmweb @franticpsyx
2015-07-28 16:20:51 +01:00
Claudio Sanches 9e41552342 Removed all "@return void" 2015-07-16 16:55:48 -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
Claudio Sanches 8b681fddf7 Created bulk edit actions for variable sale schedule 2015-07-07 16:39:59 -03:00
Claudio Sanches 11ca22ef1a Created _wc_save_product_price() private function 2015-07-07 16:06:34 -03:00
Mike Jolley 68974655d6 Tweak visible child product query and cache 2015-06-08 13:18:23 +01:00
Mike Jolley 4a9971193f Only track product views when widget is active
Closes #8212
2015-05-28 11:49:10 +01:00
Claudio Sanches 5a765aa4ef Merge pull request #7920 from SiR-DanieL/patch-4
Remove null parents from the featured IDs array
2015-04-13 12:46:14 -03:00
Nicola Mustone 2fa4333ad7 remove 0 values from featured array 2015-04-09 16:48:26 +02:00
Nicola Mustone 8046aa58a2 missing {} 2015-04-09 16:34:33 +02:00
Mike Jolley 7bbd0261d7 Show full category hierarchy in permalinks.
Closes #6158
2015-03-27 13:08:27 +00:00
Claudio Sanches edcc265fdb Merge pull request #7350 from forsvunnet/filter-unique-check
Added apply_filters to the wc_product_has_unique_sku function #7320
2015-03-18 09:12:48 -03:00
Claudio Sanches a66d627c70 Improved the wc_get_product_id_by_sku() function for #7695 2015-03-12 17:59:52 -03:00
nils-fredrik@maksimer.no c0ebb7d0ad Fix for #7695
Will now only return posts of type product and product_variation.
2015-03-12 21:52:22 +01:00
Mike Jolley fa0be55b01 transient cache dashboard reports
Closes #7641
2015-03-09 11:07:49 +00:00
Mike Jolley d9455994c8 Use 30 days instead of year for transients to avoid bugs in memcache plugins.
Closes #7520
2015-02-24 12:02:56 +00:00
Eivin Landa 69aba6055a Added apply_filters to the wc_product_has_unique_sku function #7320 2015-02-10 19:54:31 +01:00
Mike Jolley 7ef8f4d156 Invalidate unknown product transients Closes #6815 2014-12-30 15:27:08 +00:00
Mike Jolley 95a504cf84 Fix admin term output
Resolves an issue decoding foreign chars caused by #6555
Fixes #6550
2014-12-09 09:54:42 +00:00
claudiosmweb 15996a1dee Created the wc_get_product_id_by_sku() function 2014-11-27 10:31:56 -02:00
Mike Jolley 0718aef09e wc_update_product_stock should update stock regardless, if the meta data doesn't currently exist
Fixes #6553
2014-10-16 17:15:10 +01:00
Mike Jolley c4ef86d44e scrutinizer patches 2014-09-08 00:37:55 +01:00
Barry Kooij 94365791af Changed all use of get_product to wc_get_product 2014-08-19 12:09:29 +02:00
Barry Kooij 7cd2e8c10a Renamed get_product to wc_get_product 2014-08-19 12:05:02 +02:00
thenbrent 2d47d6b43b Improve display of multiword product attributes
Instead of displaying a variation's custom product attributes like this:

`name-with-dashes: attribute-with-dashes`

Display it like this:

`Name With Dashes: Attribute With Dashes`
2014-07-30 12:41:14 -07:00
Mike Jolley 3974c1028a Remove wp_cache_flush() Closes #5777
Carrying on from previous commits, the need for a wildcard delete for
products is unnecessary. This removes the $wpdb query and
wp_cache_flush()
2014-07-03 12:59:57 +01:00
Mike Jolley d1dbe4492e Clear comment transients only on wp_update_comment_count
Does not need to be flushed when editing a product. Part of #5777
2014-07-03 12:59:57 +01:00
claudiosmweb d3dc018ffc fixed the wc_product_has_unique_sku() function name 2014-06-27 16:03:25 -03:00
claudiosmweb 0a4b6387e6 introduces the wp_product_has_unique_sku() function 2014-06-27 15:59:24 -03:00
Mike Jolley c2475c2073 Merge pull request #5745 from claudiosmweb/4164-feature-products-api
Products API - PUT/POST/DELETE
2014-06-27 13:14:20 +01:00
Mike Jolley 50a4c5bd23 Merge branch 'variation-stock-management'
Conflicts:
	includes/class-wc-product-variation.php
2014-06-27 11:15:42 +01:00
Nicola Mustone 46df7ba249 Added $size and $dimensions parameters
Added $size and $dimensions parameters to palceholder image filter to have a better custom management of the placeholder image.
2014-06-25 11:46:50 +02:00
claudiosmweb 276ebd25e3 created the wc_get_product_types() function 2014-06-24 13:59:56 -03:00
Mike Jolley 0315e48187 Only call the method to update stock when it changes 2014-06-24 13:01:47 +01:00
Mike Jolley c66f2b8232 Split out several transient clearing functions to be called only when needed. 2014-06-19 12:25:10 +01:00
claudiosmweb 61c94f9e25 fixed some hard code strings 2014-06-11 17:12:23 -03:00
Coen Jacobs 3ad8935b20 Removed ununsed global variables in local scopes 2014-06-08 22:33:11 +02:00
Chris Broadbent ff0025a1f4 Fixes performance degredation on large wp_options tables 2014-05-24 14:04:49 +10:00
Mike Jolley 9665239ba7 param comment Fixes #5408 2014-05-06 16:06:32 +01:00
Gregory Karpinsky 424954743e Docblock fix: wc_product_post_type_link 2014-04-19 09:44:55 -04:00
Mike Jolley a569c9fd7d Clear featured transients when needed Closes #5254 2014-04-04 14:16:18 +01:00
Mike Jolley 8007e4c102 Fix encoding issue with attribute values and move variation data to tooltip Closes #5169 2014-03-20 15:47:52 +00:00
Mike Jolley 66b44c5cfe Related to #5041, there is not a way to retrieve these dynamic transient names and use delete_transient, so if using object caching we must flush 2014-03-20 11:20:54 +00:00
Mike Jolley b366523c2c Remove break #5041 2014-03-18 11:10:50 +00:00
Mike Jolley 251b8b411f Clear object cache for orders + products #5041 2014-03-18 11:09:56 +00:00
Coen Jacobs 3617316357 Updated expiry times for transients 2014-03-12 12:58:41 +01:00
Coen Jacobs 03163c54b0 set_transient calls should have expiration to prevent autoloading 2014-03-07 09:29:01 +01:00
splashingpixels 5cfa0306f4 wc_get_product_ids_on_sale should never return post id of 0 fixes #5002 2014-02-28 20:37:58 -08:00
Mike Jolley 37573a93e2 wc_get_product_ids_on_sale should return array of integers, not strings Closes #4825 2014-02-17 12:20:10 +00:00
Mike Jolley 65ca1753ae woocommerce_products_will_display improvements #4644
- Reduced number of conditionals required.
- Broken the massive category query into a loop which can break before
checking all cats
- Used a transient to further optimise the category check
2014-02-06 09:21:47 +00:00
Mike Jolley 67af66b96c Add classes for placeholder Closes #4432 2013-12-30 14:22:13 +00:00
Coen Jacobs 61a783886d Suggested code changes in #4266 2013-12-03 15:03:25 +01:00