Go Back   Mosets Community > Archives > Mosets Hot Property 1.0 > Discussions, Troubleshooting and Problems

 
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-22-2010, 07:28 PM
denisp denisp is offline
Junior Member
 
Join Date: May 2009
Posts: 3
Unhappy if the price is zero, i'd like a text

hi all,

in the old version of HP, i modified the hotproperty.html.php file.
this hack was to "echo" a text if the value of the price was = 0 (zero).

right now, on the new versione 1.0, i'd like do the same.
i think the file is views/property/tmpl/default.php line 125 e so on...
but i can't manage the variable and the code in the same way.

PHP Code:
if ($key=="price") {
                            if (isset($this->fields['price'])) { 
                                if (!$this->fields['price']->hideCaption) { ?><span class="hp_caption"><?php echo $this->fields[$key]->caption?>: </span> <?php 
                                echo 
"<span class=\"hp_price\">".$this->fields["price"]->prefix_text.$hpconf->hp_currency." ".number_format($this->p->price$hpconf->hp_dec_point$hpconf->hp_dec_string, ($hpconf->hp_thousand_sep) ? $hpconf->hp_thousand_string:'').$this->fields["price"]->append_text"</span><br /> "
                            } 
                        }
can you help me?
thanks in advance.
d
  #2  
Old 12-22-2010, 10:13 PM
gray gray is offline
Mosets'd
 
Join Date: Apr 2006
Posts: 901
Default

find in \views\properties\tmpl\property.php
PHP Code:
        if (!empty($extrafield_value)) : ?>
            <?php if (!$extrafield->hideCaption && !empty($extrafield->caption)) : ?>
                <dt class="caption <?php echo $extrafield->name?>"><?php echo $this->escape($extrafield->iscore JText::_($extrafield->caption) : $extrafield->caption); ?></dt>
            <?php endif; ?>
            <dd class="value <?php echo $extrafield->name?>"><?php echo $extrafield_value?></dd>
        <?php endif; ?>
replace with
PHP Code:
        if (!empty($extrafield_value)) : ?>
            <?php if (!$extrafield->hideCaption && !empty($extrafield->caption)) : ?>
                <dt class="caption <?php echo $extrafield->name?>"><?php echo $this->escape($extrafield->iscore JText::_($extrafield->caption) : $extrafield->caption); ?></dt>
            <?php endif; ?>
            <?php if ($extrafield->name == 'price' && $extrafield_value == 0): ?>
                <?php echo 'YOUR TEXT'?>
            <?php else: ?>
                <dd class="value <?php echo $extrafield->name?>"><?php echo $extrafield_value?></dd>
            <?php endif; ?>
        <?php endif; ?>
__________________
4HP: Slideshow Module New!
www.topcomhomes.com
  #3  
Old 12-23-2010, 04:57 PM
denisp denisp is offline
Junior Member
 
Join Date: May 2009
Posts: 3
Default

thanks gray,

this hack works fine on the property detail page.

but i'd need that "YOUR TEXT" also been publishe in the front page, where HP pubblish the list of properties.

here can you help me?

thanks

Last edited by denisp; 12-23-2010 at 05:36 PM.
  #4  
Old 12-23-2010, 05:36 PM
gray gray is offline
Mosets'd
 
Join Date: Apr 2006
Posts: 901
Default

in HP1.0 and HP1.0.1
components\com_hotproperty\views\properties\tmpl\p roperty.php
__________________
4HP: Slideshow Module New!
www.topcomhomes.com
  #5  
Old 12-23-2010, 05:40 PM
denisp denisp is offline
Junior Member
 
Join Date: May 2009
Posts: 3
Default

Quote:
Originally Posted by gray View Post
in HP1.0 and HP1.0.1
components\com_hotproperty\views\properties\tmpl\p roperty.php
yes, i just upgrade the component, and the file was there.
please, can you help for the frontpage list of properties? (i edited the post)
  #6  
Old 02-17-2011, 08:29 AM
dknight dknight is offline
Mosets Team - Lead Developer
 
Join Date: Dec 2004
Posts: 26,645
Default

Here's a slight change from gray's replacement code that has a missing <dd> enclosure:
PHP Code:
      if (!empty($extrafield_value)) : ?> 
                <?php if (!$extrafield->hideCaption && !empty($extrafield->caption)) : ?> 
                    <dt class="caption <?php echo $extrafield->name?>"><?php echo $this->escape($extrafield->iscore JText::_($extrafield->caption) : $extrafield->caption); ?></dt> 
                <?php endif; ?> 
                <?php if ($extrafield->name == 'price' && $this->row->price == 0): ?> 
                    <dd class="value <?php echo $extrafield->name?>"><?php echo 'YOUR TEXT'?></dd>
                <?php else: ?> 
                    <dd class="value <?php echo $extrafield->name?>"><?php echo $extrafield_value?></dd> 
                <?php endif; ?> 
            <?php endif; ?>
__________________
Lee
Lead Developer
Mosets.com - Quality Joomla! Solutions

Last edited by dknight; 11-21-2011 at 12:58 PM. Reason: Fixed bug where price is always showing 'YOUR TEXT'
  #7  
Old 03-03-2011, 01:58 AM
SteveB SteveB is offline
Mosets'd
 
Join Date: Apr 2005
Posts: 132
Default Partly works

Hi all,

This works well in the Property Detail page but doesn't change the price in the browse property list (where you only get a thumbnail of the property).

Can you tell us how to chnage the price to text in the property list view (including 'Latest Property - 'Featured Properties' etc...)

Thanks in advance

Kind regards

Steve
  #8  
Old 03-03-2011, 07:42 PM
SteveB SteveB is offline
Mosets'd
 
Join Date: Apr 2005
Posts: 132
Default Actually replacing price with text to all properties

Hi all,

I just did a little more testing on the code in this thread.

I set a property price to zero (although it then defaults to 0.00 on the back end form.

The price then shows 'Price on Application' (replaced 'YOUR TEXT').

However, I then open any other property and all of them have changed to 'Price on Application' ??

Have I misconfigured something fundemental here?

Thanks for any help in advance.

Kind regards

Steve
  #9  
Old 11-21-2011, 01:02 PM
dknight dknight is offline
Mosets Team - Lead Developer
 
Join Date: Dec 2004
Posts: 26,645
Default

Hi Steve,

To have the same behaviour in properties view, edit the following file:

components\com_hotproperty\views\properties\tmpl\_ summary.php
LINE: 44
CODE:
PHP Code:
    $extrafield_value MosetsHTML::_('hotproperty.content.extrafield'$extrafield$this->property); 
Replace with the following:
PHP Code:
    if ($extrafield->name == 'price' && $this->property->price == 0): 
        
$extrafield_value 'YOUR TEXT';
    else: 
        
$extrafield_value MosetsHTML::_('hotproperty.content.extrafield'$extrafield$this->property);
    endif; 
__________________
Lee
Lead Developer
Mosets.com - Quality Joomla! Solutions
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Price in text format Fabian.Leferink Discussions, Troubleshooting and Problems 11 05-15-2010 05:54 PM
Text in price field maurizio Discussions, Troubleshooting and Problems 2 04-07-2009 02:08 PM


All times are GMT +8. The time now is 02:57 AM.

Copyright © 2005-2010 Mosets Consulting

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.