There are instances where product listing for a category needs to be different from product listing of another category. This feature can be

category product listing control

category product listing control

 enabled by customizing the category edit page. The customization includes two radio buttons and some changes to the categories_description table.

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…

This is the way to use EPA to update quantity, price or any other field for that matter:

It is a three stage process:

Stage 1.
* Do a EPA export

Stage 2.
* Open the exported file in Excel or your favorite spreadsheet software.

* Make changes to the appropritate field.
* PLEASE DO NOT ALTER PRODUCT ID FIELD. This is the field that will tell EPA how to match to corresponding products on your site.
* Safe your modified file as tab limited file

Stage 3.
* Do EPA import.

The same process applies to EPB. In EPB case DO NOT ALTER PRODUCT MODEL FIELD

delete is the only value currently programmed for v_action. If needed, custom programming can be done to allow other values.

If you have products on specials and you want to prevent coupons from being applied to them; here is code snippet you can add to checkout_payment.tpl.php. The code looks for products under specials and prevent the vouchers/coupons textbox from being displayed. If there are products that are not in specials in shopping cart, vouchers/coupons textbox will be displayed.

<?php
$products_array = $cart->get_products();
$xc_count=0;
for($ii=0; $ii<count($products_array); $ii++)
{
if(strlen(tep_get_products_special_price( $products_array[$ii]['id']))<=0 )
$xc_count=$xc_count+1;
}
if($xc_count>0)echo $order_total_modules->credit_selection();
?>

 Despite working extensively on attributes I still get confused so don’t be too hard on yourself. Here is a note I made for myself sometime ago.

v_attribute_options_id_1 (1 represents attribute option count)

v_attribute_options_name_1_1 (the first 1 represent attribute option count, the second 1 represent language id)

v_attribute_values_id_1_1 (the first 1 represent attribute option count, the second 1 represent value count)

v_attribute_values_price_1_1 (the first 1 represent attribute option count, the second 1 represent price for value count 1)

v_attribute_values_name_1_1_1 (the first 1 represent attribute option count, the second 1 represent value count, the third 1 represent language id)

These are the basic building block, others are just incremental repetition of the same information.

I recently came across this problem; may be it’s not really a problem but it is something worth noting. While importing an EPA file, EPA import will just hang up and display a blank screen. I noticed that the EPA file is actually imported but only up to some point, the first 78 rows to be specific. This implies the code broke on row 79. I didn’t understand the problem immediately because I compared row 78 with row 79; both look similar to me. After a while I decided to remove row 79 and re-import again. To my surprise everything worked fine! Later, after extensive research on the culprit row 79, I finally realized that the problem was due to:

v_products_model

The specified length is 25 characters, but in my offending row, the length was 26. So for this particular row to be imported, I had to alter the number of characters in my products model number to be 25 or less.

If you really need more than 25 characters for product model; go to epconfigure.php (located in admin folder), change:

$modelsize = 25;

to a number of your choice then go to your products table and change

products_model

to the same number.