Commit Graph

339 Commits

Author SHA1 Message Date
Mike Jolley df057abe88 Missing DISTINCT keyword 2016-12-10 12:51:15 +00:00
Mike Jolley 8bd08e4c21 typos 2016-12-09 17:04:44 +00:00
Mike Jolley 0ac6c3b03f Use IDs to reduce queries 2016-12-09 15:54:58 +00:00
Mike Jolley e0e0c9e832 Replace rating filters with taxonomy 2016-12-09 15:43:25 +00:00
Mike Jolley 767a1e500e Helper to get term ids 2016-12-08 17:01:39 +00: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
opportus 4c8e694dce Layered Nav menu dropdown empty count fix 2016-11-22 19:48:39 +01:00
Mike Jolley 3d8c6b8564 Merge pull request #12395 from opportus/layered-nav-hide-attributes
Layered nav widget with 'OR' behavior keep showing attributes applying to (0) products
2016-11-22 15:56:26 +00:00
Mike Jolley c89f2396ae Fixes #12394 2016-11-21 12:16:15 +00:00
opportus 42bb48abf1 layered nav OR hide attributes applying to 0 product 2016-11-17 23:33:24 +01: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
Rami Yushuvaev d85075dcb0 a11y: replace `title` attributes with `aria-label`, for better accessibility 2016-11-04 17:41:51 +02:00
Rami Yushuvaev 9469673c05 a11y: remove unneeded `title` attributes 2016-11-04 17:40:15 +02:00
Rami Yushuvaev 6cc301e58c add translators comments 2016-10-29 13:16:03 +03:00
Rami Yushuvaev 0be4db2261 more i18n updates (#12189)
* i18n: simpler translation strings

* i18n: simpler translation strings

* i18n: readble printf(), and moving the %s placeholder to `%s product`

* i18n: make string translatable and remove the HTML tags

* i18n: avoide using HTML tags in translatino strings

* i18n: move the colon into the translation string and use %s placeholder for the IP

* i18n: use sprintf() on field-validation translation strings, and unify those strings

* i18n: move colons into the translation strings

* i18n: use `%s` placeholder as the site name in "Powered by WooCommerce" string

* i18n: use `%s` placeholder for min and max price

* i18n: rewrite the translation strings printf()
2016-10-26 14:35:52 -02:00
Rami Yushuvaev 4375618438 i18n context functions (#12156)
* Replace some context function with translation comments

* Remove two more context function

* Replace another context function with translation comments
2016-10-24 08:31:07 +01:00
Mike Jolley 500c68d729 [2.6] Use FLOOR and CEIL to get price filter values
Fixes the issue where max price is capped at 99. Fixes #12145
2016-10-21 08:58:57 +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 50544233f5 Wrap layered nav term in filter
Closes #11922
2016-10-11 18:23:25 +01:00
Justin Shreve 0d8e993cc3 Coding style fix. Add $taxonomy to the filter args. 2016-10-05 11:37:53 -07:00
Justin Shreve c7d191f84b Wrap the "Any % (taxonomy)" string in a filter so admins/dev can customize the text correctly for languages with genders. 2016-10-05 10:45:09 -07:00
James Kemp b2bf294e03 Min/Max Modifications
CAST min/max as decimal. Otherwise, a max of 59.99 will return 59 instead of 60 - so the product will be missed when using the filter.

Added filter on post_type so I can add product_variation for compatibility with one of my plugins.
2016-09-15 12:05:59 +01:00
Aristeides Stathopoulos 9668247b95 WordPress.PHP.YodaConditions.NotYoda 2016-09-09 03:14:28 +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 c823236098 Fix failing tests. 2016-09-02 00:33:36 +03:00
Aristeides Stathopoulos fde1037757 fix failing tests. 2016-09-01 23:50:14 +03:00
Mike Jolley 402d0ff077 Merge branch 'master' into 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:43:31 +01:00
Caleb Burks 417d707996 Cast as decimal when querying prices 2016-08-27 01:03:06 -05:00
Aristeides Stathopoulos f2730eea02 WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd 2016-08-27 08:57:05 +03:00
Aristeides Stathopoulos b063bcfe4c last item in a multiline-array should end in a comma 2016-08-27 04:46:45 +03:00
Caleb Burks 306e1dfa39 Sort “Recently Viewed” products by the view order
orderby ‘post__in’, and reverse the array so the most recently viewed product shows up on top.
2016-08-24 17:46:23 -05:00
Claudio Sanches b3c0bee7fc Sort by top rated widget with meta
ref #11711

cc @mikejolley
2016-08-19 19:57:42 -03:00
Mike Jolley 644cf79866 Move all query string vars to form in price widget using wc_query_string_form_fields
Closes #11593

@claudiosmweb @justinshreve look fine to you?
2016-08-04 13:37:39 +01:00
Claudio Sanches e0bfe9f9fa Merge pull request #11168 from zakalwe2016/master
Add Filters For Product Lists in Widgets
2016-07-27 12:15:20 -03:00
Mike Jolley 84e883657c Merge pull request #11412 from jlad26/master
Fix layered nav links on product attribute archives
2016-07-19 15:20:47 +02:00
Mike Jolley d79f21a501 Better search handling 2016-07-19 14:09:56 +01:00
Leon Francis Shelhamer a9e7c67230 fix search results layered nav counts issue 2016-07-13 21:44:00 -04:00
jlad26 ce0485a97c Fix layered nav links on product attribute archives
If the option 'Enable archives' is selected for a product attribute, then the layered nav widget can also be used to filter that archive.
However the widget then doesn't work correctly in 'List' and 'OR' mode for that archive (although it works fine on the main shop page).

Example:
The attribute "product-type" is created and archives are enabled. It has values like "Courses", "One-to-one-tuition", "Equipment rental" and so on. Another product attribute "teaching-level" is created which uses values of "Beginner", "Intermediate" and "Advanced".
When the archive http://www.domain.com/pa_product-type/courses/ is visited the correct products are displayed. A layered nav widget is added in 'List' and 'OR' mode for the attribute 'teaching-level'. Clicking on any of "Beginner", "Intermediate" and "Advanced" will work fine the first time as the links are correctly generated in the form http://www.domain.com/pa_product-type/courses/?filter_teaching-level=advanced&query_type_teaching-level=or. (Advanced used for the example). However once one has been clicked, the links generated are now incorrect - they are in the form http://www.domain.com/?taxonomy=pa_teaching-level&term=advanced&filter_teaching-level=advanced%2Cbeginner&query_type_teaching-level=or.

Using get_queried_object instead of get_query_var fixes the problem.
2016-07-12 11:46:16 +01:00
Claudio Sanches 7d9d091767 Fixed mixed tabs and spaces 2016-07-11 16:56:35 +02:00
zakalwe2016 40675d3c5f Add filter for product list 2016-06-17 13:23:42 +01:00
zakalwe2016 538e791165 Add filter for product list 2016-06-17 13:23:02 +01:00
Mike Jolley cb13f11c14 Allow entire count query to be filtered
Closes #11145
2016-06-16 12:36:18 +01:00
Mike Jolley c8f55cfb8d Layered nav counts when term_id does not match term_taxonomy_id (before splitting).
@claudiosmweb this was a massive pita to fix
2016-06-15 19:20:50 +01:00
Mike Jolley 5ff18ebb12 Layered nav dropdowns - When getting counts, use 'or' to exclude self. We don't need 'and' because dropdown fields can only choose 1 option anyway.
#11123
2016-06-15 00:09:32 +01:00
Mike Jolley 1ff00adcf6 Spacing 2016-06-14 11:02:23 +01:00
Serg 60a4da9660 Fix Layered navigation permalinks issue on category page 2016-06-14 12:35:52 +03:00
Claudio Sanches 21ffc13ab3 Added $count and $term in woocommerce_layered_nav_count filter 2016-06-08 12:55:20 -03:00
Mike Jolley aa9e6542e3 woocommerce_layered_nav_count filter
Closes #11070
2016-06-08 16:29:27 +01:00
Mike Jolley 1dcf6c6058 Fix numeric sort in layered nav
Fixes #11069
2016-06-08 14:39:24 +01:00
Mike Jolley 730019ef18 scrutinizer best practice 2016-06-06 19:39:23 +01:00
Mike Jolley d4d6f3181c Best practice tweaks 2016-06-06 17:24:31 +01:00
Claudio Sanches e39274e753 HTTPS for everybody 2016-05-26 22:48:49 -03:00
Claudio Sanches 9934e512ed Fixed missing docblock 2016-05-20 17:53:18 -03:00
Claudio Sanches 11cea999c1 Added custom titles for products tags items, closes #10958 2016-05-20 17:50:56 -03:00
Mike Jolley 020b8c92c6 Fix URLs with quot; characters
Fixes #10795
2016-04-27 15:24:10 +01:00
Fredrik Forsmo 398ab8a016 Add `public` keyword to public various methods 2016-04-26 19:26:56 +02:00
Mike Jolley df75080858 woocommerce_product_categories_widget_product_terms_args filter
Closes #10555
2016-03-14 15:52:04 +00:00
Mike Jolley 8345f67f6c Tweak price filter + code comments
#10371
2016-02-22 13:23:25 +00:00
Mike Jolley bc83a04c6c Feedback from Justin 2016-02-11 11:13:48 +00:00
Mike Jolley 4ccc1617d5 Absint rating in filters widget 2016-02-10 11:43:35 +00:00
Mike Jolley 39fc5a98ae Fix base URL 2016-02-10 11:16:49 +00:00
Mike Jolley 0197b78b38 Combine all count queries per widget 2016-02-10 11:07:42 +00:00
Mike Jolley bf87d292fe Combine queries 2016-02-10 10:36:06 +00:00
Mike Jolley 0dba78acc0 Remove use of global 2016-02-10 10:19:32 +00:00
Mike Jolley 6bdd12d960 Rating counts 2016-02-10 10:02:50 +00:00
Mike Jolley 5f98720206 Combine count 2016-02-10 00:07:07 +00:00
Mike Jolley 2642454fee > is faster 2016-02-10 00:04:01 +00:00
Mike Jolley 8b922cc710 Cast is faster 2016-02-10 00:01:55 +00:00
Mike Jolley c9cae8b214 No need to include children 2016-02-09 23:11:50 +00:00
Mike Jolley d23c316326 Refactor queries to use WP_QUERY only 2016-02-09 21:14:55 +00:00
Mike Jolley 75cbb74520 Rating widget standards 2016-02-09 15:18:27 +00:00
Mike Jolley e20565c498 Fix merge conflicts 2016-02-09 14:46:06 +00:00
Mike Jolley cae1fe6b85 Refactors/improvements to layered nav to support slugs
#7806
2016-02-09 14:41:17 +00:00
Matthew Duhig 6ef4fcb144 Update class-wc-widget-layered-nav.php
Updates to layered nav to considerably improve speed on sites with large product databases (10k+). This method has seen speed improvements as notable as taking a 30 second plus load time of a /shop page with layered nav, down to 4 seconds.
2016-01-21 17:06:57 +00:00
Serg ef867131e0 Change layered nav filters by ID to SLUG field 2016-01-19 10:15:42 +03:00
Fredrik Forsmo bc9019458c Improve docblock comments WC_Widget classes
* Added better comment to `widget`, `form` and `update` methods.
2016-01-06 19:58:38 +01:00
Nicola Mustone 7ed6eb2cb9 typo 2015-12-17 08:23:58 +01:00
Mike Jolley 6892d73ea9 Store product ids for terms in term meta rather than transient
Data is kept in sync by looking at when terms are set for an object and
then clearing the meta for old and new terms.
2015-11-14 16:25:09 +00:00
Ibrahim Ibn Dawood 094b42484e added min rating to active filters 2015-11-13 15:17:27 +05:30
Ibrahim Ibn Dawood 28fbdaa4c4 added min_rating query arg to layered nav 2015-11-13 15:17:02 +05:30
Ibrahim Ibn Dawood 584a8dac7c added min_rating query arg to price filter 2015-11-13 15:16:32 +05:30
Ibrahim Ibn Dawood 43474e7816 added class WC_Widget_Rating_Filter 2015-11-13 15:08:27 +05:30
Claudio Sanches ee30b5b308 Fixed php docs standards 2015-11-03 11:31:20 -02:00
Claudio Sanches d6dbb4aec2 Added "Hide empty categories" option on Product Category Widget
Closes #9441
2015-10-27 14:10:32 -02:00
Mike Jolley a3f3148cd0 Merge pull request #9277 from jackgregory/product-categories-show-count
Fix Product Categories Widget dropdown show count arg
2015-10-05 09:11:18 +01:00
Jack Gregory 0e3c46dd3b Fix Product Categories Widget dropdown show count arg 2015-10-03 13:46:14 +01:00
Mike Jolley c4ca7abd4c Check home URL not this page
Fixes #8963
2015-09-02 12:23:53 +01:00
Mike Jolley 5c948f374c Fix preg_replace in layered nav dropdown 2015-08-20 17:32:27 +01:00
Mike Jolley c5cba283ed Remove numbered arguments from queries 2015-08-07 11:37:19 +01:00
George Stephanis c938fa24da More missing esc_attr calls, :( 2015-08-05 15:17:52 -04:00
Mike Jolley e4a8602490 filter: woocommerce_widget_cart_is_hidden
Closes #8670
2015-07-28 11:06:31 +01:00
Claudio Sanches 9e41552342 Removed all "@return void" 2015-07-16 16:55:48 -03:00
Mike Jolley 1cd2e558ed Remove add to cart variable from links
Closes #8554
2015-07-10 11:17:21 +01:00
Mike Jolley 5937a08696 Fix cat dropdown URL
Because a filter is not a fix :)

Closes #8412
2015-06-22 10:22:15 +01:00
Claudio Sanches f333bb68b2 Improved js for widget layered nav #8332 2015-06-09 13:06:50 -03:00
Claudio Sanches 16ddd24887 [2.3] Fixed & and , for layered nav dropdowns, closes #8332 2015-06-09 12:49:57 -03:00
Mike Jolley 9009b334e7 Merge branch 'test-price-filter' 2015-06-09 15:15:15 +01:00
Mike Jolley fe58e1b5e9 Account for tax classes 2015-06-09 14:58:27 +01:00
Claudio Sanches 55efdc5077 Escaped js/url in widget layered nav when use the dropdown option, closes #8320 2015-06-08 13:10:23 -03:00
Claudio Sanches e6ae10ee9a Test 2015-05-29 10:01:43 -03:00
Remi Corson aa2e51f205 tweaked hooks 2015-05-18 12:48:36 +02:00
roykho ae678b538c add filter for products widget args 2015-04-29 07:36:27 -07:00
Gerhard c18c873b99 Ensure $wp->request has a trailing slash to avoid pagination issues. 2015-04-10 15:34:09 +02:00
James Koster cafe0927f5 count styles in widgets. closes #7677
make category / layered nav list styles and markup consistent with core
post category widget.
2015-03-09 16:06:48 +00:00
Claudio Sabatini 5aff801219 Update class-wc-widget-price
workaround to fix when prices are without taxes and display should include it
2015-03-06 11:30:08 +01: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
Claudio Sanches afb19715d4 Prevented XSS in urls 2015-01-29 12:33:06 -02:00
Claudio Sanches 157dde6695 Improved the description of count option of product categories widget 2015-01-02 11:08:38 -02:00
Mike Jolley 2f66bbd8c0 woocommerce_price_filter_meta_keys filter to allow plugins to define min/max meta keys that require searching
Closes #6492
2014-12-09 08:33:33 +00:00
Mike Jolley 1f3adbd0c2 esc_html for the term name 2014-11-25 10:38:54 +00:00
Mike Jolley f1f92e120d Merge pull request #6799 from bryceadams/patch-4459
#4459 - Add filters for product_list_widget before / after
2014-11-21 17:29:01 +00:00
Mike Jolley dd53f8e730 Move widget registration to own function/file - avoid register_widget in class files 2014-11-20 20:56:24 +00:00
Bryce bd96565eeb #4459 - Add filters for product_list_widget before / after
2 new filters introduced:

* `woocommerce_before_widget_product_list`
* `woocommerce_after_widget_product_list`
2014-11-20 12:57:39 +07:00
claudiosmweb 8eeb6fc204 Removed more some unused code 2014-11-19 22:43:09 -02:00
Mike Jolley d3dc8be3ec Undo commit which autoloaded widgets
Since they are loaded every time with core, it doesn’t make sense to
autoload them.
2014-11-19 18:08:38 +00:00
claudiosmweb 24e17e36d3 Preventing errors when adding a widget using the WP Customize
Fixed coding standards and used methods from WC_Widget for start and end the widget
2014-11-14 23:12:59 -02:00
James Koster 452cb56cd9 layered nav count markup matches product/post categories. #5606 2014-11-13 08:30:10 +00:00
Mike Jolley 69ca69ce52 Split up the product widget methods 2014-10-29 11:07:06 +00:00
Mike Jolley e90c634745 Code tidy 2014-10-14 12:54:10 +01:00
Mike Jolley 06f82686eb [2.2] and test, use term_taxonomy_id for transient names 2014-09-24 14:22:02 +01:00
shivapoudel fedb4dae7c Absolute path and Indentation fix for includes/widgets/*.php :) 2014-09-21 01:22:45 +05:45
Florian Ludwig 83ed3aa534 Fixed jQuery call 2014-08-22 23:01:25 +02:00
Florian Ludwig f6294d24be Rewrote old JS to jQuery and allow usage of multiple product categories widgets on one page 2014-08-22 21:39:10 +02:00
Barry Kooij 94365791af Changed all use of get_product to wc_get_product 2014-08-19 12:09:29 +02:00
Mike Jolley 89d7d2869f Revert "Merge pull request #6023 from krautnerds/master"
This reverts commit 9deee73b72, reversing
changes made to 1965c2b786.
2014-08-15 13:47:37 +01:00
Florian Ludwig 26d40f2336 Class instead of id for product categories widget
Also rewrote plain old JS to jQuery
2014-08-13 22:16:18 +02:00
Florian Ludwig ec41270587 Re-add all filters of widget on change of category
At the moment all filters that were applied via the layered nav filter
widget are gone on changing the category with the product category
filter
2014-08-13 17:13:58 +02:00
Florian Ludwig f2f56ebb4a Removed lines, were already deleted in upstream 2014-08-12 19:04:11 +02:00
Florian Ludwig b8c2912138 More general approach for widget dropdown_layered_nav 2014-08-12 18:56:37 +02:00
Mike Jolley a186e1e52f Merge pull request #5951 from grey-rsi/master
class-wc-widget-price-filter.php - add filter
2014-08-05 11:08:02 +01:00
GreY 9dd743158e Add filter to convert amount on based currency rate 2014-08-01 15:09:25 +03:00
Alexandru Furculita 8eb710ec5d Update class-wc-widget-cart.php 2014-08-01 13:47:07 +03:00
Alexandru Furculita 37e12a99b1 Update class-wc-widget-top-rated-products.php 2014-08-01 13:46:43 +03:00
Alexandru Furculita 8303d82172 Update class-wc-widget-top-rated-products.php 2014-08-01 13:46:33 +03:00
Alexandru Furculita e03905f935 Update class-wc-widget-recently-viewed.php 2014-08-01 13:46:20 +03:00
Alexandru Furculita 8d214e665d Update class-wc-widget-recent-reviews.php 2014-08-01 13:46:07 +03:00
Alexandru Furculita df7f5aa6ba Update class-wc-widget-products.php 2014-08-01 13:45:47 +03:00
Alexandru Furculita b326ea6612 Update class-wc-widget-product-tag-cloud.php 2014-08-01 13:45:36 +03:00
Alexandru Furculita d1de854c8f Update class-wc-widget-product-search.php 2014-08-01 13:45:18 +03:00
Alexandru Furculita 981bd515ed Update class-wc-widget-product-categories.php 2014-08-01 13:44:43 +03:00
Alexandru Furculita 332fbd2f93 Update class-wc-widget-price-filter.php 2014-08-01 13:44:29 +03:00
Alexandru Furculita 130521a7ab Update class-wc-widget-layered-nav.php 2014-08-01 13:44:15 +03:00
Alexandru Furculita 53f061f0a0 Update class-wc-widget-layered-nav-filters.php 2014-08-01 13:44:00 +03:00
Coen Jacobs 3ad8935b20 Removed ununsed global variables in local scopes 2014-06-08 22:33:11 +02:00
Mike Jolley ce18293c9f 2 filters for drop down functions Closes #5161 2014-05-28 11:28:20 +01:00
Coen Jacobs 2ed4aa26bd Prevent undefined notice for Layered Nav title 2014-05-21 11:26:20 +02:00
Mike Jolley ecbc6aac9c When hierarchy is off, only show children in the cat widget. Closes
#5245
2014-04-07 12:59:38 +01:00
Mike Jolley 95f4be04f9 Don't hide empty - do it at walker level to maintain correct counts and hierarchy Closes #5028 2014-03-17 16:52:24 +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
Mike Jolley e0b11c8c2e Corrected the "Show Siblings and Children Only" queries Closes #5028 2014-03-04 11:47:17 +00:00
Mike Jolley 6ff4ae1a7d Merge pull request #4903 from splashingpixels/master
Ran through jshint and fixed coding standards
2014-02-25 15:51:50 +00:00
Mike Jolley dcf4a50ca0 Layered nag - remember orderby #4889 2014-02-24 15:45:43 +00:00
splashingpixels 7d96eb70ee layer nav using list OR was not displaying any terms fixes #4911 2014-02-22 13:42:13 -08:00
Scott Basgaard 39b83a3039 Code clean up. Various undefined variables / notices. 2014-02-17 22:09:58 +01:00
Scott Basgaard 563adcaa86 Use 'include' parameter to show siblings/children of current category. Fixes #891 2014-02-17 22:00:25 +01:00
Mike Jolley 293c998a1d Set price slider min to min price. Closes #4183 2013-12-03 13:39:02 +00:00
Coen Jacobs 5291f2eec6 Code changes as suggested in #4238 2013-11-28 14:12:08 +01:00
Gregory K cac9d12bf9 PhpDocs 2013-11-28 07:54:19 -05:00
Coen Jacobs 4afbd0b556 Merge branch 'function-call-refactor'
Conflicts:
	includes/admin/post-types/meta-boxes/class-wc-meta-box-order-data.php
	includes/shortcodes/class-wc-shortcode-cart.php
	includes/wc-template-functions.php
2013-11-25 15:42:26 +01:00
Coen Jacobs 47ae00be28 Page functions woocommerce to wc refactor 2013-11-25 15:07:22 +01:00
Mike Jolley 51ba9c393f WC globals 2013-11-25 14:01:38 +00:00
Mike Jolley 3408965b8a Product functions 2013-11-25 14:01:38 +00:00
Mike Jolley 3973beae5d woocommerce_ functions to wc_ - replaced attribute functions 2013-11-25 14:01:37 +00:00
Coen Jacobs c1a439eb99 Formatting functions woocommerce to wc refactor 2013-11-25 14:34:21 +01:00
Coen Jacobs aaa14894ca Core functions woocommerce to wc refactor 2013-11-25 13:45:04 +01:00
Scott Basgaard 922fa990a5 esc_attr() all the things. 2013-11-20 20:11:59 +01:00
Scott Basgaard de77ec07ea esc_url() all the things. 2013-11-20 19:54:01 +01:00
Scott Basgaard 97fe6adaeb It's possible there are no attributes. Let's check first to avoid undefined notices. 2013-11-13 21:15:30 -05:00
Scott Basgaard 5b5704d196 More undefined checks to avoid PHP notices in widgets. 2013-11-13 21:11:00 -05:00
Emyr Thomas ba3282c737 Changed label of orderby setting in product category widget. 2013-10-31 21:42:31 +00:00
Mike Jolley 1b0d017bac Context in sorting order Closes #3909 2013-10-11 14:59:52 +01:00
Mike Jolley 081bef7f6b Layered nav OR logic 2013-09-27 09:55:04 +01:00
Mike Jolley b377217d1b Compat with brands - filters should be prepended with filter_
@coenjacobs can this be applied to .15?
2013-09-16 12:43:16 +01:00
Mike Jolley 7cf3c67c76 Wrapper for wp_get_post_terms to handle parent sorting. Closes #3762. Closes #3758
@coenjacobs for .15
2013-09-13 12:07:58 +01:00
Mike Jolley 355dd16962 Removed @coenjacobs helpers and cleaned up main clas 2013-09-12 14:41:02 +01:00
Mike Jolley 14e27bb073 Fixes from .14 2013-09-04 14:32:16 +01:00
Mike Jolley aa470ad390 refactor args for woocommerce_product_dropdown_categories
Closes #3218
2013-08-20 13:32:38 +01:00
Mike Jolley 16ed6e4faf Make sort orders affect other get_terms calls Closes #3439. 2013-08-19 14:31:52 +01:00
Mike Jolley 3a4b83cffe Fix encoding in layered nav. Fixes #3600
@coenjacobs for .14
2013-08-19 13:12:49 +01:00
Renato Covarrubias a63a77e414 Fix warning if is null 2013-08-03 23:59:26 -04:00
Mike Jolley 34c90813bd Price filter widget: preserve orderby Closes #3307. 2013-07-19 07:11:41 +01:00
Mike Jolley 9f5f81c1aa cat-parent without extra query. Closes #3355. 2013-06-28 10:07:18 +01:00
Coen Jacobs a55556332c Extra escaping on layered nav href to prevent injection 2013-06-26 11:44:35 +02:00
Mike Jolley fc104fc84b Post types need to exist first 2013-06-20 12:05:11 +01:00
Mike Jolley 1ff10d6ccf Enable for all taxonomies 2013-06-20 12:05:11 +01:00
Mike Jolley 4397b00c4a classes -> includes (for includes) 2013-06-11 14:28:45 +01:00
Mike Jolley c75ea04c1c classes -> includes 2013-06-11 14:25:30 +01:00