+ Reply to Thread
Results 1 to 7 of 7

Thread: If price field empty - show a word

  1. #1

    Post If price field empty - show a word

    Hello Flynax family!

    Inside 'add a listing' form we all have the price field. Some of my sellers don't want to share the price of their products so I need to add a command so when the field is left empty , a set word to appear instead of the price.

    Could someone help me with the command and the file that I have to edit?

    PLEASEEEEE
    Thank You!

  2. #2
    Any help, please?

  3. #3
    Is this post invisible to admins?

  4. #4
    Quote Originally Posted by Spinu Alexandru View Post
    Hello Flynax family!

    Inside 'add a listing' form we all have the price field. Some of my sellers don't want to share the price of their products so I need to add a command so when the field is left empty , a set word to appear instead of the price.

    Could someone help me with the command and the file that I have to edit?

    PLEASEEEEE
    Thank You!
    Have had a quick look and you need to find the following and add an else statement after the code

    Find the file in templates/ YOUR TEMPLATE NAME / controllers / listing_details.tpl

    Approx line 80:

    {if $price_tag_value}
    <div class="price-tag" id="df_field_price">{$price_tag_value}</div>
    {/if}

    change to:

    {if $price_tag_value}
    <div class="price-tag" id="df_field_price">{$price_tag_value}</div>
    {else}
    <div class="price-tag" id="df_field_price">SET WORD GOES HERE</div>
    {/if}

    I have not tested but theoretically should work, make sure you back up and save previous file before uploading new file so you can recover if it doesnt work.

  5. #5
    It works brilliant my friend, i cannot know how to thank you, you're awesome!

  6. #6
    Hey i have this kinda code how i can make it if there is no price word show Contact Please

    <!-- price tag -->
    {if $price_tag_value}
    <div class="price-tag" id="df_field_price"><span>{$price_tag_value}</span> {if $listing_data.sale_rent == 2}/ {$listing.common.Fields.time_frame.value}{/if}</div>
    {/if}
    <!-- price tag end -->

  7. #7
    Junior Member
    Join Date
    Jun 2017
    Posts
    25

    Contact Seller for Pricing - Tpl updates

    This is my solution for this code on the listing_details.tpl file.

    <!-- price tag -->
    {if $price_tag_value > 0}
    <div class="price-tag" id="df_field_price"><span>{$price_tag_value}</span> {if $listing_data.sale_rent == 2}/ {$listing.common.Fields.time_frame.value}{/if}</div>
    {else}
    <div class="price-tag" id="df_field_price"><span>Contact Seller For Pricing</span></div>
    {/if}
    <!-- price tag end -->

    Only generally tested... use at your own risk. ; - )

    Update: I have found several other locations needing update.

    Ad Listing Pages (not details)
    Featured Ads
    etc etc... I am working on hunting these down now and correcting, I will post when I figure them out.

    If you find other locations, let me know.

    ::update with more locations altered::

    Featured Items (for some reason using the value > 0 did not work here, so I just let it test for blank or not blank)
    /template/blocks/featured_item.tpl
    {if $featured_listing.fields[$config.price_tag_field].value }
    <div>
    <span>{$featured_listing.fields[$config.price_tag_field].value}</span>
    {if $featured_listing.sale_rent == 2}/ {$featured_listing.fields.time_frame.value}{/if}
    </div>
    {else}
    <div>
    <span>Contact For Pricing</span>
    </div>
    {/if}

    Listing Page (list of ads, not detail, only for blank prices, not 0.00)
    /template/blocks/listing.tpl

    {if $listing.fields[$config.price_tag_field].value}
    <span class="price-tag">
    <span>{$listing.fields[$config.price_tag_field].value}</span>
    {if $listing.sale_rent == 2}/ {$listing.fields.time_frame.value}{/if}
    </span>
    {else}
    <span class="price-tag">
    <span>Contact Seller For Pricing</span>
    </span>
    {/if}
    Last edited by Tim Wade; September 29, 2017 at 12:56 PM. Reason: found other locations needing updating

+ Reply to Thread