Add Attributes Options to Easy Populate Advanced/Basic

Following the clue from here, I put the attribute option back in 6.2 patch 10. Same method works on newer version.

Please note that line numbers are approximate.

1. Export

Applies to admin/easypopulate_export.php

1.1 Uncomment attribute option drop down in line 846

1.2 Around line 370 change


$attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " where products_options_name = '" . $value . "'";

to


$attribute_options_query="select distinct po.products_options_id from products_options po, products_options_text pot where pot.products_options_name= '".$value."' and po.products_options_id=pot.products_options_text_id"; $attribute_options_query="select distinct po.products_options_id from products_options po, products_options_text pot where pot.products_options_name= '".$value."' and po.products_options_id=pot.products_options_text_id";

1.3 Make exactly the same change to around line 385

1.4 Around line 643

change


$attribute_options_languages_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' and language_id = '" . (int)$lid . "'";

to


$attribute_options_languages_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS_TEXT . " where products_options_text_id = '" . (int)$attribute_options['products_options_id'] . "' and language_id = '" . (int)$lid . "'";

2. Import

Applies to admin/easypopulate_import.php

2.1 Around line 1182, change


$attribute_options_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$$v_attribute_options_id_var . "'";

to

$attribute_options_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS_TEXT . " where products_options_text_id = '" . (int)$$v_attribute_options_id_var . "'";

2.2 Around line 1196, change


$attribute_options_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, language_id, products_options_name) values ('" . (int)$$v_attribute_options_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_options_name_var . "')";

to

$attribute_options_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS_TEXT . " (products_options_text_id, language_id, products_options_name) values ('" . (int)$$v_attribute_options_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_options_name_var . "')";

2.3 Around line 1208, change


$attribute_options_update_lang_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$$v_attribute_options_id_var . "' and language_id ='" . (int)$lid . "'";

to

$attribute_options_update_lang_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS_TEXT . " where products_options_text_id = '" . (int)$$v_attribute_options_id_var . "' and language_id ='" . (int)$lid . "'";

2.4 Around line 1214, change


$attribute_options_lang_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, language_id, products_options_name) values ('" . (int)$$v_attribute_options_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_options_name_var . "')";

to

$attribute_options_lang_insert_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS_TEXT . " where products_options_text_id = '" . (int)$$v_attribute_options_id_var . "' and language_id ='" . (int)$lid . "'";

2.5 Around line 1218, change


$attribute_options_update_query = "update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . $$v_attribute_options_name_var . "' where products_options_id ='" . (int)$$v_attribute_options_id_var . "' and language_id = '" . (int)$lid . "'";

to

$attribute_options_update_query = "update " . TABLE_PRODUCTS_OPTIONS_TEXT . " set products_options_name = '" . $$v_attribute_options_name_var . "' where products_options_text_id ='" . (int)$$v_attribute_options_id_var . "' and language_id = '" . (int)$lid . "'";

3.0 epconfigure

3.1 set $products_with_attributes = true;

3.2 $attribute_options_select = array(‘Size’, ‘Model’); // uncomment and fill with product options name you wish to download use $attribute_options_select = ”; if you wish to download all product options

Please BACK UP your files before any change…

More on easy populate and easy populate help

Bookmark and Share

Leave a Reply