• Resolved olstadesigns

    (@olstadesigns)


    Hi,

    Below is my vehicle list MAKE > MODEL > ENGINE. If I was to paste this into the YMM Restrictions of a product page it only saves the following:

    NISSAN, Navara D21, Z24 2.4L Petrol 1986 – 1989
    NISSAN, Navara D22, KA24DE 2.4L Petrol 1997 – 1999
    NISSAN, Navara D40, YD25 2.5L 106kW Diesel 2005 – 2015 (Thai)
    NISSAN, Navara NP300 (D23), YS23T 2.3L 120kW Diesel 2015 – current
    NISSAN, Pathfinder R51, YD25 2.5L 128kW Diesel 2005 – 2010

    It looks to me that it only saves the first line of each model and doesn’t accept duplicates. Is there a way around this?

    My original input list I entred before it was saved:

    NISSAN, Navara D21, Z24 2.4L Petrol 1986 – 1989
    NISSAN, Navara D21, KA24E 2.4L Petrol 1990 – 1997
    NISSAN, Navara D21, VG30E 3.0L V6 Petrol 1990 – 1997
    NISSAN, Navara D21, TD23 2.3L Diesel 1987 – 1992
    NISSAN, Navara D21, TD27 2.7L Diesel 1988 – 1996
    NISSAN, Navara D22, KA24DE 2.4L Petrol 1997 – 1999
    NISSAN, Navara D22, TD27 2.7L Diesel 1997 – 2001
    NISSAN, Navara D22, QD32E 3.2L Diesel 1997 – 2001
    NISSAN, Navara D22, VG30E 3.0L V6 120kW Petrol 2000 – 2004
    NISSAN, Navara D22, VG33E 3.3L V6 125kW Petrol 2003 – 2006
    NISSAN, Navara D22, ZD30 3.0L 110kW Diesel 2001 – 2008
    NISSAN, Navara D22, YD25 2.5L 98kW Diesel 2005 – 2015
    NISSAN, Navara D40, YD25 2.5L 106kW Diesel 2005 – 2015 (Thai)
    NISSAN, Navara D40, YD25 2.5L 126kW Diesel 2005 – 2015 (Thai)
    NISSAN, Navara D40, YD25 2.5L 128kW Diesel 2005 – 2015 (Thai)
    NISSAN, Navara D40, YD25 2.5L 128kW Diesel 2005 – 2015 (Spain)
    NISSAN, Navara D40, YD25 2.5L 140kW Diesel 2010 – 2015 (Spain)
    NISSAN, Navara D40, VQ40DE 4.0L 198kW V6 Petrol 2010 – 2014
    NISSAN, Navara D40, V9X 3.0L 170kW V6 Diesel 2010 – 2014
    NISSAN, Navara NP300 (D23), YS23T 2.3L 120kW Diesel 2015 – current
    NISSAN, Navara NP300 (D23), YS23TT 2.3L 140kW Diesel 2015 – current
    NISSAN, Pathfinder R51, YD25 2.5L 128kW Diesel 2005 – 2010
    NISSAN, Pathfinder R51, YD25 2.5L 140kW Diesel 2010 – 2013
    NISSAN, Pathfinder R51, VQ40DE 4.0L 198kW V6 Petrol 2010 – 2010
    NISSAN, Pathfinder R51, V9X 3.0L 170kW V6 Diesel 2010 – 2013

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

    (@pektsekye)

    Hello,

    Check if the unique key includes the engine field:

    
      UNIQUE KEY uk_ymme_product_id (product_id, make, model, engine) 
    

    in the file:
    wp-content/plugins/ymm-search/Setup/Install.php

    Also check this key in the MySql database with PhpMyAdmin.

    Stanislav

    Thread Starter olstadesigns

    (@olstadesigns)

    Hi Stanislav,

    Thanks for the quick reply. Yes this is in the file wp-content/plugins/ymm-search/Setup/Install.php – see below:

    CREATE TABLE {$wpdb->prefix}ymm (
      id int(11) unsigned NOT NULL auto_increment,
      product_id int(11) unsigned NOT NULL,  
      make varchar(100) NOT NULL, 
      model varchar(100) NOT NULL,
      engine varchar(100) NOT NULL,
      PRIMARY KEY (id),
      UNIQUE KEY uk_ymme_product_id (product_id, make, model, engine) 
    ) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    		";

    I have also checked the database and it too has the key – see screenshot https://snag.gy/AsVhSr.jpg

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Check all indexes of the ymm table.

    Maybe it still has the old index (product_id, make, model, year_from, year_to) also.

    Stanislav

    Thread Starter olstadesigns

    (@olstadesigns)

    Yes it does. I removed the ymm table all together and it’s working now. I originally installed your original plugin and then updated it with the engine modified one. Didn’t realise I’d have to remove any old tables from the database.

    Thanks for your help.

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Yes, there is a problem with the old unique key after updating from the original version.

    I have to add some explanation or note in the readme file of the modification.

    Stanislav

    Thread Starter olstadesigns

    (@olstadesigns)

    Thanks

    • This reply was modified 5 years, 8 months ago by olstadesigns.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Vehicle Model not allowing duplicate entries?’ is closed to new replies.