Property Status

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

  1. wazza

    wazza Member

    to

  2. wazza

    wazza Member

    Ill keep looking but maybe Gleb or Vasily will be back before I am to help.

    Regards,
    Quentin
  3. Eleanna

    Eleanna Member

    ia.front.estate.php, so that's where it is.... I amended this

    if (!$ignoreStatuses)
    {
    $sqlWhere .= $this->iaCore->get('estates_display_sold', true)
    ? " AND e.`status` IN ('" . implode("','", array(iaEstate::STATUS_AVAILABLE, iaEstate::STATUS_SOLD, iaEstate::STATUS_RENTED)) . "')"
    : " AND e.`status` = '" . iaEstate::STATUS_AVAILABLE . "'";
    }

    to this

    if (!$ignoreStatuses)
    {
    $sqlWhere .= $this->iaCore->get('estates_display_sold', true)
    ? " AND e.`status` IN ('" . implode("','", array(iaEstate::STATUS_AVAILABLE, iaEstate::STATUS_SOLD, iaEstate::STATUS_RENTED, iaEstate::STATUS_WITHDRAWN, iaESTATE::STATUS_UNDEROFFER)) . "')"
    : " AND e.`status` = '" . iaEstate::STATUS_AVAILABLE . "'";
    }

    AND WE HAVE LIFT-OFF!!!!

    Works like a charm. Your help is VERY much appreciated! Thanks a bundle.

    Eleanna
  4. wazza

    wazza Member

    Great! Glad it all worked out :D Let me know if there is anything else

    Regards,
    Quentin
    Eleanna likes this.
  5. wazza

    wazza Member

    any chance of seeing it in action?
  6. Eleanna

    Eleanna Member

    yes, of course. You can see it here www.minoan-properties.com. If you do a quick search for Chania, Tsivaras, villas and houses, and leave the rest as "any" you'll actually see the new "Withdrawn" badge there, as well as the to let, for sale, rented, sold and withdrawn badges there.
    Again, thanks for your help!
  7. Eleanna

    Eleanna Member

    In case anybody else needs to do this, rather than going through a lot of posts to find out how, here's how to do it all in the one place. We added the statuses "Withdrawn" and "Under Offer" to the system.

    You will need to

    - Create the badges you need and save them (we saved them in templates/restates/img/badges) All our badges are png files on a transparent background. It is also well worth it running your png files through www.tinypng.com first (or get the photoshop plugin), before uploading them. This compresses them dramatically, without any loss of detail. On a real estate site, with lots of images, this saves a lot of MBs...

    - Make changes to the following files:

    realestate/install.xml
    includes/classes/ia.admin.estate.php
    includes/classes/ia.base.package.php
    includes/classes/ia.front.estate.php
    js/admin/grid-listings.js
    templates/restate/css/user-style.css


    - Add the new statuses to the database

    - Add the new phrases to admin-->System-->languages

    Here are the details

    realestate/install.xml

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

    and change this line (around line 345 somewhere)

    `status` enum('approval', 'available', 'hidden', 'sold') NOT NULL default 'approval',

    to this

    `status` enum('approval', 'available', 'hidden', 'sold', 'withdrawn', 'underoffer') NOT NULL default 'approval',

    includes/classes/ia.admin.estate.php

    change

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

    to

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

    includes/classes/ia.base.package.php

    add

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

    includes/classes/ia.front.estate.php

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

    to

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

    and change

    if (!$ignoreStatuses)
    {
    $sqlWhere .= $this->iaCore->get('estates_display_sold', true)
    ? " AND e.`status` IN ('" . implode("','", array(iaEstate::STATUS_AVAILABLE, iaEstate::STATUS_SOLD, iaEstate::STATUS_RENTED)) . "')"
    : " AND e.`status` = '" . iaEstate::STATUS_AVAILABLE . "'";
    }

    to this

    if (!$ignoreStatuses)
    {
    $sqlWhere .= $this->iaCore->get('estates_display_sold', true)
    ? " AND e.`status` IN ('" . implode("','", array(iaEstate::STATUS_AVAILABLE, iaEstate::STATUS_SOLD, iaEstate::STATUS_RENTED, iaEstate::STATUS_WITHDRAWN, iaESTATE::STATUS_UNDEROFFER)) . "')"
    : " AND e.`status` = '" . iaEstate::STATUS_AVAILABLE . "'";
    }

    js/admin/grid-listings.js

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

    to

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

    Database

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

    templates/restate/css/user-style.css

    add

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

    Rather than deleting the original ia badge , we changed all the different shades of grey in it to white so it is invisible, but easy to reinstate if needed.

    admin-->System-->Languages-->add Phrase

    add the key 'withdrawn' with the value "Withdrawn" to the "common" category

    add the key 'underoffer' with the value "Under Offer" to the "common" category

    That's it.Worked like a charm for us. And once again, thanks Quentin for the considerable help given with this.

    Eleanna
    Last edited: Dec 1, 2014

Share This Page