• buyproperty123

    (@buyproperty123)


    Hi,
    This is a fun plugin and useful as well. I have searched the support to find out if the shortcode, plugin supports formatting numbers, specifically in my case as currency. I cannot find that it does. Please clue me in if there is a way.

    Secondly, I am trying to sort property for sale and achieve many different scenarios. Example: I would like to have condos in a neighborhood sort by Condo Name and other attributes such as amount of bedrooms or other attributes. I am not proficient in this stuff, but I think it has something to do with grouping. Is this possible? I have thus far figured out how to get them to at least display. But not in a manner that I am looking for. I am also needing to add the price to each property in currency format.

    [raw][loop type=”property” field=”location” compare=”like” value=”galt ocean” relation=”and” field_2=”city” value_2=”Fort Lauderdale” orderby =”location” order=”ASC” status=”publish” cache=”true” expire=”6 hours”]
    [field building_complex] [field location] [field bedrooms] Bedroom(s)
    [/loop][/raw]

    I found a post that instructed someone to use [raw] and then
    to get rid of the spaces in the list…it is not working for me.

    Any help would be appreciated. This is what I have so far and still needs work!!

    https://wordpress.org/plugins/custom-content-shortcode/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter buyproperty123

    (@buyproperty123)

    Actually, the shortcode came out a bit different in my last comment. It looks like this
    [raw][loop type=”property” field=”location” compare=”like” value=”galt ocean” relation=”and” field_2=”city” value_2=”Fort Lauderdale” orderby =”location” order=”ASC” status=”publish” cache=”true” expire=”5 minutes”]

    [/loop][/raw]
    Unless this comment box is changing it because of the href in the loop.
    This is what it yields. http://www.realestatebyall.com/galt-mile-condos/

    I am trying to group all condos of the same name by the amount of bedrooms. I tried using the field building_complex to sort, but it doesn’t work for me so I resorted to location which is the address. I also need to add the price field to each line item. Is there a way to format the number as currency?
    Thanks,
    I really appreciate your plugin and would love to use it endlessly if I can resolve these items.

    Thread Starter buyproperty123

    (@buyproperty123)

    Sorry for the long link above. I ended up using my plugins built in shortcode and modifications to a theme page to achieve what I was trying to do with custom content. However, I am still interested in knowing if I can achieve this kind of result with your plugin.

    Many thanks

    Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    Formatting currency sounds like a useful feature, so I added it in the latest plugin update. It’s used like this:

    [field field_name currency="USD"]

    It doesn’t output the currency symbol, only formats the given number, for example: 2,500.00. Custom format is also possible. Please refer to the documentation under Settings -> Custom Content -> Content -> Currency.

    By the way, in the support forum, you can post code wrapped with “backtick” symbol to avoid formatting it.

    For your second question:

    I would like to have condos in a neighborhood sort by Condo Name and other attributes such as amount of bedrooms, etc.

    For grouping content, you can use taxonomies or fields. Currently, the plugin supports queries up to 2 taxonomies and 3 fields at one time. If you could tell me the specific condition you need – for example, 2 bedrooms – then I can try to find the right parameters to set.

    Thread Starter buyproperty123

    (@buyproperty123)

    Hello, Eliot.
    Thank you for adding the currency formatting and for your reply.

    Ultimately, what I would like to do is create a list of different types of property with several different scenarios.
    1. Condos Buildings, Condo Buildings that have 1,2 or 3 bedrooms, Condo Buildings within a city that have 1,2,3 bedrooms. Condo Buildings within a City, Zip Code that have 1,2,3 bedrooms priced between $100,000-$200,000.

    The query would create a list something like this for the Last example.
    Fort Lauderdale Condos in Zip Code 33308
    Fort Lauderdale Beach Condo Building
    1 Bedroom Units
    Price $100,000-$200,000
    Results
    Results

    1 Bedroom Units
    Price $200,000-$300,000.
    Results
    Results.

    2 Bedroom Units
    Price $100,000-$300,000
    Results
    —————————————————-
    I created a query in MS Access that looks as though it will provide the results I am looking for. However, the report would need to Title and Group the results based on City, Zip, Building, Subdivision, Price, etc either individually or for multiples like Building A – 1 Bedroom Units
    MS Access would then allow me to create a Report Based on the query below and Group and sort attributes accordingly.

    SELECT master.[meta:building], master.[meta:city], master.[meta:bedrooms], master.[meta:type_of_property], master.[meta:zip], master.regular_price
    FROM master
    GROUP BY master.[meta:building], master.[meta:city], master.[meta:bedrooms], master.[meta:type_of_property], master.[meta:zip], master.regular_price
    HAVING (((master.[meta:building]) Is Not Null) AND ((master.[meta:city]) Like “pompano*”) AND ((master.[meta:bedrooms])=”1″) AND ((master.[meta:zip])=”33062″) AND ((master.regular_price) Between “1000” And “1500”))
    ORDER BY master.[meta:building], master.regular_price;
    ———————————————————
    The field names are not as the field names in the example query. I used a different table to provide the example.

    I hope I have explained this ok. Thanks so much!!!

    Plugin Author Eliot Akira

    (@miyarakira)

    I looked at the site you mentioned – I see there’s quite a lot of data, and numerous fields to consider. For this level of complex query, it might be necessary (and maybe quicker) to use PHP to set up custom SQL statements, to get exactly the result you need.

    As you see, this plugin provides a simplified syntax for WP_Query, WP_User_Query, etc. It has most of the basic functions, but not all of the advanced query parameters are implemented yet.

    Looking at the query you posted above: at this point the following features are not in the plugin:

    • query by more than 3 fields
    • group by fields
    • order by more than one field

    I think setting up the same query with WP_Query would be a challenge, and even more difficult to achieve it with shortcodes.

    About the [raw] shortcode, it needs to be enabled in the settings page. After that, you can wrap blocks of code, and it will not get formatted. Then you can have shortcodes that span multiple lines, like:

    [raw]
      [loop type="property"]
        [field building]
      [/loop]
    [/raw]

    All that said, it would still be interesting to see if the plugin could be extended to achieve the result you want. It may be possible by adding some parameters to [loop] and [if].

    So, one of the scenarios you have is:

    Condo Buildings within a City, Zip Code that have 1,2,3 bedrooms priced between $100,000-$200,000

    ..and if I were to imagine it represented in shortcode..

    [loop
      type="property"
      field="city" value="Fort Lauderdale"
      field_2="zip" value_2="78704"
      field_3="price" value_3="100000-200000" compare="between"
      orderby="field" key="bedrooms"]
    
      ..Display fields..
    
    [/loop]

    Right now this code will not work, but I think the only feature missing is to query by a range of field values with between. I’ll look into how this can be achieved.

    Thread Starter buyproperty123

    (@buyproperty123)

    Wow, great. I think it would be incredibly useful to many. You are amazing!
    Thanks

    Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    In the newest plugin update, I added a feature to compare a range of field values. It’s used like this:

    [loop type="property" field="price" value="10000,20000" compare="between"]

    Also, I improved support for multiple field value queries, up to 5.

    I’m looking into the other features you mentioned: group by field, and order by more than one field. As I said, I think these are not natively supported by WP_Query, so it might be an effort to implement them. I noticed that recent versions of WordPress has improved/extended queries, so I’ll see if there’s a solution there.

    Meanwhile, you may be able to achieve what you need by using the [pass] shortcode. The documentation for it is a bit hard to find, in the section called Other.

    For example, to use a list to make grouped queries:

    [pass list="1,2,3"]
      [loop type="property" field="bedrooms" value="{ITEM}"]
        [if first]
          Properties with {ITEM} bedrooms:
        [/if]
        [field title]
        ...
      [/loop]
    [/pass]

    The [if first] clause is used to display group heading, if there’s any post that matches the query.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Format Currency and Grouping’ is closed to new replies.