WP Manifestindependent plugin directory
manifest / unclassified / anvogue-core-patch

Anvogue Core

Anvogue Core Plugin - Sold Products Filter Patch

★ 0stars

Install

Download source zip No release zip yet

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.zip
No 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_Swatches class
  • ✅ 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 exclusion
  • inc/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 option
  • inc/elementor/widgets/woo-products-widget.php - Added sold_products option
  • inc/elementor/widgets/woo-featured-products.php - Added sold_products option
  • inc/elementor/widgets/woo-products-with-banner.php - Added sold_products option
  • inc/elementor/widgets/woo-products-tabs.php - Added sold_products option
  • inc/elementor/widgets/woo-products-hotdeal.php - Added sold_products option and query logic

Installation Instructions

  1. Backup your current Anvogue Core plugin before applying this patch
  2. Replace the modified files in your Anvogue Core plugin with the patched versions
  3. Clear any caches (Elementor, WordPress, etc.)
  4. Test the functionality by creating/editing an Elementor page with product widgets

How It Works

For Most Widgets (Grid, Slider, Tabs, etc.)

  1. When "Sold Products" is selected in the data source dropdown
  2. The system adds a WooCommerce shortcode filter hook
  3. The filter modifies the query to only include products with _stock_status = 'outofstock'
  4. The filter automatically removes itself after use to prevent conflicts

For Hotdeal Widget

  1. Uses direct WP_Query with custom sold products logic
  2. Queries products with _stock_status = 'outofstock'
  3. Integrates seamlessly with existing hotdeal functionality

Global Sold Items Exclusion

  1. Automatic Exclusion: All WooCommerce shortcode queries automatically exclude sold items
  2. Category Tabs Fixed: Category tabs widget now properly excludes sold items from all tabs
  3. Smart Filtering: Only excludes sold items when not specifically showing sold products
  4. 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:

  1. Create a new Elementor page
  2. Add any product widget (Products Grid, Products Slider, etc.)
  3. Select "Sold Products" from the Data Source dropdown
  4. Verify only sold/out-of-stock products are displayed
  5. Test with different widgets to ensure consistency

Troubleshooting

If the filter doesn't work:

  1. Clear all caches (Elementor, WordPress, CDN)
  2. Check for plugin conflicts - temporarily disable other plugins
  3. Verify WooCommerce is active and products exist with _stock_status = 'outofstock'
  4. Check WordPress error logs for any PHP errors

If you see fatal errors:

  1. Restore the original files from your backup
  2. Check PHP version - ensure PHP 7.2 or higher
  3. 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:

  1. Check the troubleshooting section above
  2. Review the technical details to understand the implementation
  3. 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.