Counter Element not working with Dynamic content

Hi!

The Counter element has an option to add dynamic data for the Start and End number.

If I add {{dc:woocommerce:cart_items}} to it, but it is showing NaN. I have added items to the cart, so it should be able to show the number of the cart items. And show Zero when there is none.

If this is not possible, perhaps it would be good to remove this as an option.

Thanks!

Hello Misho,

Thanks for writing in! I can confirm that it returns NAN. It is because the return output is a mixed character like <span data-csdc-wc-cart-items>7<\/span> which the field does not accept and returns NAN instead. I’ve submitted this to our issue tracker so the developers will be made aware of it.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

Hi @Misho,

Just wanted to chime in here and say we got this issue sorted out with the latest round of changes for the Layout Builder WooCommerce compatibility. The issue was the cart item count (same with cart total) being wrapped in a span so it can be updated live if the user adds an item to their cart. We’ve split this out into two dynamic options “Cart Item Count (Realtime)” and “Cart Item Count (Raw)”. The former is the same as it’s always been so it’s backwards compatible and the Raw option will work inside places like the Counter since it just provides a number. This does however mean that the Counter won’t update in realtime as you add items.

1 Like