Query Product WooCommerce Elementor
March 12, 2025 · AI Conversations
### **Method 1: Using Built-in Query Options**
1. **Edit the Page/Post with Elementor**
2. **Drag the Products Widget** (Available in Elementor Pro under WooCommerce elements)
3. **Go to the “Query” Section** inside the widget settings.
4. Under **Source**, select:
– **Manual Selection** – to choose specific products.
– **Featured Products** – if you want to showcase only featured products.
– **Sale Products** – for discounted products.
– **Category/Tag-Based Selection** – for products in specific categories or with specific tags.
5. **Publish/Update the Page**
—
### **Method 2: Mark a Product as Featured**
If you want specific products to be featured:
1. **Go to WordPress Dashboard → Products** (WooCommerce)
2. Find the product you want to feature.
3. Click the **Star Icon** in the “Featured” column.
4. Alternatively, open the product edit page and check the **"This is a featured product"** option.
Now, when you select **"Featured Products"** in the Elementor query settings, only those marked as featured will appear.
—
### **Method 3: Custom Query for Advanced Filtering**
If you need more control over product selection (e.g., filtering by custom meta, stock status, etc.), you can use Elementor’s **Custom Query Filter Hook**:
Add the following code in your **theme’s functions.php** file:
add_action('elementor/query/custom_featured_products', function ($query) {
$meta_query = $query->get('meta_query');
$meta_query[] = [
'key' => '_featured',
'value' => 'yes',
];
$query->set('meta_query', $meta_query);
});
Then, in the Elementor Product Query settings, select **Custom Query** and enter **custom_featured_products** as the query ID.
—
### **Bonus: Using Shortcodes**
You can also use the WooCommerce shortcode inside an Elementor **Shortcode widget**:
[products limit="6" columns="3" visibility="featured"]
This will display 6 featured products in 3 columns.
—
### **Conclusion**
– Use Elementor’s built-in **Query options** for featured or specific product categories.
– Mark products as **Featured** in WooCommerce if needed.
– For advanced control, use a **custom query hook** or **shortcode**.
Would you like additional filters such as sorting by price, category, or custom attributes? 🚀