• Resolved Invex09

    (@invex09)


    I’m using The Events Calendar plugin v5.14.1 on WordPress v5.9.3 with “Active Block Editor for Events” enabled (ie Gutenberg is used for editing events in the backend). There is a block called “Event Price” that allows me to set a price as well as a description for that price. Screenshot here: https://imgur.com/2qojB9T

    I can enter this field on the backend and then save/modify it when editing events. However, I can’t figure out how to echo this field in my custom templates on the frontend. The ‘tribe_get_cost()’ function does not reference it. If I var_dump the event object, I see its label in the object ‘_EventCostDescription’ but cannot find the value I set. And it appears in the object markup to be an array of one element that contains an empty string. This is what is echoed in the object:

    ["_EventCostDescription"]=> array(1) { [0]=> string(0) "" }

    Again, though, this value is stored when I go to edit the event on the backend. Any ideas on how echo/use this value in my templates? I’m stumped, thanks in advance for any help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support masoodak

    (@masoodak)

    Hi @invex09,

    Thanks for reaching out!

    After some initial debugging I am able to confirm the issue as tribe_get_cost doesn’t return cost description and the _EventCostDescription postmeta comes up empty.

    Kindly bear with me while I dig some more into this. Will get back to you shortly.

    Many thanks for your patience in this regard.

    Thread Starter Invex09

    (@invex09)

    Thanks for the reply Masood! If you could let me know when it’s resolved that would be great, I’ll update my plugin to the latest version and then test my code. Thanks again

    Plugin Support masoodak

    (@masoodak)

    Hi @invex09,

    As per a developer of our team the only place this value is stored is in the raw block attributes. He has setup a custom function that will help you fetch event cost description value,

    https://gist.github.com/skyshab/8d0992d38b2a7a0bf8f84b114c1ac747

    Kindly give this a try and let us know if this helps.

    Kind regards,
    Masood

    Plugin Support masoodak

    (@masoodak)

    Hi there,

    This thread has been pretty quiet for a while, so we’re going to go ahead and close it. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Have a great day.

    Kind regards,
    Masood

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot Get “Cost Description” Field from Event Price Gutenberg Block’ is closed to new replies.