I was close to the answer here, but held back by being unfamiliar with how global WordPress can be, and how that can be used to extend plugins. All I needed to do was wrap the plugin logic in a check for the presence of Woocommerce:
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
// Stuff goes here
}
…and set the parameters for the search:
$args = array(
'limit' => -1,
'category' => array($category_slug),
'tag' => array($tag_slug));
$products = wc_get_products( $args );
Related Posts:
- How to modify WCMP Rest API response?
- how to do login using woocommerce rest api From android
- How to authenticate custom API endpoint in WooCommerce [closed]
- WP WC CLI – WooCommerce setup store with wp-cli [closed]
- Add Products to user’s ID Woocommerce
- How does WooCommerce display a custom comment_type in Comment Admin?
- Custom Shipping method not showing in checkout
- REST-API: extend media-endpoint
- How to prevent action in ajax request, when in admin side?
- Create or Update thousands of woocommerce products via PHP
- Is it possible to set up multistore in Woocommerce? [closed]
- How to remove the woocommerce_checkout_process action hook in woocommerce if particular project in cart [closed]
- HTML in WooCommerce settings
- Woocommerce plugin for minimum order and add-to-card-step
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- woocommerce payment gateway callback not firing [closed]
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- Woocommerce dependent plugin
- How to check current user before all actions and filters?
- New databes tables with – WooCommerce – for developers [closed]
- Change commission_status paid when withdraw_status vendor is completed
- custom payment gateway in woocommerce failed to connect to remote api server
- wp_remote_get() returns 403 while file_get_contents() does not
- Creating a Callback URL for WordPress Woocommerce to update Order Status
- Woocommerce Minimum Price for a Composite Product to add in cart
- How can I insert thousands of Woocommerce products by batch with PHP? [closed]
- Redirect to another page using contact form 7? [closed]
- WordPress REST API Plugin Development – Add Custom Endpoint
- How to create WordPress custom end point with multiple parameters?
- WooCommerce – set session with new cart item meta when updating cart item quantity [closed]
- Get Every Key & Value from Array then Display All in New Line
- Add_rewrite_endpoint doesn’t work with post name permalink structure
- Add a “View all” button on WooCommerce product archives pages
- add seperate suffix for low price and high price in woocommerce
- Cross Sells are not being shown in Cart Page. Please Help!
- Error with get_price (and others) in self-written plugin to show price
- Search users with custom meta data
- WordPress custom plugin that uses woocommerce enabled payment gateway for payment [closed]
- Disable variations on woo commerce if out of stock
- How to add category and subcategory in WordPress custom code?
- Seperate plugin and theme files
- WooCommerce – I want to add functionality of one plugin to another plugin — best approach?
- Change Dashboard URL from wp-admin to wp-admin/index.php
- How to Get Category Name When Export Products
- wp_query ‘s’ parameter does not work with WC_AJAX
- Grouping imported products and showing variations based on selected product
- wc_get_template_part doesnt display the content [duplicate]
- Remove Zero Money From Previews Order woocommerce
- Visual composer custom element error
- How would I Redirect an existing WooCommerce customer to a specific url after Checkout
- How can i solve php upgrade problem
- Make downloadable ebook read online without download option
- woocommerce: Customize email with item total count
- show wc_add notices on particular page in woo commerce custom plugin development
- How to get the checkout form data from checkout page when place-order button is clicked
- Woocommerce convert simple products to variations
- How to make WooCommerce multiple filter with custom meta fields
- One WooCommerce Store to multi distributor sites
- How to create a plugin with automatic update?
- category page multiple products add to cart any plugin available for woocommerce
- is it possible to fetch data from a remote api while admin is writing a new post?
- add tags to wordpress post using REST API
- “Enable Media Replace” plugin does not update serialized object in WPMeta
- Change Woo Custom Endpoint Titles from a Plugin
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- Use Case: Multiple Shipping Methods per Order
- Showing how many times is plugin activated or deactivated
- In woocommerce, is there any way to empty wordpress default mini cart when order placed?
- Can’t access 3rd party API, code works on local server but not on wordpress
- Get a list of Product Categories inside a loop
- wc_get_product_terms() throws “Notice: Undefined offset: 0”
- Woocommerce list variations that are added already to cart in Single Product
- Not displaying Woocommerce product page in lightbox
- Fetching users data from REST API
- Hide ‘add to cart’ button for some products [duplicate]
- Change pricing in Woocommerce based on Category and Product [closed]
- Adding/ Removing actions for plugins
- Problem with conditional woocommerce custom checkout field
- Unable to sync woocommerce variations
- woocommerce blank page after clicking add to cart [closed]
- Extend WordPress REST API with Scheme Pro Plugin
- Unable to show 4 products in a row
- The plugin generated xxx characters of unexpected output during activation
- Hook for single product thumbnail
- wordpress Ajax success doesn’t return the value
- How can I send api calls from my plugin?
- Predefine Product Variations for specific custom product type [closed]
- Create Custom Coupon Type
- How to create a “plugin” or “block” that can manipulate WordPress DOM in frontend?
- Template selector for woocommerce product
- WooCommerce REST API aborts connection [closed]
- Is it possible to create post in wordpress using postman?
- Can we install 3d product configurator into wordpress
- How to use `$order->get_discount_total()`, avoiding defoult WC decimal rounding?
- Accessing Correct Database to Create REST API Endpoint
- A multi-section WordPress store [closed]
- External CSS in WordPress Plugin [closed]
- Custom Post Type template for homepage
- How can I call functions from a custom plugin?
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?