When your are updating your product regular price is saved to _regular_price
and sale price is saved to _sale_price
meta_key. Also WooCommerce will figure out which is the current price sale or regular and will save it to _price
meta_key. There is no need to sort products by two _regular_price
and _sale_price
meta_keys. Your current prices should be stored in _price
meta_key and this key should be used to sort products by price.
Try to investigate your SQL $query->request
and database records to figure this out.
Keep in mind that if your sale price is scheduled you have to make sure that WooCommerce cron jobs are working correctly to update _price
meta_key.
Related Posts:
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Filter hook before create order WooCommerce
- Display WooCommerce newest product reviews on top [closed]
- How to change Woocommerce breadcrumbs content?
- Add Dropdown menu using “add_filter => wp_nav_menu_items”
- Search results sorted by post types
- Why anything done on comments_array hook gets reset?
- Filter category in WooCommerce shop page to display related sub-category
- How to change currency programmatically on creating order action?
- Sorting and limitation with pre_get_posts
- Redirect to checkout woocommerce failed
- Filter the regular price of woocommerce products
- Filter Media by Featured on Admin
- WooCommerce sort products by the actual product width(not the shipping width)
- Adaptive product filters for WooCommerce
- Add default user field to WooCommerce checkout [closed]
- Link to Shop-Filter with .current-menu-item
- Adding a Clone link to product attributes – post_row_actions() filter, or how to override a Class question
- Woocommerce “added to cart” message on main(home) page
- Replacing a deprecated filter ‘woocommerce_get_price’ with ‘woocommerce_product_get_price’
- Woocomemrce order and registration fileds to UPPERCASE
- Redirect to woocommerce checkout after adding to cart – item already in cart
- WooCommerce coupon hook argument NULL when using filter woocommerce_get_shop_coupon_data
- How to access page variable inside action hook
- Drop down filter sort posts by latest, last 7 days and monthly
- how to develop a filter in wordpress to let the user filter the page content depends on the date (newest to oldest etc…)?
- Put data in my-account/view-order/id/ page
- Modify WooCommerce email shipping text value
- Filter and Search
- WooCommerce comments_template Filter Not Firing
- Woocommerce: Only one review per verified buyer [closed]
- How to remove a filter that is an anonymous object?
- No filter of code on switch from html to visual editor, how?
- How to modify posts_where filter only for the search query
- How to wrap oEmbed-embedded video in DIV tags inside the_content?
- How to add filter with 2 args?
- Adding revision support to WooCommerce product content
- Changing text within the Block Editor
- Search content for shortcodes and get parameters
- How Can I Have A URL Changed Based on the Originating URL?
- Is it possible to Hook/Filters Attachment Creation?
- Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu
- Hide some items from Screen options in dashboard for products
- How to hook some Unicode texts into calendar widget safely?
- How to add attributes to tag when template cannot be directly modified
- how to remove filter from wordpress shortcode output
- Change email from and display name with a filter action
- Reverse engineering of WooCommerce Storefront filters
- Edit pagination text in the get_the_posts_pagination function
- How to center oEmbedded content
- When adding buttons to the tinyMCE editor, how do I make them wrap to the next line and/or display in the “Kitchen Sink” area?
- Add Sortable Column For All Post Types
- How to change the order of HTML output of a core block?
- How to add ‘total’ value to custom column title on the posts list page
- When to use add_action when registering/enqueuing scripts
- Is it possible to use multiple spaces in title?
- add_filter(allowed_block_types) -> adding core/paragraph bugs Gutenberg editor
- How to remove medium size class in gravity form for input tag?
- Filter out comments with certain meta key/s in the admin backend
- HTML and custom field variable, inside variable
- WordPress custom admin notice still displays after wp_insert_post_data validation
- Custom wp_query time filter on meta_value
- get post id within add_filter()
- Run posts_where and posts_join only on the main query
- Media upload default title from file name
- run shortcode in excerpt of single custom post type
- Use of comment_reply_link_args filter
- Shortcodes within the sidebar text/html widget: How to preserve the raw HTML output of the shortcode?
- WordPress removing slashes from shortcode output
- when use function the_content break
- Filter page title (displayed in browser tab) of wp-login
- Adding html banner to posts
- How does wordpress add ‘style’ attribute to element
- output custom Posts on a Page
- Filter “Your latest posts”
- Hide certain product filters from specific product categories
- Hooked into wp_get_attachment_caption to add content to the default description; not working for jetpack slideshow. Why?
- How sort products by calculate value? ( custom post meta, price, option)
- Add an attribute to the root from functions.php with add_filter
- Would like to use hook or filters to customize email templates
- Removing menus from users other than the administrator
- Override woocommerce loop-start.php from theme using plugin?
- Can’t understand apply_filter logic
- Overriding Plugin function in your child theme
- Modify oembed code conditionally
- How can I add a prefix to titles displayed in sidebar using function.php?
- Modify Default URL for /wp-includes/js/wp-emoji.js?ver=4.6.1
- List all image sizes still getting disabled sizes
- Why this remove empty paragraphs from the_content does not works?
- wp_editor customization
- What problems could happen if I replaced add_filter and add_action with the function calling
- posts_results filter function memory errors
- Custom Search Template for Custom Post Types
- Adding to an array & passing it through do_action/apply_filters
- Loading a sidebar on an Ajax call
- the_excerpt() does not work with has_excerpt()?
- Custom excerpt_more filter not working when tag is present
- Taxonomy search filters
- How do you disable the verification process of user email changes?
- Modify the third (context) parameter in a filter?