Swatch button not rendering


Woocommerce / cwicly:
When selecting “attribute” > “select” on a Swatch block within a repeater, variants for current product is listed in drop-down. But, when selecting “attribute” > “button”, nothing get rendered at all. I expected the button-option to render a button for each variant.

Step-by-step reproduction instructions:

In single product template with a product that has variants selected in dynamic preview, as well as when viewing product in published template.

Environment info

  • WordPress version: 6.3.2
  • Cwicly Plugin version:

Hi @batrikperg,

I believe this issue is not a bug but rather a result of some confusion regarding the functionality of the Swatch block.

To clarify, a swatch is designed to display a general attribute type (such as button, select, color, or image) or specific attributes that you may want to style differently.

In your specific case, it appears that your product attribute is of the “select” type. This means you can select the attribute, including the specific one associated with that attribute.

Please note that you cannot change the attribute type directly from the editor; this is typically handled on the Attributes page when setting up attributes for your products.

If you choose an attribute and nothing appears in the editor, it indicates that you are selecting an attribute type that doesn’t correspond to the product’s attribute type.

So if you wish to have a Button type attribute, be sure to modify your attribute accordingly from the Attributes page.

Essentially, the Swatch block allows you to style several attributes quickly by defining a style for a general type.

I hope this helps clear up any confusion on this.
Please don’t hesitate to let me know if you have any other questions on this.

@Araminta You’re right, I had totally misunderstood how to set it up correctly. Now it’s working as intended for me! Thanks for the swift help!

1 Like