Jump to content

Search the Community

Showing results for tags 'compare fields'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hello everyone! I have properties and clients pages and want to make a statement showing what may be of interest to customers who are looking for. I have two different templates with fields that are repeated in both. I want to do a relationship in my module. My code works fine but looking for a more simple and efficient way and learn for the next time I do it. My site: - Clientes (template=clientes) - cliente 1 (template=cliente) ->fields (prop_precio, prop_zona, prop_tipo_inmueble, prop_tipo_transaccion) - cliente 2 (template=cliente) ... It also has a checkbox field (cliente_busca) because not all clients seeking properties. - Inmuebles (template=inmuebles) - inmueble1 (template=inmueble) -> fields (prop_precio, prop_zona, prop_tipo_inmueble, prop_tipo_transaccion) My code: $clientes = wire('pages')->find("template=cliente, cliente_busca=1, include=all"); $inmuebles = wire('pages')->find("template=Inmueble"); foreach($clientes as $cliente) { $out .= "<ul><li>Al cliente {$cliente->title} le pueden interesar los siguientes inmuebles...</li></li>"; foreach($inmuebles as $inmueble) { if ($cliente->prop_precio >= $inmueble->prop_precio && $cliente->prop_habitaciones <= $inmueble->prop_habitaciones && $cliente->prop_tipo_inmueble == $inmueble->prop_tipo_inmueble && $cliente->prop_tipo_transaccion == $inmueble->prop_tipo_transaccion && $cliente->prop_zona == $inmueble->prop_zona) { $out .= "<li>{$inmueble->title}</li>"; } } }; Any help is welcome.
×
×
  • Create New...