• Hi
    Is it possible to bring the most popular models to top of the drop down for example

    Model.1
    Model.4
    Model.6
    ——-
    Model.1
    Model.2
    Model.3
    Model.4
    Model.5
    Model.6
    Model.7
    Model.8

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter trancemanpl

    (@trancemanpl)

    No solution to that ?

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Try to add this code:

    
          this.element.find('.ymm-select').first().find('option:first-child').after(
             '<option value="BMW">BMW</option>'+
             '<option value="Toyota">Toyota</option>'+
             '<option value="Lexus">Lexus</option>'+
             '<option disabled>──────────</option>'            
          );
    

    just after this code:

    
          // reset drop-downs on browser's cached page
          var option = this.element.find('select.ymm-select option:selected:not(:first-child):not([selected])').eq(0);
          if (option.length){
            option.closest('select')[0].selectedIndex = 0;
            this.element.find('select.ymm-select:disabled').val('');
          }
    

    in the file:
    wp-content/plugins/ymm-search/view/frontend/web/main.js

    Stanislav

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bringing most used models to top of drop down’ is closed to new replies.