WordPress有条件显示“ $ 0.00文本”;而不是“仅文本” [英] Wordpress conditional shows "$0.00 text" instead of "just text"
问题描述
我有以下代码来显示页面中即将发生的事件的表格:
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}
此功能适用于仍可以接受预订的活动。
但是,当事件已满时,它显示为€0,00 Geen plaatsen beschikbaar,而不是 Geen plaatsen beschikbaar。
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?
推荐答案
您正在显示条件 not_free
,这与完全预订的
是否正确无关。
You are showing the price on the condition not_free
, and that has nothing to do with whether fully_booked
is true or not.
如果您希望在活动已满时不显示价格,则必须将价格显示嵌套到附加的 has_spaces
条件中(与<$ c相反) $ c> fully_booked )。
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
).
参考: http://wp-events-plugin.com/documentation/conditional-placeholders/
这篇关于WordPress有条件显示“ $ 0.00文本”;而不是“仅文本”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!