• How can I add more fields than 4 fields, for example I need 9 fields, what is the file, or the files needed to be changed to achieve this?

    thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    There is no a version of this plugin with more than four fields for now.

    You can download the “remove_year_dropdown.zip” modification:
    https://hottons.com/ymm_modifications

    to see how many files should be changed to remove or add a new field.

    As an alternative it is possible to use the “Attribute drop-downs after selecting make and model” modification:
    https://hottons.com/ymm_modifications

    So that after selecting the make and model the user will also have to select the attribute drop-downs.

    Stanislav

    Thread Starter Periklis Kakarakidis

    (@perikliskakarakidis)

    I have one more question, why do YEAR related php code exists inside of the MAKE MODEL ENGINE?
    is there any particular purpose for it?
    CODE:

    else {
        $select = "SELECT DISTINCT year_from, year_to FROM {$wpdb->prefix}ymm WHERE make = '".esc_sql($values[0])."' AND model = '".esc_sql($values[1])."' AND (year_from != 0 or year_to != 0) {$whereProducts}";      
        $rows = (array) $wpdb->get_results($select, ARRAY_A);
    
        $y = array();
        
        foreach ($rows as $r) {
    
          $from = (int) $r['year_from'];
          $to = (int) $r['year_to'];	
    
          if ($from == 0){
            $y[$to] = 1;          
          } elseif ($to == 0){
            $y[$from] = 1;
          } elseif ($from == $to){
            $y[$from] = 1;
          } elseif ($from < $to){          	
            while ($from <= $to){
              $y[$from] = 1;
              $from++;
            }            
          }
        } 
    
        krsort($y);
                  
        $values = array_keys($y);
      }

    This piece of code is from line 44 inside of ymm_ajax.php file.

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    I have just downloaded:
    ymm_1.0.10_make_model_engine.zip

    on this page:
    https://hottons.com/ymm_modifications

    And it does not contain the year related code.

    Stanislav

    If you are only looking to add fields that gets displayed on the product page (not included in the filtering feature) such as Body, Doors, Drivetrain etc…
    You can simply do that by copying the modification to add note to the plugin and duplicate the changes for those additional fields.
    I managed to add 10 additional fields by doing that.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to add more than 4 fields e.x. (make, model, year, engine, power, design)’ is closed to new replies.