Property Status

Discussion in 'Real Estate Classifieds Script' started by Eleanna, Nov 26, 2014.

  1. Eleanna

    Eleanna Member

    I need to add "For Sale", "Withdrawn" and "Under Offer" to the status list for the properties. Where do I find the dropdown list for the status vield to add these values? I would have tought to find it under the listings fields, but no such luck...
    This is what I was told before

    You can also add new category (for example, To let), for RE package by using following way: log into your Subrion Admin Panel -> Real Estate -> Listings Fields -> check (tick) the entry with Title=Category in the appeared grid -> Edit -> click on 'Add Item Value' button if you want to add new RE category.

    No such thing as a "category" title in the grid, and no "Status" or "Category" field in the list...

    Anybody?
    Thanks
    Eleanna
  2. Gleb_S.

    Gleb_S. Subrion Designer Staff Member

    Hello @Eleanna !

    Adding additional statuses is a complicated process and requires basic knowledge of MySQL and PHP as well as JavaScript.
    Short answer: Add constants in ia.front.estate.php. Modify SQL query so that listings with this statuses wil be available on front. Add statuses in database (estates table, status column). Edit javascript file (grid-listings.js) in admin panel so that these statuses will be available on Listings page.

    Maybe in future versions of RE package we will simplify this process. But now this is how it works.

    Thanks.
  3. Eleanna

    Eleanna Member

    Ok, thanks. I'll take a backup and have a go at this later on. I think you should either modify the editing so that people can do this themselves without messing up the system, or add the status "Under Offer" and "Withdraw" to the default listing. I would never have believed this until I saw it. As soon as a property is labelled as "Under Offer", 3 or 4 more offers come in, and a good few emails enquiring about the offer and/or similar properties are received. It is like a knee-jerk reaction from people. These two labels are some of the most effective marketing tools a real estate agent has...
  4. Gleb_S.

    Gleb_S. Subrion Designer Staff Member

  5. Eleanna

    Eleanna Member

    ok, will do
  6. wazza

    wazza Member

    Hi Eleanna,

    If you take your time i believe there are only 3 files that need to be edited.

    Please be careful as this is UNTESTED
    Please be careful as this is UNTESTED



    /realestate/includes/classes/ia.base.package.php

    Add Statuses as follows

    const STATUS_FORSALE= 'forsale';
    const STATUS_WITHDRAWN= 'withdrawn';
    const STATUS_UNDEROFFER= 'underoffer';

    /realestate/js/admin/grid-listings.js

    find

    statuses: ['available', 'hidden', 'sold', 'approval'],

    change to

    statuses: ['available', 'hidden', 'sold', 'approval', 'forsale', 'withdrawn', 'underoffer'],

    /realestate/includes/classes/ia.front.estate.php

    find

    protected $_statuses = array(self::STATUS_AVAILABLE, iaCore::STATUS_APPROVAL, self::STATUS_HIDDEN, self::STATUS_SOLD);

    change to

    protected $_statuses = array(self::STATUS_AVAILABLE, iaCore::STATUS_APPROVAL, self::STATUS_HIDDEN, self::STATUS_SOLD, self::STATUS_FORSALE, self::STATUS_WITHDRAWN, self::STATUS_UNDEROFFER);


    I think that's about it.

    Please be careful as this is UNTESTED


    Regards,
    Quentin
    Vasily_B. likes this.
  7. Eleanna

    Eleanna Member

    ok, created more badges, done all that, added the statuses to the database, but new statuses are not visible in admin...
    Last edited: Nov 29, 2014
  8. wazza

    wazza Member

    also in ia.admin.estate.php

    find

    protected $_statuses = array(self::STATUS_AVAILABLE, iaCore::STATUS_APPROVAL, self::STATUS_HIDDEN, self::STATUS_SOLD);

    change to

    protected $_statuses = array(self::STATUS_AVAILABLE, iaCore::STATUS_APPROVAL, self::STATUS_HIDDEN, self::STATUS_SOLD, self::STATUS_FORSALE, self::STATUS_WITHDRAWN, self::STATUS_UNDEROFFER);
  9. wazza

    wazza Member

    will be a couple of changes to install.xml aswell

    Code (Text):
                <![CDATA[
    CREATE TABLE `{prefix}estates` (
        `id` int(7) unsigned zerofill NOT NULL,
        `category` enum('sale', 'rent') NOT NULL default 'sale',
        `status` enum('approval', 'available', 'hidden', 'sold') NOT NULL default 'approval',
        `location_id` mediumint(6) unsigned NOT NULL,
        `member_id` mediumint(7) unsigned NOT NULL,
        `date_added` datetime NOT NULL,
        `date_modified` datetime NOT NULL,
        `views_num` mediumint(8) unsigned NOT NULL,
        `featured` tinyint(1) unsigned NOT NULL,
        `featured_start` datetime NULL,
        `featured_end` datetime NULL,
        `sponsored` tinyint(1) unsigned NOT NULL,
        `sponsored_start` datetime NULL,
        `sponsored_end` datetime NULL,
        `sponsored_plan_id` smallint(5) unsigned NULL,
        UNIQUE `INDEX` (`id`),
        KEY `CATEGORY` (`category`),
        KEY `STATUS` (`status`)
    ) {mysql_version};
                ]]>
            </sql>
    Code (Text):
        `status` enum('approval', 'available', 'hidden', 'sold', 'forsale', 'withdrawn', 'underoffer') NOT NULL default 'approval',
  10. wazza

    wazza Member

    ther will be some css stuff to do and phrases. Hopefully this gets you started :D
  11. Eleanna

    Eleanna Member

    ok, I now have them showing in the Status field as {forsale}, {withdrawn} and {underoffer} instead of Forsale, Withdrawn, Underoffer
  12. wazza

    wazza Member

    yea thats the phrases. Will need to be added to install.xml
  13. wazza

    wazza Member

    ill post in a sec
  14. wazza

    wazza Member

    <phrase category="common" key="forsale">For Sale</phrase>
    <phrase category="common" key="withdrawn">Withdrawn</phrase>
    <phrase category="common" key="underoffer">Under Offer</phrase>

    Needs to be added in the
    <phrases>
    </phrases>

    section on the install file
  15. wazza

    wazza Member

    I have probably missed other things so just let me know how you go... Will help as much as i can
  16. Eleanna

    Eleanna Member

    You're a gent. Remind me to stand you a few bottles of Tzikoudia if you ever make it over here:)
    Meanwhile, still looking at {withdrawn} and {underoffer} instead of Withdrawn and Under Offer. I've made the changes to the css file while changing the "to Let" badge, so once we have this sorted, then we should get the appropriate badge on the front end. I hope... Would I be right in thinking that this has to do with communication with the database not working properly? Gleb mentioned something about modifying an SQL query?
    Last edited: Nov 30, 2014
  17. Eleanna

    Eleanna Member

    Hi Gleb,

    Hi Gleb,

    we've made a few changes so that the system now shows a "To Let" badge instead of the "available" badge, which we found a little confusing. Now, how do we get rid of the original grey information icon?
    Last edited: Nov 30, 2014
  18. wazza

    wazza Member

    Should fix the problem
  19. Eleanna

    Eleanna Member

    Thanks Wazza, much appreciated.

    This is what I have done so far:

    realestate/install.xml

    added:
    <phrase category="common" key="withdrawn">Withdrawn</phrase>
    <phrase category="common" key="underoffer">Under Offer</phrase>
    to <phrase>...</phrases>

    and changed this line (344) to this, to include 'withdrawn' and 'underoffer'
    `status` enum('approval', 'available', 'hidden', 'sold', 'withdrawn', 'underoffer') NOT NULL default 'approval',

    includes/classes/ia.admin.estate.php

    changed this line to include 'self::STATUS_WITHDRAWN' and 'self::STATUS_UNDEROFFER'

    protected $_statuses = array(self::STATUS_AVAILABLE, iaCore::STATUS_APPROVAL, self::STATUS_HIDDEN, self::STATUS_SOLD, self::STATUS_WITHDRAWN, self::STATUS_UNDEROFFER);

    includes/classes/ia.base.package.php

    added

    const STATUS_WITHDRAWN= 'withdrawn';
    const STATUS_UNDEROFFER= 'underoffer';

    includes/classes/ia.front.estate.php

    changed this line to include 'self::STATUS_WITHDRAWN' and 'self::STATUS_UNDEROFFER'

    protected $_statuses = array(self::STATUS_AVAILABLE, iaCore::STATUS_APPROVAL, self::STATUS_HIDDEN, self::STATUS_SOLD, self::STATUS_WITHDRAWN, self::STATUS_UNDEROFFER);

    js/admin/grid-listings.js

    changed line 16 to

    statuses: ['available', 'hidden', 'sold', 'approval','withdrawn', 'underoffer'],

    Database

    added 'withdrawn' and 'Under offer' to the estates table, status column

    templates/restate/css/user-style.css

    added

    }
    .s-badge--underoffer {
    background-image: url('../img/badges/badge-under-offer.png');
    }
    .s-badge--withdrawn {
    background-image: url('../img/badges/badge-withdrawn.png');
    }
    /img/badges
    created 'badge-under-offer.png' and 'badge-withdrawn.png'

    I then went to the admin panel System-->languages> add phrase and manually added 'withdrawn' and 'underoffer' as keys and 'Withdrawn' and 'Under Offer' as the respective values, and now they show properly in both the drop down lists (Grid and individual listings).

    HOWEVER, when a listing is declared to be 'Under Offer' or 'Withdrawn', it disappears from the front end. It is correctly labelled in the listings grid in admin... Not to be seen anywhere in the front end. How do we fix that? What did I miss?
    Last edited: Nov 30, 2014
  20. wazza

    wazza Member

    id say the sql query will have to take a look when i get back this afternoon.

    Try looking in ia.front

Share This Page