manifest / unclassified / anvogue-core-patch
Anvogue Core
Anvogue Core Plugin - Sold Products Filter Patch
★ 0stars
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/lancedesk/anvogue-core-patch/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Anvogue Core Plugin - Sold Products Filter Patch
Overview
This patch adds a "Sold Products" filter option to all Elementor product query widgets in the Anvogue Core plugin. When selected, this filter will display only products that have _stock_status set to 'outofstock' (sold items).
Features Added
- ✅ Sold Products Filter: New "Sold Products" option in all Elementor product widget data source dropdowns
- ✅ WooCommerce Integration: Proper integration with WooCommerce shortcode system
- ✅ Cross-Widget Support: Works with all product widgets (grid, slider, tabs, hotdeal, etc.)
- ✅ Conflict Prevention: Smart filtering system that prevents conflicts with other queries
- ✅ Bug Fix: Fixed fatal error with missing
PLS_Swatchesclass - ✅ Global Sold Items Exclusion: Automatically excludes sold items from category tabs and other widgets
Files Modified
Core Plugin Files
anvogue-core.php- Added global filter initialization for sold products exclusioninc/functions.php- Added sold products query logic and WooCommerce shortcode filters
Elementor Integration
inc/elementor/elementor-functions.php- Fixed fatal error with PLS_Swatches class check
Elementor Widgets
inc/elementor/widgets/woo-products-grid-slider.php- Added sold_products optioninc/elementor/widgets/woo-products-widget.php- Added sold_products optioninc/elementor/widgets/woo-featured-products.php- Added sold_products optioninc/elementor/widgets/woo-products-with-banner.php- Added sold_products optioninc/elementor/widgets/woo-products-tabs.php- Added sold_products optioninc/elementor/widgets/woo-products-hotdeal.php- Added sold_products option and query logic
Installation Instructions
- Backup your current Anvogue Core plugin before applying this patch
- Replace the modified files in your Anvogue Core plugin with the patched versions
- Clear any caches (Elementor, WordPress, etc.)
- Test the functionality by creating/editing an Elementor page with product widgets
How It Works
For Most Widgets (Grid, Slider, Tabs, etc.)
- When "Sold Products" is selected in the data source dropdown
- The system adds a WooCommerce shortcode filter hook
- The filter modifies the query to only include products with
_stock_status = 'outofstock' - The filter automatically removes itself after use to prevent conflicts
For Hotdeal Widget
- Uses direct WP_Query with custom sold products logic
- Queries products with
_stock_status = 'outofstock' - Integrates seamlessly with existing hotdeal functionality
Global Sold Items Exclusion
- Automatic Exclusion: All WooCommerce shortcode queries automatically exclude sold items
- Category Tabs Fixed: Category tabs widget now properly excludes sold items from all tabs
- Smart Filtering: Only excludes sold items when not specifically showing sold products
- Admin Protection: Filter is disabled in admin area to prevent backend issues
Technical Details
Query Logic
// Meta query added to filter sold products
$meta_query[] = array(
'key' => '_stock_status',
'value' => 'outofstock',
'compare' => '='
);
Filter Hooks
// WooCommerce shortcode filter for sold products (specific)
add_filter( 'woocommerce_shortcode_products_query', 'pls_core_filter_sold_products_query', 10, 3 );
// Global filter to exclude sold products from all queries
add_filter( 'woocommerce_shortcode_products_query', 'pls_core_exclude_sold_products_globally', 5, 3 );
Safety Features
- Global variable tracking to ensure filter only applies when needed
- Automatic filter removal to prevent conflicts
- Proper class existence checks for external dependencies
Compatibility
- ✅ WooCommerce: Fully compatible with WooCommerce product system
- ✅ Elementor: Works with all Elementor product widgets
- ✅ WordPress: Compatible with WordPress 5.0+
- ✅ PHP: Compatible with PHP 7.2+
Testing
After installation, test the functionality by:
- Create a new Elementor page
- Add any product widget (Products Grid, Products Slider, etc.)
- Select "Sold Products" from the Data Source dropdown
- Verify only sold/out-of-stock products are displayed
- Test with different widgets to ensure consistency
Troubleshooting
If the filter doesn't work:
- Clear all caches (Elementor, WordPress, CDN)
- Check for plugin conflicts - temporarily disable other plugins
- Verify WooCommerce is active and products exist with
_stock_status = 'outofstock' - Check WordPress error logs for any PHP errors
If you see fatal errors:
- Restore the original files from your backup
- Check PHP version - ensure PHP 7.2 or higher
- Verify file permissions - ensure files are readable
Support
This patch was created to add sold products filtering functionality to the Anvogue Core plugin. For issues or questions:
- Check the troubleshooting section above
- Review the technical details to understand the implementation
- Test with a clean WordPress installation to isolate issues
Version Information
- Patch Version: 1.0.0
- Created: 2024
- Compatible with: Anvogue Core Plugin (latest version)
- Requires: WooCommerce, Elementor
License
This patch follows the same license as the original Anvogue Core plugin.
Note: Always backup your site before applying any patches or modifications.