Wordpress conditional shows “$0.00 text” instead of “just text”

感情迁移 提交于 2019-12-24 11:36:07

问题


I have the following code to show a table of coming events in my page:

{is_future}
<tr>
    <td>#_EVENTLINK</td>
    <td>#d/#m/#Y</td>
    <td>#_EVENTNOOFDAYS</td>
    <td>#_EVENTTIMES</td>
    <td>{not_free}#_EVENTPRICEMAX{/not_free} {fully_booked}Geen plaatsen beschikbaar{/fully_booked}</td>
</tr>
{/is_future}

This works fine for events that can still accept reservations. However when an event has been booked full, it shows "€0,00 Geen plaatsen beschikbaar" instead of "Geen plaatsen beschikbaar".

It looks like it just sets the price to a default value when the event is fully booked. Does anyone know what might be wrong?


回答1:


You are showing the price on the condition not_free, and that has nothing to do with whether fully_booked is true or not.

If you want the price not to show when the event is fully booked, then you will have to nest the price display into an additional has_spaces condition (opposite of fully_booked).

Reference: http://wp-events-plugin.com/documentation/conditional-placeholders/



来源:https://stackoverflow.com/questions/22507046/wordpress-conditional-shows-0-00-text-instead-of-just-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!