When adding a repeater block, there are certain conditions where selecting most of the WooCommerce dynamic data sources aren’t working. You can select the data source, but afterwards, the repeater will not accept a block to be nested within it.
It only seems to work when you add the repeater, select the data source, then select a product for the dynamic preview. After setting the dynamic preview, it will function as normal, allowing you to nest a block within it.
Step-by-step reproduction instructions:
- Open the Post Editor/Site Editor
- Either create a page/post/template, or use an existing one
- Add a repeater block
- Select a WooCommerce data source (Cart items seems to function correctly, any others don’t)
- Begin to notice errors. The repeater is expected to have a button to add a block, but it doesn’t
- Try adding an image block, then nesting it under the repeater. The repeater refuses it.
- Try wrapping the image block in a repeater (right click on image > Wrap > Repeater)
- Select the image and observe error where there is no inspector panel for the image block.
- Delete all of this to try another method
- Add a new repeater, setting the source to cart items.
- Nest an image in the repeater
- Switch the repeater source to Woo Gallery
- Try setting the image to a dynamic source and observe errors. The dynamic source options listed are for cart items, not for Woo Gallery.
- Delete all of this to try the only working method
- Add a repeater
- Set the source to Woo Gallery
- Set a dynamic preview. If one is already set, remove it and reset it.
- The repeater will now accept an image block. The image block will now have the correct dynamic source options.
Screenshots, screen recording, code snippet
Environment info
- WordPress version: 6.2.2
- Cwicly Plugin version: 1.2.9.8.3
PHP 8.1.21