Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

** Update ** To the above..... (in case it helps a solution)

 

If I "manually" change a customers "group-id" directly in the database, then the adjusted prices show correctly for that customer. The customer status is also changed on the admin/customers page.

 

* Now this part is weird * I can change that same customer "back to Retail" using the admin/customers panel, and it "all works great"!! HOWEVER, I cannot again change to wholesale without going directly to the database.... :( :(

 

Please Help!...... :blink:

 

 

Thanks for the quick reply, Jan! I changed the code as you suggested, and I got the same errors (well almost....)... The first error originally referred to the path "includes/tld.txt", where the updated code you gave then produced the path "admin/includes/tld.txt"

 

I put a copy of tld.txt into the admin/includes folder, and ....... No more errors!! :)

 

That is the good news..... The bad? Well, when I change a customer from Retail to Wholesale and update, I get no errors, but the status is NOT changed, and the customer remains as "Retail"! :(

 

Thanks again for your help! :)

Share this post


Link to post
Share on other sites
* Now this part is weird * I can change that same customer "back to Retail" using the admin/customers panel, and it "all works great"!! HOWEVER, I cannot again change to wholesale without going directly to the database.... :( :(

Works fine for other people. Did you try the fiel from the package?

Share this post


Link to post
Share on other sites

Which file? I did a manual install with existing file modifications because I had other mods already installed!

 

 

Works fine for other people. Did you try the fiel from the package?

Share this post


Link to post
Share on other sites
Which file? I did a manual install with existing file modifications because I had other mods already installed!

Then I assume something did not went well between SPPC and the other mods.

Share this post


Link to post
Share on other sites

No, so far all seem to play nicely together. At the moment, I believe that this is the only issue that I'm seeing. Which file from the package are you referring to? I will give it a try to see if my issue is resolved. If it is, then I will deal with "merging" the other mods info.....

 

(catalog/admin/customers.php.....?? Maybe?)

 

Thanks again for your time, Jan! ;)

 

 

Then I assume something did not went well between SPPC and the other mods.
Edited by ZapMe1

Share this post


Link to post
Share on other sites

** UPDATE **

 

Ok, after some help from Jan, and many hours of "hair pulling", the issue is solved! :)

 

I just extracted the "code for other mods" from my current admin/customers.php, and carefully added to the copy in the contribution package.

 

Can't say that I see what was causing the issue to begin with, but the important thing is that "It's Working" !!!!!!!!!!!!

 

Thanks again for your help, Jan..... I'm sure I'll be back! ;)

 

 

No, so far all seem to play nicely together. At the moment, I believe that this is the only issue that I'm seeing. Which file from the package are you referring to? I will give it a try to see if my issue is resolved. If it is, then I will deal with "merging" the other mods info.....

 

(catalog/admin/customers.php.....?? Maybe?)

 

Thanks again for your time, Jan! ;)

Edited by ZapMe1

Share this post


Link to post
Share on other sites

(had trouble making this post, and sorry it's so long.... can a MOD please delete the "empty" posts above?)

 

Well, another issue for me.. :(

 

When I try to create a new product from the admin, preview then update, all is well except for "update"... I get:

 

1062 - Duplicate entry '0-0' for key 1

 

insert into products_to_categories (products_id, categories_id) values ('0', '0')

 

[TEP STOP]

 

I narrowed this down to "admin/categories.php", and proved it is related to SPPC by restoring this file alone, back to before the MOD install!

 

Probably right under my nose, but....

Here is my current code (SPPC section with the above issue):

 

 

 

// BOF Separate Pricing Per Customer

$customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");

while ($customers_group = tep_db_fetch_array($customers_group_query)) // Gets all of the customers groups

{

$attributes_query = tep_db_query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where ((products_id = '" . $products_id . "') && (customers_group_id = " . $customers_group['customers_group_id'] . ")) order by customers_group_id");

$attributes = tep_db_fetch_array($attributes_query);

if (tep_db_num_rows($attributes_query) > 0) {

if ($HTTP_POST_VARS['sppcoption'][$customers_group['customers_group_id']]) { // this is checking if the check box is checked

if ( ($HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] <> $attributes['customers_group_price']) && ($attributes['customers_group_id'] == $customers_group['customers_group_id']) ) {

tep_db_query("update " . TABLE_PRODUCTS_GROUPS . " set customers_group_price = '" . $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] . "' where customers_group_id = '" . $attributes['customers_group_id'] . "' and products_id = '" . $products_id . "'");

$attributes = tep_db_fetch_array($attributes_query);

}

elseif (($HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] == $attributes['customers_group_price'])) {

$attributes = tep_db_fetch_array($attributes_query);

}

}

else {

tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");

$attributes = tep_db_fetch_array($attributes_query);

}

}

elseif (($HTTP_POST_VARS['sppcoption'][$customers_group['customers_group_id']]) && ($HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] != '')) {

tep_db_query("insert into " . TABLE_PRODUCTS_GROUPS . " (products_id, customers_group_id, customers_group_price) values ('" . $products_id . "', '" . $customers_group['customers_group_id'] . "', '" . $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] . "')");

$attributes = tep_db_fetch_array($attributes_query);

}

 

}

// EOF Separate Pricing Per Customer

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");

 

 

// BOF Separate Pricing Per Customer 26042006 by Infobroker

 

$customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");

while ($customers_group = tep_db_fetch_array($customers_group_query)) // Gets all of the customers groups

{

$attributes_query = tep_db_query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where ((products_id = '" . $products_id . "') && (customers_group_id = " . $customers_group['customers_group_id'] . ")) order by customers_group_id");

$attributes = tep_db_fetch_array($attributes_query);

 

tep_db_query("insert into " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_price, products_id) values ('" . $attributes['customers_group_id'] . "', '" . tep_db_input($attributes['customers_group_price']) . "', '" . (int)$dup_products_id . "')");

 

 

 

}

// EOF Separate Pricing Per Customer 26042006 by Infobroker

 

// BOF Bundled Products

if ($HTTP_POST_VARS['products_bundle'] == "yes") {

tep_db_query("DELETE FROM products_bundles WHERE bundle_id = '" . $products_id . "'");

for ($i=0, $n=6; $i<$n; $i++) {

if (isset($HTTP_POST_VARS['subproduct_' . $i . '_qty']) && $HTTP_POST_VARS['subproduct_' . $i . '_qty'] > 0) {

tep_db_query("INSERT INTO products_bundles (bundle_id, subproduct_id, subproduct_qty) VALUES ('" . $products_id . "', '" . $HTTP_POST_VARS['subproduct_' . $i . '_id'] . "', '" . $HTTP_POST_VARS['subproduct_' . $i . '_qty'] . "')");

}

}

}

// EOF Bundled Products

 

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

$language_id = $languages[$i]['id'];

 

$sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),

'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]),

'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]));

 

if ($action == 'insert_product') {

$insert_sql_data = array('products_id' => $products_id,

'language_id' => $language_id);

 

$sql_data_array = array_merge($sql_data_array, $insert_sql_data);

 

tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);

} elseif ($action == 'update_product') {

tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");

}

}

 

//BEGIN Discount Plus

tep_db_query("delete from " . TABLE_DISCOUNTPLUS . " where products_id = '" . $products_id . "'");

$s=1;

for ($i=0; $i<DISCOUNTPLUS_number; $i++)

{

if ($HTTP_POST_VARS['quantity'.$s] > '0')

{

$insert_sql_data = array('products_id' => $products_id,

'quantity' => tep_db_prepare_input($HTTP_POST_VARS['quantity'.$s]),

'value' => tep_db_prepare_input($HTTP_POST_VARS['value'.$s]),

'valuetyp' => tep_db_prepare_input($HTTP_POST_VARS['valuetyp'.$s]));

tep_db_perform(TABLE_DISCOUNTPLUS, $insert_sql_data);

}

$s++;

}

//END Discount Plus

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

tep_reset_cache_block('xsell_products');

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));

}

break;

case 'copy_to_confirm':

if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['categories_id'])) {

$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

 

if ($HTTP_POST_VARS['copy_as'] == 'link') {

if ($categories_id != $current_category_id) {

$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$categories_id . "'");

$check = tep_db_fetch_array($check_query);

if ($check['total'] < '1') {

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$categories_id . "')");

}

} else {

$messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');

}

} elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {

// BOF MaxiDVD: Modified For Ultimate Images Pack!

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

$product = tep_db_fetch_array($product_query);

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_image_med']) . "', '" . tep_db_input($product['products_image_lrg']) . "', '" . tep_db_input($product['products_image_sm_1']) . "', '" . tep_db_input($product['products_image_xl_1']) . "', '" . tep_db_input($product['products_image_sm_2']) . "',

'" . tep_db_input($product['products_image_xl_2']) . "', '" . tep_db_input($product['products_image_sm_3']) . "', '" . tep_db_input($product['products_image_xl_3']) . "', '" . tep_db_input($product['products_image_sm_4']) . "', '" . tep_db_input($product['products_image_xl_4']) . "', '" . tep_db_input($product['products_image_sm_5']) . "', '" . tep_db_input($product['products_image_xl_5']) . "', '" . tep_db_input($product['products_image_sm_6']) . "', '" . tep_db_input($product['products_image_xl_6']) . "', '" . tep_db_input($product['products_price']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");

// BOF MaxiDVD: Modified For Ultimate Images Pack!

$dup_products_id = tep_db_insert_id();

 

$description_query = tep_db_query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");

while ($description = tep_db_fetch_array($description_query)) {

tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')");

}

 

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");

$products_id = $dup_products_id;

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

tep_reset_cache_block('xsell_products');

}

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $categories_id . '&pID=' . $products_id));

break;

 

// BOF MaxiDVD: Modified For Ultimate Images Pack!

case 'new_product_preview':

// copy image only if modified

if (($HTTP_POST_VARS['unlink_image'] == 'yes') or ($HTTP_POST_VARS['delete_image'] == 'yes')) {

$products_image = '';

$products_image_name = '';

} else {

$products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image->parse() && $products_image->save()) {

$products_image_name = $products_image->filename;

} else {

$products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_med'] == 'yes') or ($HTTP_POST_VARS['delete_image_med'] == 'yes')) {

$products_image_med = '';

$products_image_med_name = '';

} else {

$products_image_med = new upload('products_image_med');

$products_image_med->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_med->parse() && $products_image_med->save()) {

$products_image_med_name = $products_image_med->filename;

} else {

$products_image_med_name = (isset($HTTP_POST_VARS['products_previous_image_med']) ? $HTTP_POST_VARS['products_previous_image_med'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_lrg'] == 'yes') or ($HTTP_POST_VARS['delete_image_lrg'] == 'yes')) {

$products_image_lrg = '';

$products_image_lrg_name = '';

} else {

$products_image_lrg = new upload('products_image_lrg');

$products_image_lrg->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_lrg->parse() && $products_image_lrg->save()) {

$products_image_lrg_name = $products_image_lrg->filename;

} else {

$products_image_lrg_name = (isset($HTTP_POST_VARS['products_previous_image_lrg']) ? $HTTP_POST_VARS['products_previous_image_lrg'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_sm_1'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_1'] == 'yes')) {

$products_image_sm_1 = '';

$products_image_sm_1_name = '';

} else {

$products_image_sm_1 = new upload('products_image_sm_1');

$products_image_sm_1->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_sm_1->parse() && $products_image_sm_1->save()) {

$products_image_sm_1_name = $products_image_sm_1->filename;

} else {

$products_image_sm_1_name = (isset($HTTP_POST_VARS['products_previous_image_sm_1']) ? $HTTP_POST_VARS['products_previous_image_sm_1'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_xl_1'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_1'] == 'yes')) {

$products_image_xl_1 = '';

$products_image_xl_1_name = '';

} else {

$products_image_xl_1 = new upload('products_image_xl_1');

$products_image_xl_1->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_xl_1->parse() && $products_image_xl_1->save()) {

$products_image_xl_1_name = $products_image_xl_1->filename;

} else {

$products_image_xl_1_name = (isset($HTTP_POST_VARS['products_previous_image_xl_1']) ? $HTTP_POST_VARS['products_previous_image_xl_1'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_sm_2'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_2'] == 'yes')) {

$products_image_sm_2 = '';

$products_image_sm_2_name = '';

} else {

$products_image_sm_2 = new upload('products_image_sm_2');

$products_image_sm_2->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_sm_2->parse() && $products_image_sm_2->save()) {

$products_image_sm_2_name = $products_image_sm_2->filename;

} else {

$products_image_sm_2_name = (isset($HTTP_POST_VARS['products_previous_image_sm_2']) ? $HTTP_POST_VARS['products_previous_image_sm_2'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_xl_2'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_2'] == 'yes')) {

$products_image_xl_2 = '';

$products_image_xl_2_name = '';

} else {

$products_image_xl_2 = new upload('products_image_xl_2');

$products_image_xl_2->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_xl_2->parse() && $products_image_xl_2->save()) {

$products_image_xl_2_name = $products_image_xl_2->filename;

} else {

$products_image_xl_2_name = (isset($HTTP_POST_VARS['products_previous_image_xl_2']) ? $HTTP_POST_VARS['products_previous_image_xl_2'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_sm_3'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_3'] == 'yes')) {

$products_image_sm_3 = '';

$products_image_sm_3_name = '';

} else {

$products_image_sm_3 = new upload('products_image_sm_3');

$products_image_sm_3->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_sm_3->parse() && $products_image_sm_3->save()) {

$products_image_sm_3_name = $products_image_sm_3->filename;

} else {

$products_image_sm_3_name = (isset($HTTP_POST_VARS['products_previous_image_sm_3']) ? $HTTP_POST_VARS['products_previous_image_sm_3'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_xl_3'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_3'] == 'yes')) {

$products_image_xl_3 = '';

$products_image_xl_3_name = '';

} else {

$products_image_xl_3 = new upload('products_image_xl_3');

$products_image_xl_3->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_xl_3->parse() && $products_image_xl_3->save()) {

$products_image_xl_3_name = $products_image_xl_3->filename;

} else {

$products_image_xl_3_name = (isset($HTTP_POST_VARS['products_previous_image_xl_3']) ? $HTTP_POST_VARS['products_previous_image_xl_3'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_sm_4'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_4'] == 'yes')) {

$products_image_sm_4 = '';

$products_image_sm_4_name = '';

} else {

$products_image_sm_4 = new upload('products_image_sm_4');

$products_image_sm_4->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_sm_4->parse() && $products_image_sm_4->save()) {

$products_image_sm_4_name = $products_image_sm_4->filename;

} else {

$products_image_sm_4_name = (isset($HTTP_POST_VARS['products_previous_image_sm_4']) ? $HTTP_POST_VARS['products_previous_image_sm_4'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_xl_4'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_4'] == 'yes')) {

$products_image_xl_4 = '';

$products_image_xl_4_name = '';

} else {

$products_image_xl_4 = new upload('products_image_xl_4');

$products_image_xl_4->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_xl_4->parse() && $products_image_xl_4->save()) {

$products_image_xl_4_name = $products_image_xl_4->filename;

} else {

$products_image_xl_4_name = (isset($HTTP_POST_VARS['products_previous_image_xl_4']) ? $HTTP_POST_VARS['products_previous_image_xl_4'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_sm_5'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_5'] == 'yes')) {

$products_image_sm_5 = '';

$products_image_sm_5_name = '';

} else {

$products_image_sm_5 = new upload('products_image_sm_5');

$products_image_sm_5->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_sm_5->parse() && $products_image_sm_5->save()) {

$products_image_sm_5_name = $products_image_sm_5->filename;

} else {

$products_image_sm_5_name = (isset($HTTP_POST_VARS['products_previous_image_sm_5']) ? $HTTP_POST_VARS['products_previous_image_sm_5'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_xl_5'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_5'] == 'yes')) {

$products_image_xl_5 = '';

$products_image_xl_5_name = '';

} else {

$products_image_xl_5 = new upload('products_image_xl_5');

$products_image_xl_5->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_xl_5->parse() && $products_image_xl_5->save()) {

$products_image_xl_5_name = $products_image_xl_5->filename;

} else {

$products_image_xl_5_name = (isset($HTTP_POST_VARS['products_previous_image_xl_5']) ? $HTTP_POST_VARS['products_previous_image_xl_5'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_sm_6'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_6'] == 'yes')) {

$products_image_sm_6 = '';

$products_image_sm_6_name = '';

} else {

$products_image_sm_6 = new upload('products_image_sm_6');

$products_image_sm_6->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_sm_6->parse() && $products_image_sm_6->save()) {

$products_image_sm_6_name = $products_image_sm_6->filename;

} else {

$products_image_sm_6_name = (isset($HTTP_POST_VARS['products_previous_image_sm_6']) ? $HTTP_POST_VARS['products_previous_image_sm_6'] : '');

}

}

if (($HTTP_POST_VARS['unlink_image_xl_6'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_6'] == 'yes')) {

$products_image_xl_6 = '';

$products_image_xl_6_name = '';

} else {

$products_image_xl_6 = new upload('products_image_xl_6');

$products_image_xl_6->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image_xl_6->parse() && $products_image_xl_6->save()) {

$products_image_xl_6_name = $products_image_xl_6->filename;

} else {

$products_image_xl_6_name = (isset($HTTP_POST_VARS['products_previous_image_xl_6']) ? $HTTP_POST_VARS['products_previous_image_xl_6'] : '');

}

}

break;

// EOF MaxiDVD: Modified For Ultimate Images Pack!

}

}

 

// check if the catalog image directory exists

if (is_dir(DIR_FS_CATALOG_IMAGES)) {

if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');

} else {

$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');

}

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<script language="javascript" src="includes/general.js"></script>

<script type="text/javascript" src="javascript/ajax/jquery.js"></script>

 

<?php // Big Image Start ? >

// <script language="javascript"><!--

// function popupImageWindow(url) {

// window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,l

e

ft=150')

// }

//--></ script>

// Big Image End ?>

</head>

<body onload="SetFocus();">

<div id="spiffycalendar" class="text"></div>

<!-- body //-->

<table width="1000px" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF" style="border:solid 1px; border-color:#999999;">

<tr>

 

<!-- body_text //-->

<td width="100%" valign="top">

<!-- header //-->

<?php

require(DIR_WS_INCLUDES . 'header.php');

?>

<!-- header_eof //-->

<?php

if ($action == 'new_product') {

$parameters = array('products_name' => '',

'products_bundle' => '',

'products_description' => '',

'products_url' => '',

'products_id' => '',

'products_quantity' => '',

'products_model' => '',

'products_image' => '',

// BOF MaxiDVD: Modified For Ultimate Images Pack!

'products_image_med' => '',

'products_image_lrg' => '',

'products_image_sm_1' => '',

'products_image_xl_1' => '',

'products_image_sm_2' => '',

'products_image_xl_2' => '',

'products_image_sm_3' => '',

'products_image_xl_3' => '',

'products_image_sm_4' => '',

'products_image_xl_4' => '',

'products_image_sm_5' => '',

'products_image_xl_5' => '',

'products_image_sm_6' => '',

'products_image_xl_6' => '',

// EOF MaxiDVD: Modified For Ultimate Images Pack!

'products_price' => '',

'products_weight' => '',

'products_date_added' => '',

'products_last_modified' => '',

'products_date_available' => '',

'products_status' => '',

'products_tax_class_id' => '',

'manufacturers_id' => '');

 

$pInfo = new objectInfo($parameters);

 

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {

// BOF MaxiDVD: Modified For Ultimate Images Pack!

// BOF Bundled Products added p.products_bundle - With Gift Card Addition

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id, p.products_bundle, p.products_gift_card from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

// EOF Bundled Products

// EOF MaxiDVD: Modified For Ultimate Images Pack!

$product = tep_db_fetch_array($product_query);

 

$pInfo->objectInfo($product);

} elseif (tep_not_null($HTTP_POST_VARS)) {

$pInfo->objectInfo($HTTP_POST_VARS);

$products_name = $HTTP_POST_VARS['products_name'];

$products_description = $HTTP_POST_VARS['products_description'];

$products_url = $HTTP_POST_VARS['products_url'];

}

 

// BOF Bundled Products

if (isset($pInfo->products_bundle) && $pInfo->products_bundle == "yes") {

// this product is a bundle so get contents data

$bundle_query = tep_db_query("SELECT pb.subproduct_id, pb.subproduct_qty, pd.products_name FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd INNER JOIN " . TABLE_PRODUCTS_BUNDLES . " pb ON pb.subproduct_id=pd.products_id WHERE pb.bundle_id = '" . $HTTP_GET_VARS['pID'] . "' and language_id = '" . (int)$languages_id . "'");

while ($bundle_contents = tep_db_fetch_array($bundle_query)) {

$bundle_array[] = array('id' => $bundle_contents['subproduct_id'],

'qty' => $bundle_contents['subproduct_qty'],

'name' => $bundle_contents['products_name']);

}

}

// EOF Bundled Products

 

$manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));

$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");

while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],

'text' => $manufacturers['manufacturers_name']);

}

 

$tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));

$tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");

while ($tax_class = tep_db_fetch_array($tax_class_query)) {

$tax_class_array[] = array('id' => $tax_class['tax_class_id'],

'text' => $tax_class['tax_class_title']);

}

 

 

$languages = tep_get_languages();

 

if (!isset($pInfo->products_status)) $pInfo->products_status = '1';

switch ($pInfo->products_status) {

case '0': $in_status = false; $out_status = true; break;

case '1':

default: $in_status = true; $out_status = false;

}

?>

<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">

<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>

<script language="javascript"><!--

var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);

//--></script>

<script language="javascript"><!--

var tax_rates = new Array();

<?php

for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) {

if ($tax_class_array[$i]['id'] > 0) {

echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";

}

}

?>

 

function doRound(x, places) {

return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);

}

 

function getTaxRate() {

var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;

var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;

 

if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {

return tax_rates[parameterVal];

} else {

return 0;

}

}

 

function updateGross() {

var taxRate = getTaxRate();

var grossValue = document.forms["new_product"].products_price.value;

 

if (taxRate > 0) {

grossValue = grossValue * ((taxRate / 100) + 1);

}

 

document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);

}

 

function updateNet() {

var taxRate = getTaxRate();

var netValue = document.forms["new_product"].products_price_gross.value;

 

if (taxRate > 0) {

netValue = netValue / ((taxRate / 100) + 1);

}

 

document.forms["new_product"].products_price.value = doRound(netValue, 4);

}

//--></script>

<!--div class="heading"><?php echo sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></div>

<div class="description"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></div-->

<script type="text/javascript" src="javascript/tab/tab.js"></script>

<link rel="stylesheet" type="text/css" href="javascript/tab/tab.css" />

<script type="text/javascript" src="javascript/ajax/jquery.js"></script>

<?php echo tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"'); ?>

<div class="tab" id="tab">

<div class="tabs"><a><?php echo tab_general ?></a><?php if (QTY_DISCOUNT_PLUS == 'true' ){ ?><a><?php echo tab_discount ?></a><?php } ?><a><?php echo tab_decription ?></a><a><?php echo tab_images ?></a><a><?php echo tab_manufacturer ?></a><a><?php echo tab_bundle ?></a></div>

<div class="pages">

<div class="page">

<div class="pad">

<table>

<tr>

<td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('products_status', '1', $in_status) . ' ' . TEXT_PRODUCT_AVAILABLE . ' ' . tep_draw_radio_field('products_status', '0', $out_status) . ' ' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td>

</tr>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br /><small>(YYYY-MM-DD)</small></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' '; ?><script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script></td>

</tr>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>

</tr>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<?php

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

?>

<tr>

<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td>

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

<?php

}

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr bgcolor="#ebebff">

<td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>

</tr>

<tr bgcolor="#ebebff">

<td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td>

</tr>

<tr bgcolor="#ebebff">

<td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td>

</tr>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_model', $pInfo->products_model); ?></td>

</tr>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td>

</tr>

<!-- gift card modification //-->

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_PRODUCTS_GIFT_CARD; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('gift_card', '1', ($pInfo->products_gift_card == '1') ? true : false) . TEXT_PRODUCTS_GIFT_CARD_INFORMATION; ?></td>

</tr>

<!-- end of gift card modification //-->

</table>

<script language="javascript"><!--

updateGross();

//--></script>

 

<!-- BOF Separate Pricing Per Customer -->

<?php

$customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");

$header = false;

while ($customers_group = tep_db_fetch_array($customers_group_query)) {

 

if (tep_db_num_rows($customers_group_query) > 0) {

$attributes_query = tep_db_query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $pInfo->products_id . "' and customers_group_id = '" . $customers_group['customers_group_id'] . "' order by customers_group_id");

} else {

$attributes = array('customers_group_id' => 'new');

}

if (!$header) { ?>

 

<tr bgcolor="#ebebff"">

<td class="main" colspan="2" style="font-style: italic">Note that if a field is left empty, no price for that customer group will be inserted in the database.<br />

If a field is filled, but the checkbox is unchecked no price will be inserted either.<br />

If a price is already inserted in the database, but the checkbox unchecked it will be removed from the database.

</td>

</tr>

<?php

$header = true;

} // end if (!header), makes sure this is only shown once

?>

<tr bgcolor="#ebebff">

<td class="main"><?php // only change in version 4.1.1

if (isset($pInfo->sppcoption)) {

echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', (isset($pInfo->sppcoption[ $customers_group['customers_group_id']])) ? 1: 0);

} else {

echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', true) . ' ' . $customers_group['customers_group_name'];

}

?>

 </td>

<td class="main"><?php

if ($attributes = tep_db_fetch_array($attributes_query)) {

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcprice[' . $customers_group['customers_group_id'] . ']', $attributes['customers_group_price']);

} else {

if (isset($pInfo->sppcprice[$customers_group['customers_group_id']])) { // when a preview was done and the back button used

$sppc_cg_price = $pInfo->sppcprice[$customers_group['customers_group_id']];

} else { // nothing in the db, nothing in the post variables

$sppc_cg_price = '';

}

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcprice[' . $customers_group['customers_group_id'] . ']', $sppc_cg_price );

} ?></td>

</tr>

<?php

} // end while ($customers_group = tep_db_fetch_array($customers_group_query))

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<!-- EOF Separate Pricing Per Customer -->

 

</div>

</div>

 

<?php if (QTY_DISCOUNT_PLUS == 'true' ){ ?>

<div class="page">

<div class="pad">

<table>

<tr>

<td class="main" valign="top"><?php echo TEXT_DISCOUNTPLUS_DISCOUNTS; ?></td>

<td class="main">

<table border="0" width="">

<tr>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15'); ?></td>

<td class="main"><?php echo TEXT_DISCOUNTPLUS_NUMBER;?></td>

<td class="main"><?php echo TEXT_DISCOUNTPLUS_DISCOUNT;?></td>

<td></td>

</tr>

<?php $discountplus_query = tep_db_query("select quantity, value, valuetyp from " . TABLE_DISCOUNTPLUS . " where products_id = '" . $pInfo->products_id . "' order by quantity ");

$s=1;

for ($i=0; $i<DISCOUNTPLUS_number; $i++)

{

$discountplus_data = tep_db_fetch_array($discountplus_query);

?>

<tr>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15'); ?></td>

<td class="main"><?php echo TEXT_DISCOUNTPLUS_FROM . " " . tep_draw_input_field('quantity'.$s,$discountplus_data['quantity'],"size='6'");?></td>

 

<td class="main" class="main">

<?php echo tep_draw_input_field('value'.$s, $discountplus_data['value'],"size='6'"); ?>

</td>

<?php

switch ($discountplus_data['valuetyp']) {

case "endprice":

$checked_percent = false;

$checked_price = false;

$checked_endprice = true;

break;

case "price":

$checked_percent = false;

$checked_price = true;

$checked_endprice = false;

break;

default:

$checked_percent = true;

$checked_price = false;

$checked_endprice = false;

break;

}

?>

<td class="main"><?php echo tep_draw_radio_field('valuetyp'.$s, 'percent', $checked_percent); echo TEXT_DISCOUNTPLUS_PERCENTDISCOUNT; ?>   <?php echo tep_draw_radio_field('valuetyp'.$s, 'price', $checked_price); echo TEXT_DISCOUNTPLUS_PRICEDISCOUNT; ?>   <?php echo tep_draw_radio_field('valuetyp'.$s, 'endprice', $checked_endprice); echo TEXT_DISCOUNTPLUS_UNITPRICE; ?></td>

</tr>

<?php

$s++;

}

?>

 

<?php $i = 0; ?>

<tr id="discount_<?php echo $i; ?>">

<td></td>

<td class="main"><?php echo TEXT_DISCOUNTPLUS_FROM . " " . tep_draw_input_field('quantity'.$i,$discountplus_data['quantity'],"size='6'");?></td>

<td class="main" class="main">

<?php echo tep_draw_input_field('value'.$i, $discountplus_data['value'],"size='6'"); ?>

</td>

<td class="main"><?php echo tep_draw_radio_field('valuetyp'.$s, 'percent', $checked_percent); echo TEXT_DISCOUNTPLUS_PERCENTDISCOUNT; ?>   <?php echo tep_draw_radio_field('valuetyp'.$s, 'price', $checked_price); echo TEXT_DISCOUNTPLUS_PRICEDISCOUNT; ?>   <?php echo tep_draw_radio_field('valuetyp'.$i, 'endprice', $checked_endprice); echo TEXT_DISCOUNTPLUS_UNITPRICE; ?></td>

<td><input type="button" value="<?php echo($button_remove); ?>" onclick="removeDiscount('discount_<?php echo $i; ?>');" /></td>

</tr>

<?php $i++; ?>

<table>

<tr>

<td colspan="5"><input type="button" value="<?php echo($button_add); ?>" onclick="addDiscount();" /></td>

</tr>

 

</table>

</td>

</tr>

</table>

</div>

</div>

<?php } ?>

<?php //END www.ocean-internet.de - Discount Plus ?>

 

<div class="page">

<div id="tabmini">

<div class="tabs">

<?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>

<a><?php echo $languages[$i]['name']; ?></a>

<?php } ?>

</div>

<div class="pages">

<?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>

<div class="page">

<div class="minipad">

<table>

<tr>

<td><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

<td class="main"><?php echo tep_draw_fckeditor('products_description[' . $languages[$i]['id'] . ']','550','450',(isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

</table></td>

</tr>

</table>

</div>

</div>

<?php } ?>

</div>

</div>

</div>

<div class="page">

<div class="pad">

<table>

<!-- // BOF: MaxiDVD Added for Ulimited Images Pack! -->

<?php

$image_count_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " where products_image='" . $pInfo->products_image_lrg . "' or products_image_med='" . $pInfo->products_image_lrg . "' or products_image_lrg='" . $pInfo->products_image_lrg . "'");

$image_count = tep_db_fetch_array($image_count_query);

?>

<tr>

<td class="dataTableRow" valign="top"><span class="main"><?php echo TEXT_PRODUCTS_IMAGE_NOTE; ?></span></td>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_image') . '<br>';

if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image) != '')

echo tep_draw_separator('pixel_trans.gif', '24', '17" align="left') . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') .

tep_draw_separator('pixel_trans.gif', '5', '15') . '  <small>' . TEXT_PRODUCTS_IMAGE_LINKED . ' [' . $image_count['total'] . ']<br>' .

tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE . '<br>' .

tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE . '<br>' .

tep_draw_separator('pixel_trans.gif', '5', '15') . '  <b>' . TEXT_PRODUCTS_IMAGE . '</b> ' . $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image);?></span></td>

</tr>

 

<?php

 

$image_med_count_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " where products_image='" . $pInfo->products_image_lrg . "' or products_image_med='" . $pInfo->products_image_lrg . "' or products_image_lrg='" . $pInfo->products_image_lrg . "'");

$image_med_count = tep_db_fetch_array($image_med_count_query);

?>

<tr>

<td class="main" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_LARGE; ?></td>

<td class="main" valign="top"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_image_med') . '<br>';

if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_med) != '')

echo tep_draw_separator('pixel_trans.gif', '24', '17" align="left') . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_med, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') .

tep_draw_separator('pixel_trans.gif', '5', '15') . '  <small>' . TEXT_PRODUCTS_IMAGE_LINKED . ' [' . $image_med_count['total'] . ']<br>' .

tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_med" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE . '<br>' .

tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_med" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE . '<br>' .

tep_draw_separator('pixel_trans.gif', '5', '15') . '  <b>' . TEXT_PRODUCTS_IMAGE . '</b> ' . $pInfo->products_image_med . tep_draw_hidden_field('products_previous_image_med', $pInfo->products_image_med);?></td>

</tr>

<?php

$image_lrg_count_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " where products_image='" . $pInfo->products_image_lrg . "' or products_image_med='" . $pInfo->products_image_lrg . "' or products_image_lrg='" . $pInfo->products_image_lrg . "'");

$image_lrg_count = tep_db_fetch_array($image_lrg_count_query);

?>

 

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '20'); ?></td>

</tr>

<?php if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') {

?>

<tr>

<td class="main" colspan="3"><?php echo TEXT_PRODUCTS_IMAGE_ADDITIONAL . '<br><hr>';?></td>

</tr>

<tr>

<td class="smalltext" colspan="3"><table border="0" cellpadding="2" cellspacing="0" width="100%">

<tr>

<td class="smalltext" colspan="2" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_TH_NOTICE; ?></td>

<td class="smalltext" colspan="2" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_XL_NOTICE; ?></td>

</tr>

 

<tr>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_SM_1; ?></span></td>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_sm_1') . tep_draw_hidden_field('products_previous_image_sm_1', $pInfo->products_image_sm_1); ?></span></td>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_XL_1; ?></span></td>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_xl_1') . tep_draw_hidden_field('products_previous_image_xl_1', $pInfo->products_image_xl_1); ?></span></td>

</tr>

<?php

if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_1) != '' or ($pInfo->products_image_xl_1) != '') {

?>

<tr>

<td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_sm_1)) { ?><span class="smallText"><?php echo $pInfo->products_image_sm_1 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_1, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_sm_1" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_sm_1" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span><?php } ?></td>

<td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_xl_1)) { ?><span class="smallText"><?php echo $pInfo->products_image_xl_1 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_1, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_xl_1" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_xl_1" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span><?php } ?></td>

</tr>

<?php

}

?>

<tr>

<td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_SM_2; ?></td>

<td class="smallText" valign="top"><?php echo tep_draw_file_field('products_image_sm_2') . tep_draw_hidden_field('products_previous_image_sm_2', $pInfo->products_image_sm_2); ?></td>

<td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_XL_2; ?></td>

<td class="smallText" valign="top"><?php echo tep_draw_file_field('products_image_xl_2') . tep_draw_hidden_field('products_previous_image_xl_2', $pInfo->products_image_xl_2); ?></td>

</tr>

<?php

$product_info['products_image']; if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_2) != '' or ($pInfo->products_image_xl_2) != '') {

?>

<tr>

<td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_sm_2)) { ?><?php echo $pInfo->products_image_sm_2 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_2, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_sm_2" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_sm_2" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?><?php } ?></td>

<td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_xl_2)) { ?><?php echo $pInfo->products_image_xl_2 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_2, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_xl_2" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_xl_2" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?><?php } ?></td>

</tr>

<?php

}

?>

<tr>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_SM_3; ?></span></td>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_sm_3') . tep_draw_hidden_field('products_previous_image_sm_3', $pInfo->products_image_sm_3); ?></span></td>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_XL_3; ?></span></td>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_xl_3') . tep_draw_hidden_field('products_previous_image_xl_3', $pInfo->products_image_xl_3); ?></span></td>

</tr>

<?php

if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_3) != '' or ($pInfo->products_image_xl_3) != '') {

?>

<tr>

<td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_sm_3)) { ?><span class="smallText"><?php echo $pInfo->products_image_sm_3 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_3, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_sm_3" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_sm_3" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span><?php } ?></td>

<td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_xl_3)) { ?><span class="smallText"><?php echo $pInfo->products_image_xl_3 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_3, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_xl_3" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_xl_3" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span><?php } ?></td>

</tr>

<?php

}

?>

 

<tr>

<td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_SM_4; ?></td>

<td class="smallText" valign="top"><?php echo tep_draw_file_field('products_image_sm_4') . tep_draw_hidden_field('products_previous_image_sm_4', $pInfo->products_image_sm_4); ?></td>

<td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_XL_4; ?></td>

<td class="smallText" valign="top"><?php echo tep_draw_file_field('products_image_xl_4') . tep_draw_hidden_field('products_previous_image_xl_4', $pInfo->products_image_xl_4); ?></td>

</tr>

<?php

if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_4) != '' or ($pInfo->products_image_xl_4) != '') {

?>

<tr>

<td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_sm_4)) { ?><?php echo $pInfo->products_image_sm_4 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_4, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_sm_4" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_sm_4" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?><?php } ?></td>

<td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_xl_4)) { ?><?php echo $pInfo->products_image_xl_4 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_4, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_xl_4" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_xl_4" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?><?php } ?></td>

</tr>

<?php

}

?>

 

 

<tr>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_SM_5; ?></span></td>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_sm_5') . tep_draw_hidden_field('products_previous_image_sm_5', $pInfo->products_image_sm_5); ?></span></td>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_XL_5; ?></span></td>

<td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_xl_5') . tep_draw_hidden_field('products_previous_image_xl_5', $pInfo->products_image_xl_5); ?></span></td>

</tr>

<?php

if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_5) != '' or ($pInfo->products_image_xl_5) != '') {

?>

<tr>

<td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_sm_5)) { ?><span class="smallText"><?php echo $pInfo->products_image_sm_5 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_5, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_sm_5" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_sm_5" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span><?php } ?></td>

<td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_xl_5)) { ?><span class="smallText"><?php echo $pInfo->products_image_xl_5 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_5, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_xl_5" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_xl_5" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span><?php } ?></td>

</tr>

<?php

}

?>

<tr>

<td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_SM_6; ?></td>

<td class="smalltext" valign="top"><?php echo tep_draw_file_field('products_image_sm_6') . tep_draw_hidden_field('products_previous_image_sm_6', $pInfo->products_image_sm_6); ?></td>

<td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_XL_6; ?></td>

<td class="smalltext" valign="top"><?php echo tep_draw_file_field('products_image_xl_6') . tep_draw_hidden_field('products_previous_image_xl_6', $pInfo->products_image_xl_6); ?></td>

</tr>

<?php

if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_6) != '' or ($pInfo->products_image_xl_6) != '') {

?>

<tr>

<td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_sm_6)) { ?><?php echo $pInfo->products_image_sm_6 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_6, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_sm_6" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_sm_6" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?><?php } ?></td>

<td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_xl_6)) { ?><?php echo $pInfo->products_image_xl_6 . '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_6, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="unlink_image_xl_6" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <input type="checkbox" name="delete_image_xl_6" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?><?php } ?></td>

</tr>

<?php

}

?>

 

</table></td>

</tr>

 

 

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<?php

}

// EOF: MaxiDVD Added for Ulimited Images Pack!

?>

 

</table>

</div>

</div>

 

<div class="page">

<div class="pad">

<table>

<tr>

<td>

<?php

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

?>

<tr>

<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_URL . '<br /><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td>

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : tep_get_products_url($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

<?php

}

?>

</td>

</tr>

</table>

</div>

</div>

<div class="page">

<div class="pad">

<table>

<tr bgcolor="#FFFFFF">

<td class="main" valign="top">

<?php echo TEXT_PRODUCTS_BUNDLE; ?>

</td>

<td class="main" valign="top">

<table>

<tr>

<td class="main" valign="top">

<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_bundle', $pInfo->products_bundle) . '<br>("yes" or blank)'; ?>

</td>

<td class="main" valign="top">

<script language="javascript"><!--

function fillCodes() {

for (var n=0;n<6;n++) {

var this_subproduct_id = eval("document.new_product.subproduct_" + n + "_id")

var this_subproduct_name = eval("document.new_product.subproduct_" + n + "_name")

var this_subproduct_qty = eval("document.new_product.subproduct_" + n + "_qty")

if (this_subproduct_id.value == "") {

this_subproduct_id.value = document.new_product.subproduct_selector.value

this_subproduct_qty.value = "1"

var name = document.new_product.subproduct_selector[document.new_product.subproduct_selecto

r.selectedIndex].text

this_subproduct_name.value = name

document.returnValue = true;

return true;

}

}

}

 

function clearSubproduct(n) {

var this_subproduct_id = eval("document.new_product.subproduct_" + n + "_id");

var this_subproduct_name = eval("document.new_product.subproduct_" + n + "_name");

var this_subproduct_qty = eval("document.new_product.subproduct_" + n + "_qty");

this_subproduct_id.value = "";

this_subproduct_name.value = "";

this_subproduct_qty.value = "";

}

//--></script>

<?php

for ($i=0, $n=6; $i<$n; $i++) {

echo "\n" . '<input type="text" size="30" name="subproduct_' . $i . '_name" value="' . $bundle_array[$i]['name'] . '">';

echo "\n" . '<input type="text" size="3" name="subproduct_' . $i . '_id" value="' . $bundle_array[$i]['id'] . '">';

echo "\n" . '<input type="text" size="2" name="subproduct_' . $i . '_qty" value="' . $bundle_array[$i]['qty'] . '">';

echo "\n" . '<a href="java script:clearSubproduct(' . $i . ')">[x]</a><br>';

}

echo 'add : <select name="subproduct_selector" onChange="fillCodes()">';

echo '<option name="null" value="" SELECTED></option>';

$products = tep_db_query("select pd.products_name, p.products_id, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "' and p.products_id <> '" . $HTTP_GET_VARS['pID'] . "' order by p.products_model");

 

while($products_values = tep_db_fetch_array($products)) {

echo "\n" . '<option name="' . $products_values['products_model'] . '" value="' . $products_values['products_id'] . '">' . $products_values['products_model'] . ' - - - ' . $products_values['products_name'] . " (" . $products_values['products_id'] . ')</option>';

}

echo '</select>';

?>

</td>

</tr>

</table>

</td>

</tr>

<!-- EOF Bundled Products -->

 

</table></td>

</tr>

</div>

</div>

</div>

</div>

 

<script type="text/javascript"><!--

tabview_initialize('tab');

//--></script>

<script type="text/javascript"><!--

tabview_initialize('tabmini');

//--></script>

 

<script type="text/javascript"><!--

function addDiscount() {

$.ajax({

type: 'GET',

url: '<?php echo $PHP_SELF ?>&discount_id='+$('#discounts tr').size(),

async: false,

success: function(data) {

$('#discounts').append(data);

}

});

}

 

function removeDiscount(row) {

$('#'+row).remove();

}

//--></script>

 

<tr>

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>

</tr>

</table></form>

<?php

} elseif ($action == 'new_product_preview') {

if (tep_not_null($HTTP_POST_VARS)) {

$pInfo = new objectInfo($HTTP_POST_VARS);

$products_name = $HTTP_POST_VARS['products_name'];

$products_description = $HTTP_POST_VARS['products_description'];

$products_url = $HTTP_POST_VARS['products_url'];

} else {

// BOF MaxiDVD: Modified For Ultimate Images Pack!

$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");

// EOF MaxiDVD: Modified For Ultimate Images Pack!

$product = tep_db_fetch_array($product_query);

 

$pInfo = new objectInfo($product);

$products_image_name = $pInfo->products_image;

}

 

$form_action = (isset($HTTP_GET_VARS['pID'])) ? 'update_product' : 'insert_product';

 

echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');

 

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {

$pInfo->products_name = tep_get_products_name($pInfo->products_id, $languages[$i]['id']);

$pInfo->products_description = tep_get_products_description($pInfo->products_id, $languages[$i]['id']);

$pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']);

} else {

$pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]);

$pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]);

$pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);

}

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $pInfo->products_name; ?></td>

<td class="pageHeading" align="right"><?php echo $currencies->format($pInfo->products_price); ?></td>

</tr>

</table></td>

</tr>

<!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! // -->

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main">

<?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_med_name, TEXT_PRODUCTS_IMAGE . ' ' . $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"'); ?>

 

<?php echo $pInfo->products_description . '<br><br><center>'; ?>

<?php if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') { ?>

<?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_sm_1_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"'); ?>

<?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_sm_2_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"'); ?>

<?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_sm_3_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"') . '<br>'; ?>

<?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_sm_4_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"'); ?>

<?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_sm_5_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"'); ?>

<?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_sm_6_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"') . '<br>'; ?>

<?php } ?>

</td>

</tr>

<!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! // -->

<?php

if ($pInfo->products_url) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main"><?php echo sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url); ?></td>

</tr>

<?php

}

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<?php

if ($pInfo->products_date_available > date('Y-m-d')) {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_AVAILABLE, tep_date_long($pInfo->products_date_available)); ?></td>

</tr>

<?php

} else {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_ADDED, tep_date_long($pInfo->products_date_added)); ?></td>

</tr>

<?php

}

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<?php

}

 

if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {

if (isset($HTTP_GET_VARS['origin'])) {

$pos_params = strpos($HTTP_GET_VARS['origin'], '?', 0);

if ($pos_params != false) {

$back_url = substr($HTTP_GET_VARS['origin'], 0, $pos_params);

$back_url_params = substr($HTTP_GET_VARS['origin'], $pos_params + 1);

} else {

$back_url = $HTTP_GET_VARS['origin'];

$back_url_params = '';

}

} else {

$back_url = FILENAME_CATEGORIES;

$back_url_params = 'cPath=' . $cPath . '&pID=' . $pInfo->products_id;

}

?>

<tr>

<td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

</tr>

<?php

} else {

?>

<tr>

<td align="right" class="smallText">

<?php

/* Re-Post all POST'ed variables */

reset($HTTP_POST_VARS);

while (list($key, $value) = each($HTTP_POST_VARS)) {

// if (!is_array($HTTP_POST_VARS[$key])) { // BOF Separate Pricing per Customer

if (is_array($value)) {

while (list($k, $v) = each($value)) {

echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v)));

}

} else {

// EOF Separate Pricing per Customer

Edited by ZapMe1

Share this post


Link to post
Share on other sites
Anyone have any ideas on how to fix this..... Many hours in the hole, and still no joy! :(

 

i'm not sure, but try to delete this:

 

// EOF Separate Pricing Per Customer
tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");

 

looks like you are doing this here already, so you get this duplicate-entry error:

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");
$products_id = $dup_products_id;
}

Share this post


Link to post
Share on other sites

Wow, SKK, thank you very much! I do feel a bit silly that I've spent so many hours looking at this, and didn't spot the cause! :blush: :blush:

 

I deleted the code that you pointed out, but then got the same error in the "product_groups" DB..... I found a duplicate code for that also, and deleted!

 

All is well! :) :) :) Thank you so much again! B)

 

i'm not sure, but try to delete this:

 

// EOF Separate Pricing Per Customer
tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");

 

looks like you are doing this here already, so you get this duplicate-entry error:

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");
$products_id = $dup_products_id;
}

Share this post


Link to post
Share on other sites
Wow, SKK, thank you very much! I do feel a bit silly that I've spent so many hours looking at this, and didn't spot the cause! :blush: :blush:

 

I deleted the code that you pointed out, but then got the same error in the "product_groups" DB..... I found a duplicate code for that also, and deleted!

 

All is well! :) :) :) Thank you so much again! B)

 

no problem! you're welcome :)

Share this post


Link to post
Share on other sites
Anyone have any ideas on how to fix this..... Many hours in the hole, and still no joy! :(

Start over. At least the top part (above <!-- body //-->). This is terrible code. I know it is not easy to add SPPC when you already have a number of contributions added (heck, even without it is confusing) but this seems to be random addition of SPPC code to admin/categories.php. It is totally mixed up.

 

Have you considered installing a file comparison/merge program to help with this?

Share this post


Link to post
Share on other sites

Hey Jan,

 

Actually, I have WinMerge, but even that is difficult to use when there are a lot of MOD additions.

 

As for "bad code", other then SPPC, I only added a Gift Card MOD! All others that you see came already with my original files.

 

It seems to be working now, but what do you recommend?

 

 

Start over. At least the top part (above <!-- body //-->). This is terrible code. I know it is not easy to add SPPC when you already have a number of contributions added (heck, even without it is confusing) but this seems to be random addition of SPPC code to admin/categories.php. It is totally mixed up.

 

Have you considered installing a file comparison/merge program to help with this?

Share this post


Link to post
Share on other sites
Actually, I have WinMerge, but even that is difficult to use when there are a lot of MOD additions.

I'm not on Windows so I never had an opportunity to use that. Actually, I like using diff too (command line program that comes with Macs and Linux).

As for "bad code", other then SPPC, I only added a Gift Card MOD! All others that you see came already with my original files.

That's strange because I also see references to Ultimate Image Pack and Bundled Products...

It seems to be working now, but what do you recommend?

I can't imagine it is working properly.

Share this post


Link to post
Share on other sites
Hey Jan,

 

Actually, I have WinMerge, but even that is difficult to use when there are a lot of MOD additions.

 

As for "bad code", other then SPPC, I only added a Gift Card MOD! All others that you see came already with my original files.

 

It seems to be working now, but what do you recommend?

 

try beyond comapre 2. for me it's better then winmerge.

Share this post


Link to post
Share on other sites

Hi,

 

I have installed Separate Pricing Per Customer 4.2.2 for RC2a. But in Customer Grouping I am facing some problem. I am able to create user groups. But I am not able to assign a particular group for a customer. While clicking on update its not showing the assigned group. Please advise.

Share this post


Link to post
Share on other sites
I am not able to assign a particular group for a customer. While clicking on update its not showing the assigned group. Please advise.

Did you try the admin/customers.php page that comes with the contribution (keep your "old" one of course). Did you add a contribution that forced you to change that page manually?

Share this post


Link to post
Share on other sites

Has anyone experienced problems with no prices being displayed, and no prodict images in SPPC? Despite the size of this contribution and me thinking I would have problems out of the box (given that I have a LOT of other contributions installed as well prior to implementing SPPC) I have had limited problems asides from the issues with index.php

 

It doesnt matter what category is displayed, I only ever get the "new products" listed (and then the panel is duplicated but I guess this will be a separate resolve) however any and all product listings are displayed (i.e. correct number of rows) but the details are all blank, no pictures and more importantly links are built wrong also.

 

Help anyone please ....

Share this post


Link to post
Share on other sites
Has anyone experienced problems with no prices being displayed, and no prodict images in SPPC? Despite the size of this contribution and me thinking I would have problems out of the box (given that I have a LOT of other contributions installed as well prior to implementing SPPC) I have had limited problems asides from the issues with index.php

 

It doesnt matter what category is displayed, I only ever get the "new products" listed (and then the panel is duplicated but I guess this will be a separate resolve) however any and all product listings are displayed (i.e. correct number of rows) but the details are all blank, no pictures and more importantly links are built wrong also.

 

Help anyone please ....

 

Yes, found it: basically the updates assume there are no other add-ons installed (common problem with adding many contributions) (the problem that I was having was due to "BUNDLED PRODUCTS" being installed) so if you look through the product_listing.php module and ensure that if there are variables listed as $listing['products_weight'] or $listing['products_id'] etc then then they need to be listed as $listing[$x]['products_weight'] or $listing[$x]['products_id'] etc then everything should work. Well did for me anyway ...

 

Good luck everyone ....

Share this post


Link to post
Share on other sites

Hi All. :rolleyes:

Its been a few years since I've had any problems, One of my customers has informed me of a problem that I was unaware of. I wonder if any one else has the same problem.

 

When a customer thats on a seperate price range to the standard is logged in, and selects a particular catorgary, then sorts by price I get an error that I'm unable to diaginose.

 

*****************************

Donic Blades Donic Blades

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.pro' at line 1

 

select count(p.products_id) as total from products_description pd left join products_group_prices_cg_1 as tmp_pp using(products_id) left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products pproducts_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '32'

 

[TEP STOP]

*******************************

 

Can any body point me in the right direction.

 

Thanks in advance.

Share this post


Link to post
Share on other sites
When a customer thats on a seperate price range to the standard is logged in, and selects a particular catorgary, then sorts by price I get an error that I'm unable to diaginose.

 

*****************************

Donic Blades Donic Blades

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.pro' at line 1

 

select count(p.products_id) as total from products_description pd left join products_group_prices_cg_1 as tmp_pp using(products_id) left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products pproducts_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '32'

There is a comma missing between products pproducts_to_categories p2c. Perhaps you use an older version but in the latest version it is this query (I think) where the trouble spot is (almost the last query before if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {):

/ We show them all
// BOF Separate Pricing Per Customer --last query changed for mysql 5 compatibility
	if ($status_product_prices_table == true) {
// original, no need to change for mysql 5
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

Share this post


Link to post
Share on other sites

// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS . " p" . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  } // end else { // either retail...
// EOF Separate Pricing per Customer
  }
}

if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
	if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

 

Thanks for the reply Jan,

This is the code, is this where the error is.

Share this post


Link to post
Share on other sites
This is the code, is this where the error is.

Don't you see there is no comma in between:

" . TABLE_PRODUCTS . " p" . TABLE_PRODUCTS_TO_CATEGORIES . " p2c

Actually, it should be:

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

instead of (your code):

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS . " p" . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

You mixed up the part with tables product, manufacturers, product_to_categories to manufacturers, products products_to_categories.

Share this post


Link to post
Share on other sites

Thank you Jan, it fixed the problem. But I still couldnt see the missing comma. It looks like I messed the code up right from the start. Thank you once again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×