Troubleshooting Composite Products

Composite Products is a powerful WooCommerce extension that allows you to create flexible, customizable product bundles. However, flexibility can come with complexity—and sometimes, unexpected issues. Often the issues we see are related to third party extensions that modify or override core WooCommerce functionality. On this page, we’ll share some issues we’ve seen users encounter with Composite Products, and provide advice so you can resolve them.

Missing images/thumbnails on composite products

↑ Back to top

When a page loads, if some or all of the images are not loaded, or show up blank, this tends to indicate a conflict with a lazy-loading script.

Typically lazy-loading is added either by the active theme or a performance plugin. Disabling lazy-loading and clearing the site’s and browser’s cache should resolve this issue.

Some Components or Scenarios don’t save when clicking update

↑ Back to top

This is a common issue on WP sites with lots of plugins (lots of data to post, process and save).

In most cases the default value of the max_input_vars parameter is 1000 — this means that only the first 1000 form fields are allowed to be processed and saved. Due to the amount of configurable fields added by Composite Products on the edit-product page, a higher value is required to allow precessing and saving lots of Components/Scenarios without issues.

The only way to fix this reliably is to ask your host to change this in their php.ini configuration file. Once this is done, it’s recommended to double check that the value has been changed correctly by navigating to WooCommerce > Status.

Setting it to at least 5000 usually resolves the problem.

How to troubleshoot component options that disappear in random intervals

In the past we have received some reports about component options that disappear in random intervals. In most cases, this issue is temporarily resolved either by updating the products themselves or by updating the Composite Product.

Usually we’ve seen this issue be triggered by a product filtering plugin, such as Product Filter for WooCommerce and Redux Framework, or themes that filter WordPress query results.

Here’s what we’ve seen happen: Composite Products stores its results in a cache/transient that expires after 24 hours. When this time elapses, and someone attempts to load a Composite Product on the site, the plugin will run a fresh query to get the available options for each Component. It’s during that time that a filter in third-party code is filtering query results.

This issue often cannot be consistently replicated, therefore is very difficult to troubleshoot.

Steps to troubleshoot

↑ Back to top

If there is a filtering plugin active in the affected site, you can confirm the issue by locating any piece of code that could modify the WP_Query results and trigger this issue. To do so, follow these steps:

  1. Disable query results caching for Composite Products.

To do this, add the following line to your wp-config.php file:

define( 'WC_CP_DEBUG_QUERY_TRANSIENTS', true );

This will ensure that a new WordPress query is run for every Component with every page load. If third party code is filtering the query and causing the issue the most likely scenario is that after doing this, all front-end queries in Composite Products will be broken right away.

  1. Install a plugin such as Query Monitorhttps://wordpress.org/plugins/query-monitor/. This will allow you to debug composite products queries and find which piece of code might be modifying them.
  2. Open the Query Monitor console and click on Hooks and Actions.
  3. Locate the following two action hooks:
    • woocommerce_composite_component_query_start 
    • woocommerce_composite_component_query_end 

If there’s no custom code filtering WP Queries, there will be no data listed next to any action/filter hooks listed in between these two, like in the screenshot below.

In contrast, if there is any code that modifies WP Query results, there should be some information there that will help you identify where it’s coming from.

How to troubleshoot an empty Catalog Price

Every time a Composite Product is saved and the Catalog Price > Calculate From/To option is chosen, the extension searches for the product combinations with the min/max price.

When:

  • There are many Components / Component Options and;
  • the Composite includes Scenarios;

the complexity of this calculation increases to a point that the price “search” needs to be carried out in a separate task/process that runs in the background for a few minutes.

For example, if a Composite consists of 5 Components, with 10 options each, then there are 10^5 = 100.000 possible configurations that need to be checked against Scenarios. If the Composite includes millions of possible configurations, this process may fail to return results, and you as an admin will see a message upon editing or viewing the affected Composite.

Resolution Options

↑ Back to top

There are several potential “solutions” to this problem:

  • The “hardware” solution. Use a more powerful CPU with more cores, as the “search” supports multi-threading (more CPUs = faster search).
  • The “software” solution. Improve the code (which is already heavily optimized) to keep searching in a background task for longer than 20 seconds. This means that Composites will be saved instantaneously — however the catalog price of a Composite that’s being “processed” may not show up until minutes later, which is not ideal.
  • Ignore Scenarios when calculating the catalog price — if you decide to proceed with this, there’s a chance that the displayed catalog price may not correspond to a valid combination of selections. Add the following filter to ignore scenarios in price calculations:
    • add_filter( 'woocommerce_composite_price_data_permutation_calc_scenarios', '__return_false' );

How to handle non-purchasable Variable composited items

Variable Products and variations that are part of a Composite Product must have a price assigned, even when Priced Individually is unticked. WooCommerce does not allow products with a blank price to be purchased. Similarly, Variable products must have a non-empty parent product price to be purchasable in composite products.

If you’re seeing that composite products that contain variable components aren’t purchasable, even when they all have a price assigned, a plugin conflict may be causing the issue.

WooCommerce normally calculates the price of the cheapest variation and stores it in the price meta of the parent product — however, some third-party plugins may interfere with this process, which causes WooCommerce’s WC_Product_Variable::is_purchasable() check to return false. While this causes no issue to WooCommerce core, it prevents Composite Products from working correctly.

In most cases, a temporary workaround is to:

  1. Open the affected Variable product.
  2. Open a variation and change its price to a new value.
  3. Save.
  4. Change back the price you modified in Step 2 and Save again.

This will cause WooCommerce to re-sync the Variable product and re-populate its price meta.

We haven’t been able to identify a clear pattern as to the cause of this issue, however it is usually triggered by either a plugin conflict or a product import that failed to populate all the variation fields. If it is caused by a plugin conflict, then the issue may show up again in the future.

General plugin/extension compatibility issues

↑ Back to top

Composite Products follows sound coding practices and WooCommerce standards, so typically works well with other plugins and themes, but issues can and do still arise. We ensure and maintain compatibility with the extensions listed on our Compatibility and Integrations page.

Some of the issues we’ve seen caused by compatibility issues or conflicts with Composite Products are:

  • Infinite page loads on Composite Product pages
  • Infinite component form loading
  • Specific functionality added by other plugins not being added to composite products or their components.
  • Discounts or dynamic pricing from third party extensions not being applied as expected
  • Incorrect pricing showing for Composite Products in the cart
  • Errors or timeouts when trying to add Composite products to cart
  • Composite product and component images not loading or changing as expected.
  • Unexpected notices showing on the during product configuration

If you see unexpected behavior around Composite products, it’s a good idea to check for conflicts as a first step. Keep everything updated, check logs for fatal errors, or console messages in the browser console. On a staging site you can selectively deactivate extensions or theme features until the culprit is found.

Questions and Support

↑ Back to top

Something missing from this documentation? Do you still have questions and need assistance?

  • Have a question about a specific extension or theme you’d like to purchase? Use our Contact us page to get answers.
  • Have you already purchased this product and need some assistance? Get in touch with a Happiness Engineer via the WooCommerce.com Support page and select this product name in the “Product” dropdown.