Forum

Thread tagged as: Question, Shop

Shop price is 0.00

Hi All

Im trying to set the message TBC when a price is 0.00 or not set

ive tried the below but it says TBC even if a price is set

<perch:if !exists="price">
                        <span>TBC</span>
                    <perch:else />
                        <perch:if exists="on_sale">
                          <span class="sale-price"><perch:shop id="sale_price" type="shop_currency_value" label="Price" size="m" min="0" step="any" /></span>
                          <span class="price-was"><perch:shop id="price" type="shop_currency_value" label="Price" size="m" min="0" step="any" /></span>
                        <perch:else />
                          <perch:shop id="price" type="shop_currency_value" label="Price" size="m" min="0" step="any" />
                        </perch:if>
                    </perch:if>
Anthony Elleray

Anthony Elleray 2 points

  • 5 years ago

Hi,

I don't think you can do !exists - try not-exists instead, so:

<perch:if not-exists="price">

That still shows the price rather than TBC

Drew McLellan

Drew McLellan 2638 points
Perch Support

What is the value of price in perch:showall ?

nothing

price   
Array
(
    [47] => 
)
sale_price  
Array
(
    [47] => 
)
trade_price 
Array
(
    [47] => 
)
Drew McLellan

Drew McLellan 2638 points
Perch Support

Try

<perch:if id="price" match="neq" value="">

so now i have

<h4>Price -
                        <perch:if id="price" match="neq" value="">
                            <perch:if exists="on_sale">
                              <span class="sale-price"><perch:shop id="sale_price" type="shop_currency_value" label="Price" size="m" min="0" step="any" /></span>
                              <span class="price-was"><perch:shop id="price" type="shop_currency_value" label="Price" size="m" min="0" step="any" /></span>
                            <perch:else />
                              <span><perch:shop id="price" type="shop_currency_value" label="Price" size="m" min="1.00" step="any" /><perch:if exists="per-hr"><span class="per-hour">Per Hour</span></perch:if></span>
                            </perch:if>
                        <perch:else />
                            <span>TBC</span>
                        </perch:if>
                    </h4>

and shows the price at 0.00 still

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you tried

<perch:if id="price" match="neq" value="0.00">

or

<perch:if id="price" match="lt" value="0.01">

Neither of them work

Still show the price at £0.00

Drew McLellan

Drew McLellan 2638 points
Perch Support

Has it changed from 0.00 to £0.00 ?

The £ is automatically put their by perch

in the admin area the price field is empty

but displays as £0.00 on the front end

i just need it to be TBC (or other message) so customers dont get confused with it being a free product

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, let me test a few things.

Thanks :)

Was there a fix for this

i could always have another checkbox to hide the price

Drew McLellan

Drew McLellan 2638 points
Perch Support

I've not yet had a chance to investigate.

I would be interested in a proper solution for this too. Until then, I'm also using the checkbox workaround.