Overview of the Issue
If you’re using FooGallery Pro Commerce with WooCommerce to sell digital downloads, you may have noticed an issue where products displayed in the cart or checkout page appear incomplete. Specifically:
- Product images do not appear.
- Product titles are missing.
- The price and variations are correct, but essential product details are not displayed.
This issue occurs primarily when using WooCommerce Blocks for the cart and checkout pages. However, switching to the Classic Shortcode approach resolves the problem.
Why Is This Happening?
When WooCommerce created the newer block versions of the traditional cart shortcodes, they did not carry over all the functionality. They are either still in the process of migrating some of this over, or they will not migrate it and we will have to build in a new way to complete our FooGallery functionality.
As a result, FooGallery’s ability to inject image and title data into these pages is disrupted.
WooCommerce’s hook system allows developers to modify and extend functionality without altering core files(Introduction to Hooks, Actions, and Filters). However, WooCommerce Blocks do not support certain critical hooks, preventing FooGallery from injecting necessary data into the cart and checkout pages.
For a detailed reference of all WooCommerce hooks, visit the official WooCommerce Hook Reference.
Technical Explanation
When a product is added to the cart, FooGallery relies on WooCommerce hooks to retrieve and display product details. However, WooCommerce Blocks do not support some of these hooks, meaning:
- The product metadata, including the title and image, may not get passed correctly.
- The cart and checkout pages may not render custom metadata, affecting product variation display.
- Thumbnail images, permalinks, and custom download details may be missing due to unsupported hooks.
Affected Hooks That Cause This Issue
The missing product images and titles in the cart and checkout pages are primarily caused by the lack of support for the following WooCommerce hooks used in FooGallery:
- woocommerce_cart_item_thumbnail – Adjusts the thumbnail for cart items.
- woocommerce_cart_item_name – Modifies the product name displayed in the cart.
- woocommerce_get_item_data – Controls how additional metadata (such as variations) is shown in the cart.
- woocommerce_order_item_permalink – Adjusts the product link in the order summary.
- woocommerce_checkout_create_order_line_item – Modifies the order item at checkout.
- woocommerce_admin_order_item_thumbnail – Affects how thumbnails are displayed in the WooCommerce admin order view.
Since these hooks are not supported in WooCommerce Blocks, FooGallery cannot properly display product images and names in the cart and checkout pages.
The Workaround: Switching to Classic Shortcode
The recommended solution for this issue is to switch to the Classic Shortcode method instead of using WooCommerce Blocks.
Why Does This Work?
The Classic Shortcode method does not rely on WooCommerce Blocks but instead uses the traditional PHP-based WooCommerce templates, where all legacy hooks are still functional. Since FooGallery was designed to work with these traditional hooks, switching back allows product details (including images and titles) to be properly displayed in the cart and checkout.
How to Enable Classic Shortcode
1. Edit the checkout/cart page in WooCommerce.
2. Locate the WooCommerce block settings.
3. Choose “Classic Shortcode” shown in the image below.
4. Save changes.
Here’s a brief video recording demonstrating how this is done: Fixing Missing Product Images in WooCommerce Checkout: Easy Workaround
By using this workaround, product images and titles will be displayed correctly again.
Who Is Responsible for This Issue?
This issue is not caused by FooGallery but rather by WooCommerce’s decision to deprecate and remove support for key hooks. Since WooCommerce Blocks no longer provide full support for these hooks, FooGallery and other plugins that rely on them are affected.
This is a WooCommerce limitation, and until they offer better extensibility in their Blocks system, the best way to ensure correct product display is to use Classic Shortcode.
For a full list of supported and unsupported hooks, refer to the WooCommerce documentation here: WooCommerce Hook Support
WooCommerce Hooks Used by FooGallery & Their Support Status
The following table outlines the WooCommerce hooks and filters specifically used by FooGallery and their support status in WooCommerce Blocks:
Hook/Filter | Purpose | Support Status in WooCommerce Blocks | Potential Issue if Unsupported |
woocommerce_process_product_meta | Saves product metadata | ❌ Unsupported | Product metadata may not be saved properly. |
woocommerce_product_data_panels | Adds fields to product panels | ❌ Unsupported | Custom fields may not appear in the product edit screen. |
woocommerce_product_after_variable_attributes | Adds variation settings fields | ❌ Unsupported | Custom variation settings may not be saved or displayed. |
woocommerce_save_product_variation | Saves variation settings | ❌ Unsupported | Variation details may not be stored correctly. |
woocommerce_grant_product_download_permissions | Adds files to order | ❌ Unsupported | Digital downloads may not be granted properly. |
woocommerce_checkout_create_order_line_item | Adjusts order items | ❌ Unsupported | Custom product data may not be added to order items. |
WooCommerce Hooks Running When Loading Cart/Checkout Shortcodes and Blocks
The following table outlines the WooCommerce hooks that are added to FooGallery and run when loading Cart/Checkout shortcodes and blocks:
Hook/Filter | Purpose | Support Status in WooCommerce Blocks | Potential Issue if Unsupported |
woocommerce_cart_item_thumbnail | Adjusts cart thumbnails | ❌ Unsupported | Product images may not be displayed in the cart. |
woocommerce_cart_item_name | Adjusts cart item names | ❌ Unsupported | Product names may not appear in the cart. |
woocommerce_get_item_data | Displays variable item data | ❌ Unsupported | Variation metadata may not be shown in the cart. |
woocommerce_order_item_permalink | Adjusts order item permalinks | ❌ Unsupported | Order item links may not direct users to the correct product. |
woocommerce_checkout_create_order_line_item | Adjusts order items | ❌ Unsupported | Custom product data may not be added to order items. |
woocommerce_admin_order_item_thumbnail | Adjusts admin order item thumbnails | ❌ Unsupported | Product thumbnails may not appear in the admin order view. |
Summary & Next Steps
- If you experience missing product images and titles on the cart/checkout page, switch to Classic Shortcode to resolve the issue.
- Understand that this is a WooCommerce limitation, not an issue with FooGallry or other third-party plugins experiencing similar issues due to the unsupported hooks.
- Developers interested in a workaround should consider alternative WooCommerce APIs or methods to integrate product details without relying on deprecated hooks whenever possible.
For further updates, keep an eye on WooCommerce’s extensibility documentation to check if they reintroduce support for these essential hooks in future releases.