The solution:
$query = array(
'post_status' => 'publish',
'post_type' => 'product',
'posts_per_page' => 10,
'meta_query' => array(
array(
'key' => '_price',
'value' => array(50, 100),
'compare' => 'BETWEEN',
'type' => 'NUMERIC'
),
),
);
$wpquery = WP_Query($query); // return 10 products within the price range 50 - 100
Related Posts:
- How to search post titles with whole words only, but not the exact word only?
- Search and replace text across all posts
- Automatically adding category filter based on search string
- WooCommerce shop page orderby [closed]
- AJAX search posts and pages
- Redirect to another page using contact form 7? [closed]
- How to get a list of bundled products using wp_query in woocommerce
- Woocommerce Backend Search by Title and SKU
- woocommerce search by sku and title ajax
- WordPress Multi-Step Product Search
- Custom search search does not work?
- WooCommerce Product Table – filter query on attributes
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- Only return taxonomies that are linked to a category & product
- Multiple Meta key in search
- History of page, interval of years
- WP-Snap too slow (caused by WP_Query?)
- ‘Active lotteries’ only custom query for woocommerce lottery plugin and elementor
- Can we install 3d product configurator into wordpress
- Shipping Refund via Stripe Creates New Order Instead of Updating Original Order
- What is the best way to mimic a search query within a plugin
- HTML in WooCommerce settings
- How can i list random post from multiple category?
- how do i remove posts from a WP_Query so the pagination is right?
- Serve different files depending on OS/Browser
- Is there a way I can find wordpress posts that don’t contain a word?
- Accessing post’s meta data based on user’s click of a post
- How to configure two SMTP Server for wordpress
- Absolute Image URL in srcset is appended to the upload dir
- Dropdown menu on custom page with product to choose number of products per page
- Plugin echos text from shortcode function in gutenberg page editor
- Woocommerce plugin for minimum order and add-to-card-step
- Add Product Subtitle to Woocommerce Product Page
- Change wordpress current_time function to different timezone
- Only Homepage not loading properly
- How can you include a theme template file from within a plugin (i.e. WooCommerce’s Shop page)?
- showing all search result in one template
- woocommerce 3.2.1 not sending order notification emails
- Integrating non-WooCommerce and WooCommerce Orders together [closed]
- Change the method of a class from child function.php
- Search is not working on plugin directory
- Get all products which have both product category
- Override Javascript in a Plugin?
- WooCommerce Custom Product to checkout
- Woocommerce – How to populate custom select field with stored values on checkout page?
- WP Query with custom Shortcode
- Get posts from WP_Query and format them on admin_head
- Automatically add attributes to woocommerce product?
- Reduce Drop down Menu Width in WordPress
- Not getting author rank when using return
- How to query the custom fields by language?
- How do I “get the next 10 posts after post_id == x”?
- Search Everything plugin integration
- switched from query_posts to WP_query, not working now?
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- DROP TABLE with uninstall hook not working
- Editing the default wordpress search
- How to enable specific plugin only based around shop manager role?
- What are wsm tables for?
- WordPress automatically removes line break
- Why required field not working in Country dropdown in WooCommerce –
- Woocommerce API HTTP Response 401
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- How to use WP-CLI / WC-CLI to bulk import 1000s of products (variable and simple)?
- Add woocommerce variation images in gallery?
- woocommerce payment gateway callback not firing [closed]
- How to modify WCMP Rest API response?
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
- How to change this WP_Query to get all ProductIDs and not only specific one?
- Woocommerce dependent plugin
- How to check current user before all actions and filters?
- New databes tables with – WooCommerce – for developers [closed]
- How to send an automated email to the customers when product is added woocommerce
- Search for categories
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- WooCommerce: Building a page with user input which is used to query order status and external API and return a result
- woocommerce product countdown not showing in variable product? [closed]
- Change commission_status paid when withdraw_status vendor is completed
- I want to disable Cash on delivery based on product tag in woocommerce Checkout Page [closed]
- Is there a way to create custom product templates based on category on WooCommerce?
- Woocommerce Deposit, then random payments until product paid in full [closed]
- How to toggle between two custom fields in WordPress woocommerce ‘WC Product Field Group’ plugin?
- custom payment gateway in woocommerce failed to connect to remote api server
- WordPress default Search function inconsistent in WooCommerce Product Titles
- Programmatically Process Order through WooCommerce/Stripe Payment Gateway [closed]
- Replacing a plugin function with a custom renamed function doesn’t work
- CampaignMonitor for WooCommerce – Move subscribe button [closed]
- Extend product search with meta in WooCommerce
- Multiple Billing forms in WooCommerce (one billing form per product)
- Creating a Callback URL for WordPress Woocommerce to update Order Status
- Change Product Addon price based on select Variation
- WooCommerce – Maximum qty per line per product
- Woocommerce Create custom product type with variations
- Remove /product/ from url. I want only category name then product name
- Pre booking doesn’t work with custom bootstrap modul in woocommerce [closed]
- WooCommerce specifc variations for specific user role [closed]
- Save custom attributes of product in woocommerce
- Filtering WooCommerce Orders by Category
- How to call WordPress function other files