Support

Account

Forum Replies Created

  • Thanks for your answer.

    It seems that it comes from this part :

      array(
                    'key' => 'prix',
                    'value' => $prix,
                    'type' => 'NUMERIC',
                    'compare' => '<='
                ),

    Because when I comment this part, the search is faster. But I don’t know how to be more efficient than that…

    Concerning the change from LIKE to =, I tried. But nothing appears when I’m using it. Is it possible to use = with CHAR ? Because it’s well stored as “Appartement”, “Maison” or “Local commercial” (and in the search, I have the capitalized word, so strictly the same as it’s stored in database).

    In every case, I can’t ask my client to come back to all his products to update them, he will be mad ^^

  • Ok, the part that I asked help for is working, but not everything, so don’t take my code above as my final anwser :p

  • There will be around 2000 “Programmes” in the DB…

    I’ve found another way to do it. Maybe not the best way or the cleanest but hey, it works !

    <?php foreach($produits->posts as $id):?>
       <?php if( have_rows('prix',$id)): ?>
    
          <?php /*If Typology AND Price are selected in the search engine */ ?>
          <?php while( have_rows('prix',$id) ) : the_row();?>
              <?php if((!empty($_POST['typologie']) && $_POST['typologie'] == get_sub_field('typo_prog')) && (!empty($_POST['prix']) && $_POST['prix'] > get_sub_field('prix_prog'))):?>
    
                     <a href="<?php the_permalink($id);?>" class="produit col-md-4">
                        MY CONTENT
                     </a> 
               <?php endif;?>
            <?php endwhile;?>
    
       <?php /*If Typology or price are NOT selected in the search engine */ ?>
        <?php if(empty($_POST['typologie']) || empty($_POST['prix'])):?>
    
           <a href="<?php the_permalink($id);?>" class="produit col-md-4">
              MY CONTENT
           </a>
        <?php endif;?>
    
      <?php  endif;?>
    <?php endforeach;?>
  • Ok. I understand.

    I’ll keep trying. Thanks.

  • Ok. I understand.

    I’ll keep trying. Thanks.

Viewing 5 posts - 1 through 5 (of 5 total)