Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

Off the top of my head - this can be done by introducing another field into the Master Products edit page in admin, and an extra column in the database->products. It can then be called through classes/currencies.php

 

I will add this functionality to the next release.

 

HTH

 

Matti

Link to comment
Share on other sites

hi matti,

thx for your quick replay.

master_products 1.2 ist running in testmode on my system.

i combined it with b2b_suite0.8, and it works verry well since two days (on my stage-sys).

perhaps i can take it in two or three days in production (than i'll poste a url).

it is a great contrib - many thankx to you and the other.

soc.

Link to comment
Share on other sites

:o

 

Matt

 

I continue to get parse errors. where im stuck at now is one mine line 1342.

I can't seem to figure it out.

 

My category file is hack to pieces and trying to get this mod to fit in. Here is a copy of my admin/category page and help would be appreciated. The error is highlighted in red. Im thinking that i didnt install this page correctly with the other mods. Im very new to this but ive been managing to get things to work so far.

 

Thanks for taking the time.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

<?php

/*

$Id: categories.php,v 1.133 2002/06/09 15:32:43 dgw_ Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

Big Image Modification 2002/03/17

Medium Images Modification 2002/07/17

Updated to version 1.133 by RPA, 26th May 2002

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

if ($HTTP_GET_VARS['action']) {

switch ($HTTP_GET_VARS['action']) {

case 'setflag':

if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {

if ($HTTP_GET_VARS['pID']) {

tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']);

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath']));

break;

case 'insert_category':

case 'update_category':

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

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

 

$sql_data_array = array('sort_order' => $sort_order);

 

if ($HTTP_GET_VARS['action'] == 'insert_category') {

$insert_sql_data = array('parent_id' => $current_category_id,

'date_added' => 'now()');

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

tep_db_perform(TABLE_CATEGORIES, $sql_data_array);

$categories_id = tep_db_insert_id();

} elseif ($HTTP_GET_VARS['action'] == 'update_category') {

$update_sql_data = array('last_modified' => 'now()');

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

tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', 'categories_id = \'' . $categories_id . '\'');

}

 

$languages = tep_get_languages();

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

$categories_name_array = $HTTP_POST_VARS['categories_name'];

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

$sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]));

if ($HTTP_GET_VARS['action'] == 'insert_category') {

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

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

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

tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);

} elseif ($HTTP_GET_VARS['action'] == 'update_category') {

tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', 'categories_id = \'' . $categories_id . '\' and language_id = \'' . $languages[$i]['id'] . '\'');

}

}

 

if ( ($categories_image != 'none') && ($categories_image != '') ) {

tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $categories_image_name . "' where categories_id = '" . tep_db_input($categories_id) . "'");

$image_location = DIR_FS_CATALOG_IMAGES . $categories_image_name;

copy($categories_image, $image_location);

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

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

break;

case 'delete_category_confirm':

if ($HTTP_POST_VARS['categories_id']) {

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

 

$categories = tep_get_category_tree($categories_id, '', '0', '', true);

$products = array();

$products_delete = array();

 

for ($i=0; $i<sizeof($categories); $i++) {

$product_ids_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . $categories[$i]['id'] . "'");

while ($product_ids = tep_db_fetch_array($product_ids_query)) {

$products[$product_ids['products_id']]['categories'][] = $categories[$i]['id'];

}

}

 

reset($products);

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

$category_ids = '';

for ($i=0; $i<sizeof($value['categories']); $i++) {

$category_ids .= '\'' . $value['categories'][$i] . '\', ';

}

$category_ids = substr($category_ids, 0, -2);

 

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

$check = tep_db_fetch_array($check_query);

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

$products_delete[$key] = $key;

}

}

 

for ($i=0; $i<sizeof($categories); $i++) {

tep_remove_category($categories[$i]['id']);

}

 

reset($products_delete);

while (list($key) = each($products_delete)) {

tep_remove_product($key);

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

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

break;

case 'delete_product_confirm':

if ( ($HTTP_POST_VARS['products_id']) && (is_array($HTTP_POST_VARS['product_categories'])) ) {

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

$product_categories = $HTTP_POST_VARS['product_categories'];

 

for ($i=0; $i<sizeof($product_categories); $i++) {

tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . tep_db_input($product_id) . "' and categories_id = '" . tep_db_input($product_categories[$i]) . "'");

}

tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . tep_db_input($product_id) . "' ");

$product_categories_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . tep_db_input($product_id) . "'");

$product_categories = tep_db_fetch_array($product_categories_query);

 

if ($product_categories['total'] == '0') {

tep_remove_product($product_id);

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

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

break;

case 'move_category_confirm':

if ( ($HTTP_POST_VARS['categories_id']) && ($HTTP_POST_VARS['categories_id'] != $HTTP_POST_VARS['move_to_category_id']) ) {

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

$new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);

tep_db_query("update " . TABLE_CATEGORIES . " set parent_id = '" . tep_db_input($new_parent_id) . "', last_modified = now() where categories_id = '" . tep_db_input($categories_id) . "'");

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&cID=' . $categories_id));

break;

case 'move_product_confirm':

if ( ($HTTP_POST_VARS['products_id']) && ($HTTP_POST_VARS['products_id'] != $HTTP_POST_VARS['move_to_category_id']) ) {

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

$new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);

 

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

$duplicate_check = tep_db_fetch_array($duplicate_check_query);

if ($duplicate_check['total'] < 1) tep_db_query("update " . TABLE_PRODUCTS_TO_CATEGORIES . " set categories_id = '" . tep_db_input($new_parent_id) . "' where products_id = '" . tep_db_input($products_id) . "' and categories_id = '" . $current_category_id . "'");

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

 

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

break;

case 'insert_product':

case 'update_product':

if ( ($HTTP_POST_VARS['edit_x']) || ($HTTP_POST_VARS['edit_y']) ) {

$HTTP_GET_VARS['action'] = 'new_product';

} else {

$products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);

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

 

$products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';

 

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

'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),

'products_image' => (($HTTP_POST_VARS['products_image'] == 'none') ? '' : tep_db_prepare_input($HTTP_POST_VARS['products_image'])),

'products_mediumimage' => (($HTTP_POST_VARS['products_mediumimage'] == 'none') ? '' : tep_db_prepare_input($HTTP_POST_VARS['products_mediumimage'])),

'products_largeimage' => (($HTTP_POST_VARS['products_largeimage'] == 'none') ? '' : tep_db_prepare_input($HTTP_POST_VARS['products_largeimage'])),

'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),

'products_date_available' => $products_date_available,

'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),

'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),

// Master Products

'products_listing_status' => tep_db_prepare_input($HTTP_POST_VARS['products_listing_status']),

'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),

'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']),

'products_master' => tep_db_prepare_input($HTTP_POST_VARS['products_master']));

// Master Products EOF

 

if ($HTTP_GET_VARS['action'] == 'insert_product') {

$insert_sql_data = array('products_date_added' => 'now()');

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

tep_db_perform(TABLE_PRODUCTS, $sql_data_array);

$products_id = tep_db_insert_id();

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

} elseif ($HTTP_GET_VARS['action'] == 'update_product') {

$update_sql_data = array('products_last_modified' => 'now()');

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

tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', 'products_id = \'' . tep_db_input($products_id) . '\'');

}

//-_-_-_-_-_-_-_-_-_-_-_-_-_-_ MODIFICATO

 

$customers_group_query = tep_db_query("select distinct customers_group_id, customers_group_name, customers_group_discount 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 g.customers_group_id, g.customers_group_price, p.products_price from " . TABLE_PRODUCTS_GROUPS . " g," . TABLE_PRODUCTS . " p where ((p.products_id = '" . $products_id . "') && (p.products_id =g.products_id) &&(g.customers_group_id = " . $customers_group['customers_group_id'] . ")) order by g.customers_group_id");

$attributes = tep_db_fetch_array($attributes_query);

 

if (tep_db_num_rows($attributes_query) > 0) {

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

if ( ($HTTP_POST_VARS['price'][$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['price'][$customers_group['customers_group_id']] . "', products_price = '" . $HTTP_POST_VARS['products_price'] . "' where customers_group_id = '" . $attributes['customers_group_id'] . "' and products_id = '" . $products_id . "'");

$attributes = tep_db_fetch_array($attributes_query);

}

elseif (($HTTP_POST_VARS['price'][$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['option'][$customers_group['customers_group_id']]) && ($HTTP_POST_VARS['price'][$customers_group['customers_group_id']] != '')) {

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

$attributes = tep_db_fetch_array($attributes_query);

}

 

}

//-_-_-_-_-_-_-_-_-_-_-_-_-_-__-_-_-_-_-_-_ FINE MODIFICATO

 

$languages = tep_get_languages();

for ($i=0; $i<sizeof($languages); $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_head_title_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_title_tag'][$language_id]),

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

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

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

 

if ($HTTP_GET_VARS['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 ($HTTP_GET_VARS['action'] == 'update_product') {

tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', 'products_id = \'' . tep_db_input($products_id) . '\' and language_id = \'' . $language_id . '\'');

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

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

}

break;

//Master Products

case 'insert_master':

case 'update_master':

 

if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {

$action = 'new_master';

} else {

if (isset($HTTP_GET_VARS['pID'])) $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);

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

 

$products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';

$products_master_status = '1';

 

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

'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),

'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),

'products_date_available' => $products_date_available,

'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),

'products_master_status' => 1,

'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),

 

'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));

 

 

if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {

$sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);

}

 

if ($action == 'insert_master') {

$insert_sql_data = array('products_date_added' => 'now()');

 

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

 

tep_db_perform(TABLE_PRODUCTS, $sql_data_array);

$products_id = tep_db_insert_id();

 

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

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

$update_sql_data = array('products_last_modified' => 'now()');

 

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

 

tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");

}

 

$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_master') {

$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_master') {

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

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

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

}

break;

// Master Products EOF

case 'copy_to_confirm':

if ( (tep_not_null($HTTP_POST_VARS['products_id'])) && (tep_not_null($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 ($HTTP_POST_VARS['categories_id'] != $current_category_id) {

$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . tep_db_input($products_id) . "' and categories_id = '" . tep_db_input($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 ('" . tep_db_input($products_id) . "', '" . tep_db_input($categories_id) . "')");

}

} else {

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

}

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

// Master Products

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_mediumimage, products_largeimage, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id, products_master, products_master_status 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_mediumimage, products_largeimage, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id,products_master, products_master_status) values ('" . $product['products_quantity'] . "', '" . $product['products_model'] . "', '" . $product['products_image'] . "', '" . $product['products_mediumimage'] . "', '" . $product['products_largeimage'] . "', '" . $product['products_price'] . "', now(), '" . $product['products_date_available'] . "', '" . $product['products_weight'] . "', '0', '" . $product['products_tax_class_id'] . "', '" . $product['manufacturers_id'] . "', '" . $product['products_master'] . "', '" . $product['products_master_status'] . "')");

$dup_products_id = tep_db_insert_id();

// Master Products EOF

$description_query = tep_db_query("select language_id, products_name, products_description, products_url, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . tep_db_input($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_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_viewed) values ('" . $dup_products_id . "', '" . $description['language_id'] . "', '" . addslashes($description['products_name']) . "', '" . addslashes($description['products_description']) . "', '" . $description['products_url'] . "', '" . $description['products_head_title_tag'] . "', '" . $description['products_head_desc_tag'] . "', '" . $description['products_head_keywords_tag'] . "', '0')");

}

 

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

$products_id = $dup_products_id;

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

 

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

break;

case 'new_product_preview':

// copy image only if modified

$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'] : '');

}

break;

case 'new_master_preview':

// copy image only if modified

$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'] : '');

}

break;

}

}

 

// 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; ?>">

<?php

// BOF: WebMakers.com Changed: Header Tag Controller v1.0

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

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

<?php

}

// EOF: WebMakers.com Changed: Header Tag Controller v1.0

?>

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

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

<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,le

ft=150')

}

//--></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">

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

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

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

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

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

<?php

if ($HTTP_GET_VARS['action'] == 'new_product') {

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

'products_description' => '',

'products_url' => '',

'products_id' => '',

'products_quantity' => '',

'products_model' => '',

'products_image' => '',

'products_price' => '',

'products_weight' => '',

'products_date_added' => '',

'products_last_modified' => '',

'products_date_available' => '',

'products_status' => '',

//Master Products

'products_listing_status' => '',

'products_tax_class_id' => '',

'manufacturers_id' => '');

 

$pInfo = new objectInfo($parameters);

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

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_mediumimage, p.products_largeimage, 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_listing_status, p.products_tax_class_id, p.manufacturers_id, p.products_master, p.products_master_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'");

//Master Products EOF

$product = tep_db_fetch_array($product_query);

 

$pInfo = new objectInfo($product);

} elseif ($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'];

$products_url = $HTTP_POST_VARS['products_head_title_tag'];

$products_url = $HTTP_POST_VARS['products_head_desc_tag'];

$products_url = $HTTP_POST_VARS['products_head_keywords_tag'];

} else {

$pInfo = new objectInfo(array());

}

 

$manufacturers_array = array(array('id' => '', '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']);

}

 

// Master Products

$products_master_array = array(array('id' => ' ', 'text' => TEXT_MASTER_SELECT));

$products_master_array[] = array('id' => '', 'text' => TEXT_NONE);

 

$products_master_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_master_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name");

 

while ($products_master = tep_db_fetch_array($products_master_query)) {

$products_master_array[] = array('id' => $products_master['products_id'],

'text' => $products_master['products_name']);

}

// Master Products EOF

$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;

}

//Master Products

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

switch ($pInfo->products_listing_status) {

case '0': $in_listing_status = false; $out_listing_status = true; break;

case '1':

default: $in_listing_status = true; $out_listing_status = false;

}

//Master Products EOF

?>

<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"><!--

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,le

ft=150')

}

// Master Products

function updateProductsMaster() {

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

var masValue = document.forms["new_product"].products_master_select[selected_value].value;

document.forms["new_product"].products_master.value = masValue;

document.forms["new_product"].products_master_select.selectedIndex = 0;

}

// Master Products EOF

//--></script>

<script language="javascript">

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

</script>

<tr>

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

<tr>

<td class="pageHeading"><?php echo sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></td>

<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

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

</tr>

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

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

<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; $i<sizeof($languages); $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'] . ']', (($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" VALIGN="top"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?><p><br><?php echo TEXT_CUST_GROUPS; ?></p></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()"'); ?>

<!-- _-_-_-_-_-_-__-_-_-_-_ INIZIO INIZIO INIZIO -_-__-_-_-_-_-_-__-_-_-_-_-_-_ -->

 

<table class="main" border="0" cellspacing="0" cellpadding="25">

<tr valign="top">

<?php

$customers_group_query = tep_db_query("select distinct customers_group_id, customers_group_name, customers_group_discount 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 (!$header) {

$header = true;

?>

<td><table border="0" cellpadding="0" cellspacing="0" bgcolor="#00ccff">

<td class="dataTableContent"><?php echo tep_image (DIR_WS_IMAGES . 'icons/locked.gif') . tep_draw_checkbox_field('override', 'override', true);?><? echo TEXT_OVERRIDE ;?> </td>

</table>

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

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" colspan="3"><?php echo $options['products_options_name']; ?></td>

 

</tr>

<?php

}

if (tep_db_num_rows($customers_group_query) > 0) {

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

} else {

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

}

?>

<tr class="dataTableRow">

<td class="dataTableContent"><?php echo tep_image (DIR_WS_IMAGES . 'icons/delete.gif', 'reset price field') . tep_draw_checkbox_field('option[' . $customers_group['customers_group_id'] . ']', 'option[' . $customers_group['customers_group_id'] . ']', true) . ' ' . $customers_group['customers_group_name']; ?> </td>

<td class="dataTableContent"><?php

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

echo tep_draw_input_field('price[' . $customers_group['customers_group_id'] . ']', $attributes['customers_group_price'], 'size="7"');

 

echo " - ";

echo $attributes['customers_group_price'];

echo " ";

} else {

echo tep_draw_input_field('price[' . $customers_group['customers_group_id'] . ']', '0', 'size="7"');

}

 

 

?></td>

</tr>

<?php }

if ($header) {

?>

</table></td>

<?php

}

?>

</tr>

</table></td>

</tr></td>

<!-- _-_-_-_-_-_-__-_-_-_-_-_-__-_ FINE FINE FINE -_-_-_-_-_-_-__-_-_-_-_-_-__-_-_-_-_-_-__-_-_-_-_- -->

<tr>

<td colspan="2" class="main"><hr><?php echo TEXT_PRODUCT_METTA_INFO; ?></td>

</tr>

<?php

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

?>

<tr>

<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_HEAD_TITLE_TAG; ?></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_head_title_tag[' . $languages[$i]['id'] . ']', (($products_head_title_tag[$languages[$i]['id']]) ? stripslashes($products_head_title_tag[$languages[$i]['id']]) : tep_get_products_head_title_tag($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>

<?php

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

?>

<tr>

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

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_textarea_field('products_head_desc_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '3', (($products_head_desc_tag[$languages[$i]['id']]) ? stripslashes($products_head_desc_tag[$languages[$i]['id']]) : tep_get_products_head_desc_tag($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>

<?php

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

?>

<tr>

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

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_textarea_field('products_head_keywords_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '3', (($products_head_keywords_tag[$languages[$i]['id']]) ? stripslashes($products_head_keywords_tag[$languages[$i]['id']]) : tep_get_products_head_keywords_tag($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>

<td colspan="2" class="main"><hr></td>

 

<tr>

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

</tr>

<?php

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

?>

 

 

<tr>

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

<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_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (($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>

<?php

}

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></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_IMAGE; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_image') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image); ?></td>

</tr>

<tr>

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

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_mediumimage') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_mediumimage . tep_draw_hidden_field('products_previous_mediumimage', $pInfo->products_mediumimage); ?></td>

</tr>

<tr>

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

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_largeimage') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_largeimage . tep_draw_hidden_field('products_previous_largeimage', $pInfo->products_largeimage); ?></td>

</tr>

<tr>

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

<!-- BOF Header Tag Controler - Added the following section-->

<tr>

<td colspan="2" class="main"><hr><?php echo TEXT_PRODUCT_METTA_INFO; ?></td>

</tr>

<?php

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

?>

<tr>

<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_HEAD_TITLE_TAG; ?></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_head_title_tag[' . $languages[$i]['id'] . ']', (($products_head_title_tag[$languages[$i]['id']]) ? stripslashes($products_head_title_tag[$languages[$i]['id']]) : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

<?php

}

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', &

Link to comment
Share on other sites

here is the resy of the page..

 

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

<!-- BOF Header Tag Controler - Added the following section-->

<tr>

<td colspan="2" class="main"><hr><?php echo TEXT_PRODUCT_METTA_INFO; ?></td>

</tr>

<?php

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

?>

<tr>

<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_HEAD_TITLE_TAG; ?></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_head_title_tag[' . $languages[$i]['id'] . ']', (($products_head_title_tag[$languages[$i]['id']]) ? stripslashes($products_head_title_tag[$languages[$i]['id']]) : tep_get_products_head_title_tag($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>

<?php

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

?>

<tr>

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

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_textarea_field('products_head_desc_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '3', (($products_head_desc_tag[$languages[$i]['id']]) ? stripslashes($products_head_desc_tag[$languages[$i]['id']]) : tep_get_products_head_desc_tag($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>

<?php

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

?>

<tr>

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

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_textarea_field('products_head_keywords_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '3', (($products_head_keywords_tag[$languages[$i]['id']]) ? stripslashes($products_head_keywords_tag[$languages[$i]['id']]) : tep_get_products_head_keywords_tag($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>

<td colspan="2" class="main"><hr></td>

</tr>

<!-- EOF Header Tag Controler -->

</tr>

<?php

for ($i=0; $i<sizeof($languages); $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'] . ']', (($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : tep_get_products_url($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>

<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>

<!-- Master Products //-->

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></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_MASTER; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_master', $pInfo->products_master, "size=6") . ' ' . tep_draw_pull_down_menu('products_master_select', $products_master_array, ' ', 'onchange="updateProductsMaster()"'); ?></td>

</tr>

<tr>

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

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('products_listing_status', '1', $in_listing_status) . ' ' . TEXT_LIST_PRODUCT . ' ' . tep_draw_radio_field('products_listing_status', '0', $out_listing_status) . ' ' . TEXT_HIDE_PRODUCT; ?></td>

</tr>

</table></td>

<tr>

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

</tr>

<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_master') {

 

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

'products_description' => '',

'products_url' => '',

'products_id' => '',

'products_quantity' => '',

'products_model' => '',

'products_image' => '',

'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)) {

 

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_price, p.products_model, p.products_image, p.products_master_status, 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_master_status, p.products_tax_class_id, p.manufacturers_id 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 . "'");

$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'];

 

}

 

 

$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_master", "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_master"].products_tax_class_id.selectedIndex;

var parameterVal = document.forms["new_master"].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_master"].products_price.value;

 

if (taxRate > 0) {

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

}

 

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

}

 

function updateNet() {

var taxRate = getTaxRate();

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

 

if (taxRate > 0) {

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

}

 

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

}

 

 

//--></script>

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

<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 sprintf(TEXT_NEW_MASTER_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></td>

<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

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

</tr>

<tr>

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

<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>

<?php $products_master_status = '1'; ?>

<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']]) ? $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 colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

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

updateGross();

//--></script>

 

<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" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>

<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_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

</table></td>

</tr>

<?php

}

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></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_IMAGE; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_image') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image); ?></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_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']]) ? $products_url[$languages[$i]['id']] : tep_get_products_url($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>

</table></td>

<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>

<!-- Master Products EOF //-->

</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'];

// copy image only if modified

if ( ($products_image != 'none') && ($products_image != '') ) {

$image_location = DIR_FS_CATALOG_IMAGES . $products_image_name;

if (file_exists($image_location)) @unlink($image_location);

copy($products_image, $image_location);

} else {

$products_image_name = $HTTP_POST_VARS['products_previous_image'];

}

 

// copy medium image only if modified

if ( ($products_mediumimage != 'none') && ($products_mediumimage != '') ) {

$mediumimage_location = DIR_FS_CATALOG_IMAGES . $products_mediumimage_name;

if (file_exists($mediumimage_location)) @unlink($mediumimage_location);

copy($products_mediumimage, $mediumimage_location);

} else {

$products_mediumimage_name = $HTTP_POST_VARS['products_previous_mediumimage'];

}

 

// copy big image only if modified

if ( ($products_largeimage != 'none') && ($products_largeimage != '') ) {

$largeimage_location = DIR_FS_CATALOG_IMAGES . $products_largeimage_name;

if (file_exists($largeimage_location)) @unlink($largeimage_location);

copy($products_largeimage, $largeimage_location);

} else {

$products_largeimage_name = $HTTP_POST_VARS['products_previous_largeimage'];

}

 

} else {

// Master Products

 

$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, p.products_quantity, p.products_model, p.products_image, p.products_mediumimage, p.products_largeimage, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, p.products_master from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . $HTTP_GET_VARS['pID'] . "'");

// Master Products EOF

 

$product = tep_db_fetch_array($product_query);

 

$pInfo = new objectInfo($product);

$products_image_name = $pInfo->products_image;

$products_mediumimage_name = $pInfo->products_mediumimage;

$products_largeimage_name = $pInfo->products_largeimage;

 

$newprice = $pInfo->price;

}

 

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

 

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

 

$languages = tep_get_languages();

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

if ($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']);

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

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

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

$pInfo->price = $attributes['customers_group_price'];//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']]);

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

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

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

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

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

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

$pInfo->price = tep_db_prepare_input($attributes['customers_group_price']);

}

?>

<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><TD>

<!-- B2BSUITE START MARKUP OR DISCOUNT APPLICATION CODE -->

<table class="main" align="right" border="0" cellspacing="0" cellpadding="0">

<tr valign="top">

<?php

$customers_group_query = tep_db_query("select distinct customers_group_id, customers_group_name, customers_group_discount 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 (!$header) {

$header = true;

?>

<td>

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" colspan="3"><?php echo $options['products_options_name']; ?></td>

</tr>

<?php

}

//build the data for b2bsuite

if (tep_db_num_rows($customers_group_query) > 0) {

$attributes_query = tep_db_query("select customers_group_id, customers_group_price, products_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");

$attributes = tep_db_fetch_array($attributes_query);

$query_discount = tep_db_query("select discount from " . TABLE_GROUPS_TO_CATEGORIES . " where customers_group_id = " . $customers_group['customers_group_id'] ." and categories_id=" . $current_category_id ."");

$query_discount_result = tep_db_fetch_array($query_discount);

if (is_null($query_discount_result['discount'])) {

$ricarico = $customers_group['customers_group_discount'];

} else {

$ricarico = $query_discount_result['discount'];

}

}

 

if ($HTTP_POST_VARS['override']) { //if check is OFF the b2bsuite is not apply

$newprice = $pInfo->price;

$pricek = $pInfo->products_price;

//apply b2bsuite

if ($pricek > 0){

if (B2B == 'true') {

if ($ricarico > 0) $newprice = $pricek+($pricek/100)*$ricarico;

if ($ricarico == 0) $newprice = $pricek;

}

if (B2B == 'false') {

if ($ricarico > 0) $newprice = $pricek-($pricek/100)*$ricarico;

if ($ricarico == 0) $newprice = $pricek;

}

$HTTP_POST_VARS['price'][$customers_group['customers_group_id']] = $newprice;

} else {

$newprice;

//break;

}

} else {

$newprice = $attributes['customers_group_price'];

}

?>

<tr class="dataTableRow">

<td class="pageHeading"><?php echo $customers_group['customers_group_name']; ?> </td>

<td class="pageHeading"><?php echo $currencies->format($newprice);?>

</td>

</tr>

<?php

}

if ($header) {

?>

</td>

<?php

}

?>

</tr>

</tr>

</table></td>

 

<!-- B2BSUITE END OF MARKUP - DISCOUNT APPLICATION CODE -->

 

<tr>

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

</tr>

<tr>

<td class="main"><a href="java script:popupImageWindow('<?php echo tep_href_link(FILENAME_POPUP_IMAGE, 'largeimage=' . $products_largeimage_name); ?>')"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') .'</a>' . $pInfo->products_description; ?></td>

</tr>

<?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(ereg_replace('-', '', $pInfo->products_date_available))); ?></td>

</tr>

<?php

} else {

?>

<tr>

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

</tr>

<?php

}

?>

<tr>

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

</tr>

<?php

}

 

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

if ($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])) {

if (is_array($value)) {

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

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

 

//Master Products

} elseif ($action == 'new_master_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 {

 

$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_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_listing_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'] . "'");

 

$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_master' : 'insert_master';

 

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>

<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_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description; ?></td>

</tr>

<?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])) {

echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));

}

}

/*$languages = tep_get_languages();

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

echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));

echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));

echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));

}*/

echo tep_draw_hidden_field('products_image', stripslashes($products_image_name));

echo tep_draw_hidden_field('products_mediumimage', stripslashes($products_mediumimage_name));

echo tep_draw_hidden_field('products_largeimage', stripslashes($products_largeimage_name));

 

echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '  ';

 

if ($HTTP_GET_VARS['pID']) {

echo tep_image_submit('button_update.gif', IMAGE_UPDATE);

} else {

echo tep_image_submit('button_insert.gif', IMAGE_INSERT);

}

echo '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

?></td>

</tr>

</table></form>

<?php

}

//Master Products EOF

} else {

?>

<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 HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>

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

<tr><?php echo tep_draw_form('search', FILENAME_CATEGORIES, '', 'get'); ?>

<td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search', $HTTP_GET_VARS['search']); ?></td>

</form></tr>

<tr><?php echo tep_draw_form('goto', FILENAME_CATEGORIES, '', 'get'); ?>

<td class="smallText" align="right"><?php echo HEADING_TITLE_GOTO . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td>

</form></tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

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

<tr>

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

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

</tr>

<?php

$categories_count = 0;

$rows = 0;

if ($HTTP_GET_VARS['search']) {

$search = tep_db_prepare_input($HTTP_GET_VARS['search']);

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' and cd.categories_name like '%" . $HTTP_GET_VARS['search'] . "%' order by c.sort_order, cd.categories_name");

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by c.sort_order, cd.categories_name");

}

while ($categories = tep_db_fetch_array($categories_query)) {

$categories_count++;

$rows++;

 

// Get parent_id for subcategories if search

if ($HTTP_GET_VARS['search']) $cPath= $categories['parent_id'];

 

if ( ((!$HTTP_GET_VARS['cID']) && (!$HTTP_GET_VARS['pID']) || (@$HTTP_GET_VARS['cID'] == $categories['categories_id'])) && (!$cInfo) && (substr($HTTP_GET_VARS['action'], 0, 4) != 'new_') ) {

$category_childs = array('childs_count' => tep_childs_in_category_count($categories['categories_id']));

$category_products = array('products_count' => tep_products_in_category_count($categories['categories_id']));

 

$cInfo_array = array_merge($categories, $category_childs, $category_products);

$cInfo = new objectInfo($cInfo_array);

}

 

if ( (is_object($cInfo)) && ($categories['categories_id'] == $cInfo->categories_id) ) {

echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '\'">' . "\n";

} else {

echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\'">' . "\n";

}

?>

<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a> <b>' . $categories['categories_name'] . '</b>'; ?></td>

<td class="dataTableContent" align="center"> </td>

<td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($categories['categories_id'] == $cInfo->categories_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

</tr>

<?php

}

//Master Products

$products_count = 0;

if ($HTTP_GET_VARS['search']) {

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_mediumimage, p.products_largeimage, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_listing_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . $HTTP_GET_VARS['search'] . "%' order by pd.products_name");

} else {

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_mediumimage, p.products_largeimage, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_listing_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by pd.products_name");

}

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

$products_count++;

$rows++;

//Master Products EOF

// Get categories_id for product if search

if ($HTTP_GET_VARS['search']) $cPath=$products['categories_id'];

 

if ( ((!$HTTP_GET_VARS['pID']) && (!$HTTP_GET_VARS['cID']) || (@$HTTP_GET_VARS['pID'] == $products['products_id'])) && (!$pInfo) && (!$cInfo) && (substr($HTTP_GET_VARS['action'], 0, 4) != 'new_') ) {

// find out the rating average from customer reviews

$reviews_query = tep_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . $products['products_id'] . "'");

$reviews = tep_db_fetch_array($reviews_query);

$pInfo_array = array_merge($products, $reviews);

$pInfo = new objectInfo($pInfo_array);

}

 

if ( (is_object($pInfo)) && ($products['products_id'] == $pInfo->products_id) ) {

echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '\'">' . "\n";

} else {

echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '\'">' . "\n";

}

?>

<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $products['products_name']; ?></td>

<td class="dataTableContent" align="center">

<?php

if ($products['products_status'] == '1') {

echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';

} else {

echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=1&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);

}

?></td>

<td class="dataTableContent" align="right"><?php if ( (is_object($pInfo)) && ($products['products_id'] == $pInfo->products_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products

Link to comment
Share on other sites

//Master Products

} elseif ($action == 'new_master_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'];

 

 

 

 

this where im getting the parse errr. i can zip the file and email if u prefer

 

dread

Link to comment
Share on other sites

Hoping someone can help us. Installed eerything fine. created test master, and test slaves. when clicking on test master in catalog receiving this error

 

Fatal error: Call to undefined function: osc_trunc_string() in catalog/includes/modules/master_listing.php on line 127

 

 

We have ms2, with following cotributions:

 

Easy populate

attributes copier

option type feature

 

any idea why we would experience this problem please help :blink:

Link to comment
Share on other sites

I must be dumb. I installed the contribution, and have no errors. I just can't figure out how to add slaves in the first place. I might have errors beyond that but I have no idea.

 

I know how to create the master but I'm dead from there. <_<

 

Help would be greatly appreciated.

 

And yes, I did read the install file. I'm just 'toopid I guess.

 

Nevermind :lol:

Edited by cdi-buy.com
Link to comment
Share on other sites

it took me a little while to figure out that after you create the master product you have to create another product...I kept thinking you were supposed to create the slaves at the same time and in the same window as the master.

 

how do you get it so that both the master and the slave(s) don't show as new products? ie how can you set only the master to be a new product for the purposes of the New Products Infobox at the bottom of the screen? When I created one just for testing purposes, it showed the master product (shirt) as well as the slave (shirt with certain logo) as new products.

Link to comment
Share on other sites

Hoping someone can help us. Installed eerything fine. created test master, and test slaves. when clicking on test master in catalog receiving this error

 

Fatal error: Call to undefined function: osc_trunc_string() in catalog/includes/modules/master_listing.php on line 127

 

 

We have ms2, with following cotributions:

 

Easy populate

attributes copier

option type feature

 

any idea why we would experience this problem please help :blink:

Okay, fixed this, sorry for the trouble, alas it always comes down to human error

Link to comment
Share on other sites

ok..I have been watching this thread and waiting to find the time to install this on my OSC MS1.

 

Upon first glance I see that Matt has not created an install file but instead opted to create the files to be replaced. I see the //master products tag and that helps but I am not sure if creating a "install this code on this page here" wouldnt be bit nicer. Can you please make this matt?

 

Also I am having a really tough time on the admin side. I am working through some of the problems and I am sure the catalog side will be easy once the admin is functioning.

 

I have an idea to make this contrib a little more modular.

It seems to me on the admin side that if instead of using categories.php we created a slave.php and that file with have a simpler method of choosing a master product from a dropdown menu similar to specials.php in admin. Then you choose up to 3 slave products.

 

If I do this I will contrib it. I think this way may be a bit easier for most of us to implement. This is a great idea for a contrib and I want to thank Matt for getting it going.

Link to comment
Share on other sites

This won't work with what is coming in the next release - the attributes system as it is is generally regarded as clunky, and there have been several contibutions to bring attributes *to* the products edit page as it is. I don't see the necessity for turning a two stage process into three (four with the adoption of the existing attributes system)

 

I do have a planned development path with this - I released version 1 because, even though still in development, it was already useful to many people

 

There are not/won't be any limits on slaves-> master.

 

I have made my views on "install files" known elsewhere on these forums - this contribution is for MS2, and will go forward from there.

 

Matti

Link to comment
Share on other sites

Sorry to hear that you feel that a diff file is not necessary.

I guess I may have to uninstall this since I am just having too many issues at the moment.

 

Currently even with fresh pages installed I get errors. I see a reviews button and thats it...the rest of the table seems to be missing.

Link to comment
Share on other sites

Perseverance is a good thing....

 

I would suggest, that since you are using MS1, to compare any differences between clean copies first - use something like Beyond Compare - then you will know differences between MS1/MS2 to be aware of - then use the same tool to compare and copy changes over to your files... I really cannot advocate copy and pasting from an installation file :huh:

 

Matti

Link to comment
Share on other sites

Does anyone have a link to a site using this mod? I need to display sizing attributes w/ prices and indicate if they are out of stock.

 

for example, I sell red t-shirts and have s,m,l,xxl and xxxl, but NO xl. I want to grey out the xl attribute somehow without deleting it every time I run out of something.

 

Any ideas? Thanks!

 

Aaron

Edited by sfsurfcat
Link to comment
Share on other sites

I just noticed that there is a missing define (maybe it has already been added):

 

languages/english/product_info.php:

define('TEXT_NO_PRODUCTS', 'There are not slave products');

 

/Fred

Link to comment
Share on other sites

In the list of my slave products at the bottom of each master product page, i'm displaying the model number, a description, and the quantity one can order.

 

The only problem is the model number is getting truncated and only shows 13 charachters before cutting the rest off.

Is there a way to let the model number show more charachters?

 

by the way this contribution is awesome.

Link to comment
Share on other sites

Also this one thing, The Slave Products List themselves alphabetically by name. I am currently having to put numbers in front of the names in order to get them tolist the way I need them too. Can I set this differently anywhere? Possibly to hae them list by model number?

Link to comment
Share on other sites

I have installed Master Products v1.1.2 with Osc 2.2ms2.

 

Everything is good until I found this problem.

When displaying products of specified manufacture, You can not add product to shopping cart by "buy now" button in product_listing if that manufacture has "master" or "slave" product. It will prompt that "product not found".

 

Anyone has the same problem?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...