Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 14 votes

Seperate Pricing Per Customer v3.5


5884 replies to this topic

#5861 14steve14

  • Community Member
  • 2,176 posts
  • Real Name:Steve
  • Gender:Male

Posted 23 January 2012, 15:19

View Postapolyshow, on 23 January 2012, 08:06, said:

Does anyone has install the SPPC 4.4.2 in a 2.3.1 store that has also the HeaderTags_SEO_V_3.2.7 contribution? How did he solve the problems in product listing and in other files? Don't tell me about winmerge cause i have made it twice and i am getting a problem with the products. Everything seems to be ok in the first page, all the products are there , when you choosing a product from the first page ( Whats new...) all ok, but when i am choosing a product from the categgories then the product it doesn't exists.....I don't have a picture not anything so i am gessing that the problem is in the file of product_listing at least or in the categories. Does anyone has face that?

If i can ever get the two add ons working together i am planning on doing this next.
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder. OSC has a steep learning curve, but in general the program does work. If it doesnt work, the chances are it is something you have done.

#5862 AGIBBS

  • Community Member
  • 13 posts
  • Real Name:Adam

Posted 27 January 2012, 13:00

Hi,

I have OSCommerce v2.3.1 with SPPC v4.2.2.2 installed and want the quantity price break addon installed as well. The version for SPPC 4.2.2 is v2 however it is not compatible with OSCommerce v2.3.1.


Does any body have any new mods for v2.3.1 yet???


Thanks in advance

#5863 14steve14

  • Community Member
  • 2,176 posts
  • Real Name:Steve
  • Gender:Male

Posted 27 January 2012, 16:32

View PostAGIBBS, on 27 January 2012, 13:00, said:

Hi,

I have OSCommerce v2.3.1 with SPPC v4.2.2.2 installed and want the quantity price break addon installed as well. The version for SPPC 4.2.2 is v2 however it is not compatible with OSCommerce v2.3.1.


Does any body have any new mods for v2.3.1 yet???


Thanks in advance

I have just installed this on 2.3.1 and after a bit of code changing it works fine. You will have to manually update all the files, but the instructions are quite clear and easy to follow. Backup your files first and give it a try. The only thing i will say is that when it comes to the categories page take your time and do not add all the code for the javascript as some of it is already installed and in a newer version.
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder. OSC has a steep learning curve, but in general the program does work. If it doesnt work, the chances are it is something you have done.

#5864 AGIBBS

  • Community Member
  • 13 posts
  • Real Name:Adam

Posted 30 January 2012, 09:30

Hi Steve,


Many thanks for the reply, I will give it a go and see it turns out.

#5865 AGIBBS

  • Community Member
  • 13 posts
  • Real Name:Adam

Posted 31 January 2012, 09:15

@14steve14 Hi Steve,

I have tried this install as mentioned and can not get the catalog/admin/categories.php to work no matter how I do it with or without the optional javascript as stated at the end of the files edit.


I have also noticed a couple of lines mentioned in the instructions which do not exist so maybe this is where I'm going wrong??



I have included my categories.php for any to look at and hopefully point me in the right direction.


Thanks in advance.

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

2. // BOF Separate Pricing per Customer
if (is_array($value)) {
while (list($k, $v) = each($value)) {
echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v)));
}
} else {
// EOF Separate Pricing per Customer




<?php
/*
  $Id$
  adapted for Separate Pricing Per Customer v4.2 2007/08/05, QPBPP for SPPC v2.0 2008/11/23
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2010 osCommerce
  Released under the GNU General Public License
*/
  require('includes/application_top.php');
  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();
  // BOF QPBPP for SPPC
// include the admin version of price formatter for the price breaks contribution
  require(DIR_WS_CLASSES . 'PriceFormatterAdmin.php');
  $pf = new PriceFormatter;
// EOF QPBPP for SPPC
  $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' => (int)$sort_order);
	    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'] . "'");
		  }
	    }
	    $categories_image = new upload('categories_image');
	    $categories_image->set_destination(DIR_FS_CATALOG_IMAGES);
	    if ($categories_image->parse() && $categories_image->save()) {
		  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':


#5866 AGIBBS

  • Community Member
  • 13 posts
  • Real Name:Adam

Posted 31 January 2012, 09:16

I'm having to pot my code in seperate replies as its too long for an all in one hit...



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'];
		  // 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
		  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 QPBPP for SPPC
		    tep_db_query("delete from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id = '" . (int)$product_id . "'");
// EOF QPBPP for SPPC
   
		  $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');
		    }


#5867 AGIBBS

  • Community Member
  • 13 posts
  • Real Name:Adam

Posted 31 January 2012, 09:16

  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_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' => (int)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 QPBPP for SPPC
								  'products_qty_blocks' => (($i = (int)tep_db_prepare_input($_POST['products_qty_blocks'][0])) < 1) ? 1 : $i,
								  'products_min_order_qty' => (($min_i = (int)tep_db_prepare_input($_POST['products_min_order_qty'][0])) < 1) ? 1 : $min_i,
// EOF QPBPP for SPPC
							    'products_date_available' => $products_date_available,
							    'products_weight' => (float)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' => (int)tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));
	    $products_image = new upload('products_image');
	    $products_image->set_destination(DIR_FS_CATALOG_IMAGES);
	    if ($products_image->parse() && $products_image->save()) {
		  $sql_data_array['products_image'] = tep_db_prepare_input($products_image->filename);
	    }
	    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 QPBPP for SPPC
// BOF entries in products_groups
$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, products_qty_blocks, products_min_order_qty 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);
// set default values for quantity blocks and min order quantity 
  $pg_products_qty_blocks = 1;
  $pg_products_min_order_qty = 1;
  $delete_row_from_pg = false;
  if (isset($_POST['products_qty_blocks'][$customers_group['customers_group_id']]) && (int)$_POST['products_qty_blocks'][$customers_group['customers_group_id']] > 1) {
	 $pg_products_qty_blocks = (int)$_POST['products_qty_blocks'][$customers_group['customers_group_id']];
  }
  if (isset($_POST['products_min_order_qty'][$customers_group['customers_group_id']]) && (int)$_POST['products_min_order_qty'][$customers_group['customers_group_id']] > 1) {
	 $pg_products_min_order_qty = (int)$_POST['products_min_order_qty'][$customers_group['customers_group_id']];
  }
  if ($_POST['sppcprice'][$customers_group['customers_group_id']] == '' && $pg_products_qty_blocks == 1 && $pg_products_min_order_qty == 1) {
    $delete_row_from_pg = true; // no need to have default values for qty blocks and min order qty in the table
  }
  if ($_POST['sppcprice'][$customers_group['customers_group_id']] == '') {
    $pg_cg_group_price = 'null';
  } else {
    $pg_cg_group_price = "'" . (float)$_POST['sppcprice'][$customers_group['customers_group_id']] . "'";
  }
  if (tep_db_num_rows($attributes_query) > 0 && $delete_row_from_pg == false) {
// there is already a row inserted in products_groups, update instead of insert 
    if ($_POST['sppcoption'][$customers_group['customers_group_id']]) { // this is checking if the check box is checked
	    tep_db_query("update " . TABLE_PRODUCTS_GROUPS . " set customers_group_price = " . $pg_cg_group_price . ", products_qty_blocks = " . $pg_products_qty_blocks . ", products_min_order_qty = " . $pg_products_min_order_qty . " where customers_group_id = '" . $attributes['customers_group_id'] . "' and products_id = '" . $products_id . "'");
    }
    else {
	  tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
    }
  } elseif (tep_db_num_rows($attributes_query) > 0 && $delete_row_from_pg == true) {
	  tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
  } elseif (($_POST['sppcoption'][$customers_group['customers_group_id']]) && $delete_row_from_pg == false) {
    tep_db_query("insert into " . TABLE_PRODUCTS_GROUPS . " (products_id, customers_group_id, customers_group_price, products_qty_blocks, products_min_order_qty) values ('" . $products_id . "', '" . $customers_group['customers_group_id'] . "', " . $pg_cg_group_price . ", " . $pg_products_qty_blocks . ", " . $pg_products_min_order_qty . ")");
  }
} // end while ($customers_group = tep_db_fetch_array($customers_group_query))
// EOF entries in products_groups
// BOF entries in products_to_discount_categories
  foreach ($_POST['discount_categories_id'] as $dc_cg_id => $dc_id) {
    $current_discount_category = (int)$_POST['current_discount_cat_id'][$dc_cg_id];
    $new_discount_category = (int)$dc_id;
    $discount_category_result = qpbpp_insert_update_discount_cats($products_id, $current_discount_category, $new_discount_category, $dc_cg_id);
	  if ($discount_category_result == false) {
		  $messageStack->add_session(ERROR_UPDATE_INSERT_DISCOUNT_CATEGORY, 'error');
	   }
  } // end foreach ($_POST['discount_categories_id'] as $dc_cg_id => $dc_id
// EOF entries in products_to_discount_categories
// BOF entries in products_price_break
  foreach ($_POST['products_price_break'] as $pbb_cg_id => $price_break_array) {
    foreach ($price_break_array as $key1 => $products_price) {
	  $pb_action = 'insert'; // re-set default to insert
	  $where_clause = '';
	  if (isset($_POST['products_delete'][$pbb_cg_id][$key1]) && $_POST['products_delete'][$pbb_cg_id][$key1] == 'y' && isset($_POST['products_price_break_id'][$pbb_cg_id][$key1])) {
	    $delete_from_ppb_array[] = (int)$_POST['products_price_break_id'][$pbb_cg_id][$key1];
	    continue;
	  }
	  if (!tep_not_null($products_price)) {
	    continue; // if price is empty this price break is unused
	  } elseif (!tep_not_null($_POST['products_qty'][$pbb_cg_id][$key1])) {
	    continue; // if qty is not entered we will not update or insert this in the table
	  } else {
	    $sql_price_break_data_array = array(
		   'products_id' => (int)$products_id,
		   'products_price' => (float)$products_price,
		   'products_qty' => (int)$_POST['products_qty'][$pbb_cg_id][$key1],
		   'customers_group_id' => $pbb_cg_id
		   );
			  
	    if (isset($_POST['products_price_break_id'][$pbb_cg_id][$key1]) && (int)$_POST['products_price_break_id'][$pbb_cg_id][$key1] > 0) {
		  $pb_action = 'update';
		  $where_clause = " products_price_break_id = '" . (int)$_POST['products_price_break_id'][$pbb_cg_id][$key1] . "'";
	    }
	    tep_db_perform(TABLE_PRODUCTS_PRICE_BREAK, $sql_price_break_data_array, $pb_action, $where_clause);
	  } // end if/else (!tep_not_null($products_price))
    } // end foreach ($price_break_array as $key1 => $products_price)
  } // end foreach ($_POST['products_price_break'] as $pbb_cg_id => $price_break_array)
 
// delete the unwanted price breaks using their products_price_break_id's
    if (isset($delete_from_ppb_array) && sizeof($delete_from_ppb_array > 0) && tep_not_null($delete_from_ppb_array[0])) {
	  tep_db_query("delete from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_price_break_id in (" . implode(',', $delete_from_ppb_array) . ")");
    }
// EOF entries in products_price_break
// EOF QPBPP for SPPC
	    }
	    $languages = tep_get_languages();
	    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
		  $language_id = $languages[$i]['id'];
		  $sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),
								  'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]),
								  'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]));
		  if ($action == 'insert_product') {
		    $insert_sql_data = array('products_id' => $products_id,
									 'language_id' => $language_id);
		    $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
		    tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
		  } elseif ($action == 'update_product') {
		    tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");
		  }
	    }
	    $pi_sort_order = 0;
	    $piArray = array(0);
	    foreach ($HTTP_POST_FILES as $key => $value) {
// Update existing large product images
		  if (preg_match('/^products_image_large_([0-9]+)$/', $key, $matches)) {
		    $pi_sort_order++;
		    $sql_data_array = array('htmlcontent' => tep_db_prepare_input($HTTP_POST_VARS['products_image_htmlcontent_' . $matches[1]]),
								    'sort_order' => $pi_sort_order);
		    $t = new upload($key);
		    $t->set_destination(DIR_FS_CATALOG_IMAGES);
		    if ($t->parse() && $t->save()) {
			  $sql_data_array['image'] = tep_db_prepare_input($t->filename);
		    }
		    tep_db_perform(TABLE_PRODUCTS_IMAGES, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and id = '" . (int)$matches[1] . "'");
		    $piArray[] = (int)$matches[1];
		  } elseif (preg_match('/^products_image_large_new_([0-9]+)$/', $key, $matches)) {
// Insert new large product images
		    $sql_data_array = array('products_id' => (int)$products_id,
								    'htmlcontent' => tep_db_prepare_input($HTTP_POST_VARS['products_image_htmlcontent_new_' . $matches[1]]));


#5868 AGIBBS

  • Community Member
  • 13 posts
  • Real Name:Adam

Posted 31 January 2012, 10:51

Not all code added I thought I had sussed it but I haven't.


Any one who can help with this one file it would really help!!

Thanks,

:)

#5869 AGIBBS

  • Community Member
  • 13 posts
  • Real Name:Adam

Posted 03 February 2012, 09:28

Combining QPBPP with SPPC


I really need some help with this one folks!!


I have installed SPPC 4.2 with OSC 2.3.1 and every thing seems to work fine, I am now trying to install QPBPP with it as well but every time I upload the file admin/categories.php I get a blank page.


I've noticed that some of the code mentioned in the install file do not exist in the file I am editing.

Here are the lines that do not exist...


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



// BOF Separate Pricing per Customer
if (is_array($value)) {
while (list($k, $v) = each($value)) {
echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v)));
}
} else {
// EOF Separate Pricing per Customer




Thanks in advance.

#5870 14steve14

  • Community Member
  • 2,176 posts
  • Real Name:Steve
  • Gender:Male

Posted 03 February 2012, 10:09

Javascript files have all been moved to your admin/includes/application_top.php file. Most of the javascript code you need to add is already in this file. Make sure you are not calling the same files twice or nothing works.

Then if i am not mistaken the next bit of code does not need to be added as the section of code it goes in has all been removed from 2.3.1

A while ago i asked a similar question asking for a working copy of the admin/categories.php file from someone who has installed both these contributions and no one answered. I spent ages sorting this out in the end.
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder. OSC has a steep learning curve, but in general the program does work. If it doesnt work, the chances are it is something you have done.

#5871 AGIBBS

  • Community Member
  • 13 posts
  • Real Name:Adam

Posted 03 February 2012, 10:31

Sorted that part onto the next.....

#5872 apolyshow

  • Community Member
  • 242 posts
  • Real Name:Andreas
  • Gender:Male

Posted 03 February 2012, 11:24

Does anyone knows why the SPPC 4.4.2 after the instalation cuts the customers name at half?
Before SPPC the customers name was 5 letters and then � in the greek language.
I had fix it, upgrading the database.php files so sql understands utf8 and also with upgrading the numbers of letters in customers name into database with .phpmyadmin .
I had made a test customer and everything was ok.
But after installation of SPPC IN A OSC 2.3.1 i am having the same issue in the greek language, but now i can't fix it.
Does anyone has the solution?
One amateur made the Arc, 5.000 pro made the Titanic...

#5873 AGIBBS

  • Community Member
  • 13 posts
  • Real Name:Adam

Posted 06 February 2012, 15:49

@14steve14 thanks for the advice.


Have you had any issues after install with the price not showing up on the product listing and search pages but it shows up ok in the product info page.


All defaults are set to GPB??


Any ideas??


Thanks,

#5874 plazman65

  • Community Member
  • 29 posts
  • Real Name:Michelle

Posted 12 February 2012, 18:57

Hi! Im hoping someone can point me in the right direction of where to look. I have sppc and hide products installed and the only issue I have run into is if I hide a category it still shows up in best sellers, reviews and new products, I have been looking and looking and I was hoping someone can give me a hint as to which file I messed up. Thanks for any help!

#5875 bassmaga

  • Community Member
  • 27 posts
  • Real Name:Kamil
  • Gender:Male
  • Location:Poland

Posted 12 February 2012, 21:52

View Postplazman65, on 12 February 2012, 18:57, said:

Hi! Im hoping someone can point me in the right direction of where to look. I have sppc and hide products installed and the only issue I have run into is if I hide a category it still shows up in best sellers, reviews and new products, I have been looking and looking and I was hoping someone can give me a hint as to which file I messed up. Thanks for any help!

Hi,
It isn't combined with sppc. You must looking for select and add clause after where like 'categories_status=1' in each module you want.

#5876 plazman65

  • Community Member
  • 29 posts
  • Real Name:Michelle

Posted 24 February 2012, 18:49

Can someone confirm for me that if I use the hide products portion that it will unindex them from google?

#5877 andes1

  • Community Member
  • 181 posts
  • Real Name:andrea pataquiva diaz

Posted 13 March 2012, 04:14

does sspc allow coupon?

#5878 geomilli

  • Community Member
  • 31 posts
  • Real Name:George Milligan
  • Gender:Male
  • Location:Danbury, Connecticut USA

Posted 24 April 2012, 08:05

Best Sellers Missing - Gone - Disappeared (for search reasons, because I can't find anything close in the forums)
Has anyone experienced the disappearance of the Best Sellers box after installing SPPC and HP&C?

Specials still active with conflicting settings (should this work or just deal with it?)
Anyone get it working with Specials as well? There is a little problem with mine if you disable the entire category for retail customers and have specials from that category in a retail group the products from that category still show. Is that normal?

Also, if you link to two categories for one product the products_new.php displays two of that same product on the page. My code is modified to be in columns, integrated for Ezier New Fields, SPPC and HP&C, Wishlist and a database name "products_namebreak" that I have created for display formatting so it's funky.

I can post the code if anyone is interested, but I know it's not products_new.php, because I replaced it with the unaltered version from the install with the same results.

I assume the problem is from somewhere else maybe? The call is from another page handed off to this one?

Any insight would be great and if you know the post with the answer, thanks ahead of time!

Edited by geomilli, 24 April 2012, 08:11.


#5879 geomilli

  • Community Member
  • 31 posts
  • Real Name:George Milligan
  • Gender:Male
  • Location:Danbury, Connecticut USA

Posted 24 April 2012, 08:18

View Postandes1, on 13 March 2012, 04:14, said:

does sspc allow coupon?


Yes, it works with:

Credit Class & Gift Voucher - http://www.oscommerce.com/community/contributions,282 or http://addons.oscommerce.com/info/8002
and if your interested...
POINTS AND REWARDS MODULE V1.00 - http://www.oscommerce.com/community/contributions,3220

Edited by geomilli, 24 April 2012, 08:21.


#5880 geomilli

  • Community Member
  • 31 posts
  • Real Name:George Milligan
  • Gender:Male
  • Location:Danbury, Connecticut USA

Posted 26 April 2012, 08:09

View Postgeomilli, on 24 April 2012, 08:05, said:

Best Sellers Missing - Gone - Disappeared (for search reasons, because I can't find anything close in the forums)
Has anyone experienced the disappearance of the Best Sellers box after installing SPPC and HP&C?

OOPS! Simple mistake on my end... made a configuration error on the admin side. Best Sellers was set to 5 as a minimum by mistake. However, to get it to work I had to purge my beta orders and customers to reset the system. I suppose from messing around with different groups and orders from those various settings the database was a bit confused. Delete orders and customers either by client or admin software, then you should be good again.

I still have a problem with products in two categories or two specials for two groups displaying in various areas. If you have or had a similar problem let me know!