Jump to content
detsouvalas

PDF Catalog v.1.5

Recommended Posts

hmmm I did some googling and found this might have been because i had an old version of Adobe Reader (4.x) i upgraded to 7.x and now the error has changed to the following:-

 

A drawing error occurred.

 

All the text has now vanished for the products and if i keep scrolling down i eventually also get an error of:-

 

Insufficient data for an image.

 

HELP !!

Share this post


Link to post
Share on other sites
hmmm I did some googling and found this might have been because i had an old version of Adobe Reader (4.x) i upgraded to 7.x and now the error has changed to the following:-

 

A drawing error occurred.

 

All the text has now vanished for the products and if i keep scrolling down i eventually also get an error of:-

 

Insufficient data for an image.

 

HELP !!

 

Hello all,

 

Could anyone explain to me what the term //level begin and //level end means in the install instruction?

Example: regarding /admin/categories.php, am I supposed to look for <case 'insert_category':.....=> $sort_order);> and replace with <// Level begin .....// Level end> ?

or

paste <// Level begin .....// Level end> after / before<case 'insert_category':.....=> $sort_order);> ???

 

Please explain what goes where in simple english to me. I will appreciate it big time!

 

Thanks.

 

Rich

Share this post


Link to post
Share on other sites

I have installed version 2.0.2 with the following two problems:

 

1) The file generated by Admin does not show Main Category for first category (default Hardware) -- all subcategories are listed by are titled only the subcategory [e.g. CDROM Drives instead of Hardware - CDROM Drives] The remainder of the categories display correctly [software - Action]

 

2) On the customer side, download of the file created by Admin is fine. Customer created files by category does not work. It goes through the motions but at the end when you try to download the file you receive a file not found error.

 

Site is Here

 

I've been over and over the installation and guess it is still possible that I missed something but can't find it... Any help appreciated!

Share this post


Link to post
Share on other sites

I am getting a Draw Error too!

 

I can download and open the PDF Catalog .. but when I get to page 5 which is category Networking .. I get a popup message: A Drawing Error Occured.

 

The category only has 3 products in it and they are active ... the product status is on and the enable / disable categories mod I have has the category active.

 

I think it is because of the upgrade to the latest Adobe Acrobar Reader and nothing to do with the contribution itself, as mentioned in the previous posts.

 

I will try to look into it further.

Share this post


Link to post
Share on other sites

I installed version 2.0.3 and the main catalog part works, but if you try to do a category catalog everything seems to work fine but when you click the download link all you get is one blank page. This isn't really a problem, the real problem is that it has affected the Catalog section of the admin in oscommerce. All the other sections work, but if you click on the catalog section you get

Parse error: syntax error, unexpected '<' in /www/f/fhceramics/shops/htdocs/admin/categories.php on line 53
and here is line 53 in /admin/categories.php, the first <!-- Level begin --> shown in the code below
	   
$sql_data_array = array_merge($sql_data_array, $sql_data_array2);
// Level end


b.

<!-- Level begin -->		   
		   <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_CATEGORIES_LEVEL; ?></td>
<!-- Level end -->
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>?</td>
		  </tr>
<?php
$categories_count = 0;

 

and I can go no furthur, so if anyone can help it would be greatly appreciated.


Your help and suggestions are greatly appreciated.

Thanks

Wayne

Share this post


Link to post
Share on other sites
I installed version 2.0.3 and the main catalog part works, but if you try to do a category catalog everything seems to work fine but when you click the download link all you get is one blank page. This isn't really a problem, the real problem is that it has affected the Catalog section of the admin in oscommerce. All the other sections work, but if you click on the catalog section you get and here is line 53 in /admin/categories.php, the first <!-- Level begin --> shown in the code below
$sql_data_array = array_merge($sql_data_array, $sql_data_array2);
// Level end


b.

<!-- Level begin -->		   
		   <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_CATEGORIES_LEVEL; ?></td>
<!-- Level end -->
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
		  </tr>
<?php
$categories_count = 0;

and I can go no furthur, so if anyone can help it would be greatly appreciated.

 

It looks like you added the change in the wrong place. The <!-- Level begin --> should be way down with the page tables (around 1390) not up top with the main php code. What you posted in your code is from the install intructions or from your admin/categories.php? If you code your actual page we could see exactly - or you can send it to me.

Edited by Maureen

Share this post


Link to post
Share on other sites
It looks like you added the change in the wrong place. The <!-- Level begin --> should be way down with the page tables (around 1390) not up top with the main php code. What you posted in your code is from the install intructions or from your admin/categories.php? If you code your actual page we could see exactly - or you can send it to me.

Here is the first half of the full categories.php, hope this helps, second half in next posting.

<?php

/*

$Id: categories.php,v 1.146 2003/07/11 14:40:27 hpdl Exp $

adapted for Separate Pricing Per Customer v4.1.1 2005/03/20

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright (c) 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

if (tep_not_null($action)) {

switch ($action) {

case 'setflag':

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

if (isset($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'] . '&pID=' . $HTTP_GET_VARS['pID']));

break;

case 'insert_category':

case 'update_category':

if (isset($HTTP_POST_VARS['categories_id'])) $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);

// Level begin

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

 

$sql_data_array2 = array('categories_level' => $categories_level);

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

// Level end

 

 

b.

 

<!-- Level begin -->

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

<!-- Level end -->

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

</tr>

<?php

$categories_count = 0;

$rows = 0;

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

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

// Level begin

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.categories_level, 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 = '" . (int)$languages_id . "' and cd.categories_name like '%" . tep_db_input($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.categories_level, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name");

}

// Level end

 

 

c.

 

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

<!-- Level begin -->

<td class="dataTableContent" align="center"><?php echo $categories['categories_level']; ?></td>

<!-- Level end -->

<td class="dataTableContent" align="right"><?php if (isset($cInfo) && 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>

 

d.

 

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

<!-- Level begin -->

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

<!-- Level end -->

 

e.

<!-- Level begin -->

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

<!-- Level end -->

<td class="dataTableContent" align="right"><?php if (isset($pInfo) && 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_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

 

 

f.

$contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', '', 'size="2"'));

// Level begin

$contents[] = array('text' => '<br>' . TEXT_CATEGORIES_LEVEL . '<br>' . tep_draw_input_field('categories_level', '', 'size="2"'));

// Level end

$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');

 

 

g.

 

$contents[] = array('text' => '<br>' . TEXT_EDIT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'));

// Level begin

$contents[] = array('text' => '<br>' . TEXT_EDIT_CATEGORIES_LEVEL . '<br>' . tep_draw_input_field('categories_level', $cInfo->categories_level, 'size="2"'));

// Level end

$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');

 

 

if ($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 ($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 = '" . (int)$categories_id . "'");

}

 

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $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 ($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 ($action == 'update_category') {

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

}

}

 

if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$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=' . $cPath . '&cID=' . $categories_id));

break;

case 'delete_category_confirm':

if (isset($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, $n=sizeof($categories); $i<$n; $i++) {

$product_ids_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$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, $n=sizeof($value['categories']); $i<$n; $i++) {

$category_ids .= "'" . (int)$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 = '" . (int)$key . "' and categories_id not in (" . $category_ids . ")");

$check = tep_db_fetch_array($check_query);

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

$products_delete[$key] = $key;

}

}

 

// removing categories can be a lengthy process

tep_set_time_limit(0);

for ($i=0, $n=sizeof($categories); $i<$n; $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 (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['product_categories']) && 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, $n=sizeof($product_categories); $i<$n; $i++) {

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

// BOF Separate Pricing per Customer

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

// EOF Separate Pricing per Customer

}

 

$product_categories_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$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 (isset($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']);

 

$path = explode('_', tep_get_generated_category_path_ids($new_parent_id));

 

if (in_array($categories_id, $path)) {

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

 

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

} else {

tep_db_query("update " . TABLE_CATEGORIES . " set parent_id = '" . (int)$new_parent_id . "', last_modified = now() where categories_id = '" . (int)$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':

$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 = '" . (int)$products_id . "' and categories_id = '" . (int)$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 = '" . (int)$new_parent_id . "' where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$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 (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {

$action = 'new_product';

} 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';

 

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

//BOF Price Break 1.11.3 mod

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

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

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

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

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

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

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

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

'products_price1_qty' => (($i=tep_db_prepare_input($HTTP_POST_VARS['products_price1_qty'])) < 0) ? 0 : $i,

'products_price2_qty' => (($i=tep_db_prepare_input($HTTP_POST_VARS['products_price2_qty'])) < 0) ? 0 : $i,

'products_price3_qty' => (($i=tep_db_prepare_input($HTTP_POST_VARS['products_price3_qty'])) < 0) ? 0 : $i,

'products_price4_qty' => (($i=tep_db_prepare_input($HTTP_POST_VARS['products_price4_qty'])) < 0) ? 0 : $i,

'products_price5_qty' => (($i=tep_db_prepare_input($HTTP_POST_VARS['products_price5_qty'])) < 0) ? 0 : $i,

'products_price6_qty' => (($i=tep_db_prepare_input($HTTP_POST_VARS['products_price6_qty'])) < 0) ? 0 : $i,

'products_price7_qty' => (($i=tep_db_prepare_input($HTTP_POST_VARS['products_price7_qty'])) < 0) ? 0 : $i,

'products_price8_qty' => (($i=tep_db_prepare_input($HTTP_POST_VARS['products_price8_qty'])) < 0) ? 0 : $i,

'products_qty_blocks' => (($i=tep_db_prepare_input($HTTP_POST_VARS['products_qty_blocks'])) < 1) ? 1 : $i,

// EOF Price Break 1.11.3 mod

'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']),

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

}

// start CAO 3 Images

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

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

}

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

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

}

// end CAO 3 Images

 

if ($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 ('" . (int)$products_id . "', '" . (int)$current_category_id . "')");

} elseif ($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 = '" . (int)$products_id . "'");

}

// BOF Separate Pricing Per Customer, Price Break 1.11.3 mod

$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 ($attributes['customers_group_id'] == $customers_group['customers_group_id'] ) {

$sppc_update_query = "set ";

if (isset($HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']])) {

$sppc_update_query .= "customers_group_price = '" . $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_qty_blocks'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_qty_blocks = '" . $HTTP_POST_VARS['sppcproducts_qty_blocks'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price1'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price1 = '" . $HTTP_POST_VARS['sppcproducts_price1'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price1_qty'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price1_qty = '" . $HTTP_POST_VARS['sppcproducts_price1_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price2'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price2 = '" . $HTTP_POST_VARS['sppcproducts_price2'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price2_qty'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price2_qty = '" . $HTTP_POST_VARS['sppcproducts_price2_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price3'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price3 = '" . $HTTP_POST_VARS['sppcproducts_price3'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price3_qty'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price3_qty = '" . $HTTP_POST_VARS['sppcproducts_price3_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price4'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price4 = '" . $HTTP_POST_VARS['sppcproducts_price4'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price4_qty'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price4_qty = '" . $HTTP_POST_VARS['sppcproducts_price4_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price5'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price5 = '" . $HTTP_POST_VARS['sppcproducts_price5'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price5_qty'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price5_qty = '" . $HTTP_POST_VARS['sppcproducts_price5_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price6'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price6 = '" . $HTTP_POST_VARS['sppcproducts_price6'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price6_qty'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price6_qty = '" . $HTTP_POST_VARS['sppcproducts_price6_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price7'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price7 = '" . $HTTP_POST_VARS['sppcproducts_price7'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price7_qty'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price7_qty = '" . $HTTP_POST_VARS['sppcproducts_price7_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price8'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price8 = '" . $HTTP_POST_VARS['sppcproducts_price8'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price8_qty'][$customers_group['customers_group_id']])) {

$sppc_update_query .= " products_price8_qty = '" . $HTTP_POST_VARS['sppcproducts_price8_qty'][$customers_group['customers_group_id']] . "' ";

} // now we need to get rid of the last comma in the query string...

$sppc_update_query = rtrim($sppc_update_query);

$query_string_length = strlen($sppc_update_query);

if (substr($sppc_update_query, -1) == ",") {

$sppc_update_query = substr($sppc_update_query, $query_string_length-1);

}

 

tep_db_query("update " . TABLE_PRODUCTS_GROUPS . " " . $sppc_update_query . " 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 { // checkbox is unchecked

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

}

// next } : end if (tep_db_num_rows($attributes_query) > 0)

}

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

$sppc_insert_query = "set products_id = '" . $products_id . "', customers_group_id= '" . $customers_group['customers_group_id'] . "', ";

if (isset($HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= "customers_group_price = '" . $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_qty_blocks'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_qty_blocks = '" . $HTTP_POST_VARS['sppcproducts_qty_blocks'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price1'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price1 = '" . $HTTP_POST_VARS['sppcproducts_price1'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price1_qty'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price1_qty = '" . $HTTP_POST_VARS['sppcproducts_price1_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price2'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price2 = '" . $HTTP_POST_VARS['sppcproducts_price2'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price2_qty'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price2_qty = '" . $HTTP_POST_VARS['sppcproducts_price2_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price3'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price3 = '" . $HTTP_POST_VARS['sppcproducts_price3'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price3_qty'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price3_qty = '" . $HTTP_POST_VARS['sppcproducts_price3_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price4'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price4 = '" . $HTTP_POST_VARS['sppcproducts_price4'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price4_qty'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price4_qty = '" . $HTTP_POST_VARS['sppcproducts_price4_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price5'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price5 = '" . $HTTP_POST_VARS['sppcproducts_price5'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price5_qty'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price5_qty = '" . $HTTP_POST_VARS['sppcproducts_price5_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price6'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price6 = '" . $HTTP_POST_VARS['sppcproducts_price6'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price6_qty'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price6_qty = '" . $HTTP_POST_VARS['sppcproducts_price6_qty'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price7'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price7 = '" . $HTTP_POST_VARS['sppcproducts_price7'][$customers_group['customers_group_id']] . "', ";

} if (isset($HTTP_POST_VARS['sppcproducts_price7_qty'][$customers_group['customers_group_id']])) {

$sppc_insert_query .= " products_price7_qty = '" . $HTTP_POST_VARS['sppcproducts_price


Your help and suggestions are greatly appreciated.

Thanks

Wayne

Share this post


Link to post
Share on other sites

Here is the second half of the full categories.php, hope this helps,

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

<td colspan="3" align="left"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

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

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE3_QTY; ?></td>

<td class="main" align="left"><?php echo tep_draw_input_field('products_price3_qty', $pInfo->products_price3_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td colspan="3" align="left"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

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

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE4_QTY; ?></td>

<td class="main" align="left"><?php echo tep_draw_input_field('products_price4_qty', $pInfo->products_price4_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td colspan="3" align="left"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

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

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE5_QTY; ?></td>

<td class="main" align="left"><?php echo tep_draw_input_field('products_price5_qty', $pInfo->products_price5_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td colspan="3" align="left"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

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

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE6_QTY; ?></td>

<td class="main" align="left"><?php echo tep_draw_input_field('products_price6_qty', $pInfo->products_price6_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td colspan="3" align="left"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

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

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE7_QTY; ?></td>

<td class="main" align="left"><?php echo tep_draw_input_field('products_price7_qty', $pInfo->products_price7_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td colspan="3" align="left"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

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

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE8_QTY; ?></td>

<td class="main" align="left"><?php echo tep_draw_input_field('products_price8_qty', $pInfo->products_price8_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

</tr>

<!-- EOF Price Break 1.11.3 Retail -->

<!-- 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, products_price1, products_price2, products_price3, products_price4, products_price5, products_price6, products_price7, products_price8, products_price1_qty, products_price2_qty, products_price3_qty, products_price4_qty, products_price5_qty, products_price6_qty, products_price7_qty, products_price8_qty, products_qty_blocks 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 the price field for the customer group is left empty, <b>no</b> price and <b>no</b> price break levels and quantities for that customer group will be inserted in the database.<br />

If a field or fields is/are filled, but the checkbox is unchecked no price/price break levels etc. will be inserted either.<br />

If a price and price break levels are already inserted in the database, but the checkbox unchecked they 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

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

$customer_prices_set = false;

$customer_prices_in_post = false;

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

$customer_prices_set = true;

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

$customer_prices_in_post = true;

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

<tr>

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

<td class="main"><?php if ($customer_prices_set == true) {

$sppc_cg_products_qty_blocks = $attributes['products_qty_blocks'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_qty_blocks = $pInfo->sppcproducts_qty_blocks[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_qty_blocks = '';

}

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcproducts_qty_blocks[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_qty_blocks, 'size="10"') . ' ' . TEXT_PRODUCTS_QTY_BLOCKS_INFO;

?></td>

</tr>

<tr>

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

<td class="main"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price1 = $attributes['products_price1'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price1 = $pInfo->sppcproducts_price1[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price1 = '';

}

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcproducts_price1[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price1, 'size="10"'); ?></td>

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE1_QTY; ?></td>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price1_qty = $attributes['products_price1_qty'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price1_qty = $pInfo->sppcproducts_price1_qty[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price1_qty = '';

}

echo tep_draw_input_field('sppcproducts_price1_qty[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price1_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td class="main"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price2 = $attributes['products_price2'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price2 = $pInfo->sppcproducts_price2[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price2 = '';

}

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcproducts_price2[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price2, 'size="10"'); ?></td>

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE2_QTY; ?></td>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price2_qty = $attributes['products_price2_qty'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price2_qty = $pInfo->sppcproducts_price2_qty[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price2_qty = '';

}

echo tep_draw_input_field('sppcproducts_price2_qty[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price2_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td class="main"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price3 = $attributes['products_price3'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price3 = $pInfo->sppcproducts_price3[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price3 = '';

}

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcproducts_price3[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price3, 'size="10"'); ?></td>

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE3_QTY; ?></td>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price3_qty = $attributes['products_price3_qty'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price3_qty = $pInfo->sppcproducts_price3_qty[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price3_qty = '';

}

echo tep_draw_input_field('sppcproducts_price3_qty[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price3_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td class="main"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price4 = $attributes['products_price4'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price4 = $pInfo->sppcproducts_price4[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price4 = '';

}

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcproducts_price4[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price4, 'size="10"'); ?></td>

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE4_QTY; ?></td>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price4_qty = $attributes['products_price4_qty'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price4_qty = $pInfo->sppcproducts_price4_qty[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price4_qty = '';

}

echo tep_draw_input_field('sppcproducts_price4_qty[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price4_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td class="main"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price5 = $attributes['products_price5'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price5 = $pInfo->sppcproducts_price5[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price5 = '';

}

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcproducts_price5[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price5, 'size="10"'); ?></td>

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE5_QTY; ?></td>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price5_qty = $attributes['products_price5_qty'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price5_qty = $pInfo->sppcproducts_price5_qty[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price5_qty = '';

}

echo tep_draw_input_field('sppcproducts_price5_qty[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price5_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td class="main"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price6 = $attributes['products_price6'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price6 = $pInfo->sppcproducts_price6[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price6 = '';

}

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcproducts_price6[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price6, 'size="10"'); ?></td>

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE6_QTY; ?></td>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price6_qty = $attributes['products_price6_qty'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price6_qty = $pInfo->sppcproducts_price6_qty[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price6_qty = '';

}

echo tep_draw_input_field('sppcproducts_price6_qty[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price6_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td class="main"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price7 = $attributes['products_price7'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price7 = $pInfo->sppcproducts_price7[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price7 = '';

}

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcproducts_price7[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price7, 'size="10"'); ?></td>

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE7_QTY; ?></td>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price7_qty = $attributes['products_price7_qty'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price7_qty = $pInfo->sppcproducts_price7_qty[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price7_qty = '';

}

echo tep_draw_input_field('sppcproducts_price7_qty[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price7_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

<td class="main"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price8 = $attributes['products_price8'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price8 = $pInfo->sppcproducts_price8[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price8 = '';

}

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcproducts_price8[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price8, 'size="10"'); ?></td>

<td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE8_QTY; ?></td>

<td class="main" align="left"><?php if ($customer_prices_set == true) {

$sppc_cg_products_price8_qty = $attributes['products_price8_qty'];

} elseif ($customer_prices_in_post == true) {

$sppc_cg_products_price8_qty = $pInfo->sppcproducts_price8_qty[$customers_group['customers_group_id']];

} else {

$sppc_cg_products_price8_qty = '';

}

echo tep_draw_input_field('sppcproducts_price8_qty[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price8_qty, 'size="10"'); ?></td>

</tr></table></td>

</tr>

<tr>

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

 

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

<td class="main"><?php echo TEXT_PRODUCTS_IMAGE_MEDIUM; // CAO 3 Images -> bei Bearbeitungsseite / Images on edit page !?></td>

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

</tr>

<tr>

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

</tr>

<td class="main"><?php echo TEXT_PRODUCTS_IMAGE_LARGE; // CAO 3 Images -> bei Bearbeitungsseite / Images on edit page !?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_image_large') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_image_large . tep_draw_hidden_field('products_previous_image_large', $pInfo->products_image_large); ?></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>

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

</table></td>

</tr>

<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_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 { // next query changed for Price Break 1.11.3.

$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_medium, p.products_image_large, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, 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'] . "'");

$product = tep_db_fetch_array($product_query);

 

$pInfo = new objectInfo($product);

$products_image_name = $pInfo->products_image;

$products_image_medium_name = $pInfo->products_image_medium;

$products_image_large_name = $pInfo->products_image_large;

// end CAO 3 Images

 

}

 

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

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

<?php // CAO 3 Images - Anzeige bei Preview / Show Images in Preview after edit!

echo tep_image(DIR_WS_CATALOG_IMAGES_MEDIUM . $products_image_medium_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description; ?>

&n

Edited by FHCeramics

Your help and suggestions are greatly appreciated.

Thanks

Wayne

Share this post


Link to post
Share on other sites

Yes, you've added the changes incorrectly. If you want, I'll clean it up and send it back... PM me an e-mail address

Share this post


Link to post
Share on other sites
Firstly, on my first lot of products (products are contained in the subcategory), it will not print the main category label.

i.e. it displays '-->sub category' instead of 'main category --> sub category'. Why is that happening? I cannot seem to figure it out. This was actually happening before any modifications were happening. For everyother main category and subcategory it is working fine - the error is only for the first main category.

Cheers,

Chris :)

 

Found for this:

 

admin/pdf_catalogue.php about Line 261

 while($k>0)	{

 

change to:

 while($k>=0)	{

 

Should do it.

Share this post


Link to post
Share on other sites

Update on the problem I was having for anyone else searching -- Customer generated Category Reports were NOT being generated even though it looked like they were but the Download Button leads to a File Not Found Error.

 

I was using the 23 Apr 2006 version of the contribution. On 20 May 2006 a new version was posted which fixed this problem (added language function to pdf_catalogue_info2.php).

 

Catalog Products PDF Reports Contribution Page

 

Update on problem of receiving a blank page for Customer generated Category Reports: make sure to have edited your categories in admin to set new Level status (Top Categories Level 1, Sub-categories Level 2, Level 3)

Edited by Maureen

Share this post


Link to post
Share on other sites

For anyone in the know:

 

catalog/pdf_catalogue_info2.php contains this information above the first echo statement:

 

//Anzeigen des Download Links und verstecken der Fehlermeldungen mit wei?er Schrift!!! ;)

//Fehler: foreach und Session //Nicht st?rend bei den Funktionen!

 

Which translates to:

//Announcements of the Download left and hide the error messages with white writing

//Error: foreach and session //Nicht disturbing with the functions!

 

The error message generated is:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/xxxxx/public_html/pdf_catalogue_info2.php:34) in /home/xxxxx/public_html/includes/functions/sessions.php on line 67

 

Most people will not even notice this presence but my live shop does not have a white background so just below the Download link for a category generated catalog this error message displays. The code for this is:

echo "<style type=\"text/css\">"

.".mini {font-size: 1pt;};"

."</style>"

."<link rel=\"stylesheet\" type=\"text/css\" href=\"../stylesheet.css\"><center><br><a href=\"$file_PDF\" target=\"_blank\"><font size=2 face=verdana><b>Download</b></font></center>"

."<font color=#FFFFFF class=mini>";code]

 

I've changed the font color to the color of my background but I still get little 1pt text warning showing beneath the download link. I would like to at least blend the text to the background but am having no luck doing so. Suggestions?

 

Preferably, I'd like the error to go away instead of being covered up! Maybe someone can figure out how to make this work without causing the error?

Share this post


Link to post
Share on other sites

Hello,

 

I'm moving my web site from Windows server to Apache. The "PDF Catalogue" worked great on Windows server but now on the Apache, when I go to generate a PDF catalogue I'm getting the following message:

Missing or incorrect image file: /var/www/store/osCommerce/images/Image.jpgFPDF error: Not a JPEG file: /var/www/store/osCommerce/images/

though my Image.jpg is in the /images/ directory. I've applied all latest fixes and in pdf_catalogue.php I changed $destination=DIR_S_CATALOG."catalogues/"; to $destination=DIR_FS_CATALOG."catalogues/"; and also in pdf_fdf.php I have

if(!$a)

{

print('Missing or incorrect image file: '.$file);

$file=DIR_FS_CATALOG.DIR_WS_IMAGES.DEFAULT_IMAGE;

//$this->Error('Missing or incorrect image file: '.$file);

}

But I'm still getting the above error. What can be a problem here on the Apache server that is different from Windows? Any help would be appreciated.

 

Thanks.

Edited by Irin

Share this post


Link to post
Share on other sites

Can someone tell me why it only genered the "Special" Product ????

 

$requete_prod="select p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_model, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = s.products_id and p.manufacturers_id = m.manufacturers_id and products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id='".$current_category_id."' order by pd.products_name, p.products_date_added DESC";

Share this post


Link to post
Share on other sites

i can generate the whole catalog but i cant get the categories to work.. all i get is this error

 

The requested URL /test/catalogues/categories_1.pdf was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Any one can enlighten me?

 

Besides that y does it create 3 files? what are the differences between these files?

Share this post


Link to post
Share on other sites
i can generate the whole catalog but i cant get the categories to work.. all i get is this error

 

The requested URL /test/catalogues/categories_1.pdf was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Any one can enlighten me?

 

See my Post #286 above -- make sure you have added the language function to pdf_catalogue_info2.php from the May 20th contribution

 

Besides that y does it create 3 files? what are the differences between these files?

 

There is one file for each of your installed languages -- catalog_1.pdf should be your default language and the one that will display for your default.

Share this post


Link to post
Share on other sites
See my Post #286 above -- make sure you have added the language function to pdf_catalogue_info2.php from the May 20th contribution

 

Did i insert it correctly? for pdf_catalogue_info2.php

 

echo "<style type=\"text/css\">"
.".mini {font-size: 1pt;};"
."</style>"
."<link rel=\"stylesheet\" type=\"text/css\" href=\"../stylesheet.css\"><center><br><a href=\"$file_PDF\" target=\"_blank\"><font size=2 face=verdana><b>Download</b></font></center>"
."<font color=#FFFFFF class=mini>";


//Neuerung ab Version 1.6
if (isset($PDF_ACTION)){

//Exportieren der Daten aus dem "Array" zur?ck in das wirkliche Array!!!
$KATEGORIE_SELECTED = explode("|", $KAT_SELECTED_ARRAY);


define('FPDF_FONTPATH','font/');
require('pdf_config.php');
require('pdf_fpdf.php');
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PDF_KATALOG);

function tep_get_languages_directory($code) {
global $languages_id;

$language_query = tep_db_query("select languages_id, directory from " . TABLE_LANGUAGES . " where code = '" . tep_db_input($code) . "'");
if (tep_db_num_rows($language_query)) {
  $language = tep_db_fetch_array($language_query);
  $languages_id = $language['languages_id'];
  return $language['directory'];
} else {
  return false;
}
 }



 function tep_get_languages() {
$languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
while ($languages = tep_db_fetch_array($languages_query)) {
  $languages_array[] = array('id' => $languages['languages_id'],
							 'name' => $languages['name'],
							 'code' => $languages['code'],
							 'image' => $languages['image'],
							 'directory' => $languages['directory']);
}

return $languages_array;
 }

// Count how many products exist in a category
// TABLES: products, products_to_categories, categories
 function tep_products_in_category_count($categories_id, $include_deactivated = false) {
$products_count = 0;

if ($include_deactivated) {
  $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$categories_id . "'");
} else {
  $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int)$categories_id . "'");
}

$products = tep_db_fetch_array($products_query);

$products_count += $products['total'];

$childs_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$categories_id . "'");
if (tep_db_num_rows($childs_query)) {
  while ($childs = tep_db_fetch_array($childs_query)) {
	$products_count += tep_products_in_category_count($childs['categories_id'], $include_deactivated);
  }
}

return $products_count;
 }


$products_index_array;
......

Share this post


Link to post
Share on other sites

I have the same problem that lostsoulz.

 

There is no problem generating the complete catalog from the admin page.

 

But there is no way to get a catalog from a category.

 

Always said that there is no file.

 

I only use one language ( Spanish ) and the contribution is last version: May 20th.

 

Help please , it is very interesting for my bussines.

 

Thanks

Share this post


Link to post
Share on other sites

For lostsoulz and NaKaToN

 

As far as I can tell the first function:

function tep_get_languages_directory($code) {
global $languages_id;

$language_query = tep_db_query("select languages_id, directory from " . TABLE_LANGUAGES . " where code = '" . tep_db_input($code) . "'");
if (tep_db_num_rows($language_query)) {
  $language = tep_db_fetch_array($language_query);
  $languages_id = $language['languages_id'];
  return $language['directory'];
} else {
  return false;
}
 }

belongs only in catalog/admin/includes/functions/general.php

 

So, I'd remove that, then your function tep_get_languages() { section will be right. If that doesn't work, there are two other changes I made to the file before I realized I was missing the tep_get_languages function so maybe they are needed as well.

 

In same file find:

 

 	$destination =DIR_FS_CATALOG."catalogues/";

 

and replace with:

 

 	$destination=DIR_FS_CATALOG."catalogues/";

 

Find:

 

	 while($k>0)	{

 

and replace with:

 

 	while($k>=0)	{

 

 

If these changes don't help, I don't know what to tell you to do. I don't remember making any other changes to get this to work. I can send you my files for comparison -- I had the same File Not Found error, the category catalog not being generated then with these changes it works perfect now. Did you upload the two "font" directories (one in admin, one in catalog)?

Share this post


Link to post
Share on other sites

Thanks Maureen , I?ve tried all you said but there is no way.

 

I return the website to the original state and try to install teh contributi?n from 0 but get the same results , with the whole catalog there is no problem but the categories_X.pdf is not genereted.

 

My website is in www.fugar.net/tienda/catalog , so maybe the problem is that the shop isn?t in the "/catalog" folder , it is in the "/tienda/catalog" folder.

 

Anyway if you can send me your files there will be great.

nakaton@fugar.net

 

Many Thanks

Share this post


Link to post
Share on other sites

Files sent...

 

Did you set the category levels in admin?

Did you change pdf_config.php and pdf_catalogue_info.php to direct to the correct directory (if like nakaton you are not using the default osc directories)?

 

Sorry, I can't think of anything else. If you find the problem please be sure to report the solution here :)

 

Maureen

Share this post


Link to post
Share on other sites

Finally i've found out what my problem was... It has nothing to do with

 

	while($k>0)	{

 

Or

 

	$destination =DIR_FS_CATALOG."catalogues/";

 

My problem is my files cant be created UNLESS my permissions are set as 777 to the 'catalogues' folder. IF it is set it as 755 i'll get the error :thumbsup:

Share this post


Link to post
Share on other sites
My problem is my files cant be created UNLESS my permissions are set as 777 to the 'catalogues' folder. IF it is set it as 755 i'll get the error :thumbsup:

 

 

I need set the permissions as 777 to generate the catalog from the admin, if i set as 755 it don?t was created. So the categories catalog don?t was created setting it as 755 or 777

 

Maureen , thanks by the files , I?m looking deep in the files but i think that maybe the problem is in the server configuration.

 

The font/ folders are in the right place and the levels in the admin are set correctly.

 

I will try againg from 0 , maybe will have better luck.

 

Thanks Again

Share this post


Link to post
Share on other sites

I think there's some problem with the script... i can get it running in my test folder but when i transfer it to my main folder the "download" word does'nt come out. But in the catalogues/ folder, the script successfully generates the category_X.pdf.

 

Any one encouter this problem?

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

×