Dynamic Dates - Rendering Issues

Hi Charlie,

I hope all is well.

I have noticed an issue with dynamic dates, which has previously slipped past me. In the below screenshot, the product’s title contains a dynamic year using dynamic content in the form of the global date, as below.

In the admin view, it looks like this:

However, as soon as the product hits the Cart or Checkout, the dynamic content date renders as the {{dc…}}


Is this one something which can be fixed? :grin:

Thanks,
Christopher

Hello Christopher,

Thank you for the inquiry.

You may need to hardcode the year because the dynamic template will not be translated in the templates/pages shown in your screenshots. Another option is to create a custom shortcode instead of using the dynamic template.

function x_current_year_cb() {
    return date('Y');
}
add_shortcode('x_current_year', 'x_current_year_cb');

Let us know if you need more info.

Best regards.

Hello Ismael,

Apologies for a late reply. Your shortcode idea partially works. However, on the Checkout page, it correctly displays the year for about 2-3 seconds before changing it to the shortcode. Do you know if there is any way of overcoming this?

Thanks,
Christopher

Hi Christopher,

If you’re adding a shortcode inside the Product Title field, it will not automatically render. Please remember that WordPress doesn’t execute shortcodes in titles by default. You need to enable it by adding custom code, which is beyond the scope of our Theme Support.
I would suggest you hire a developer who can assist you in doing the customization or you can avail of our newly launched service called One TOTAL CARE, where we offer small customizations

Thanks

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