Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

When I want to edit a customer I get this error:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /www/htdocs/..../..../admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /www/htdocs/..../..../admin/includes/classes/object_info.php on line 18

You didn't happen to remove all the customers groups did you? There is a good reason why the sql for adding this contribution contains:
INSERT INTO `customers_groups` VALUES('0','Retail','1','0','','');

Link to comment
Share on other sites

Modulo central de Productos Destacados

(Contribucion Featured Products,

version: Featured Products 1.5.8 Complete Pack - de nicko107 - de fecha 11 Oct 2006 )

archivo: catalog/includes/modules/featured.php

Check page 112 of this thread. In particular this post. It contains the code for that module (second code block in that post). Seeing it back I see the code shows a diamond with a question mark in my browser on a few places. That should be a no-break space (so & nbsp; without the space between the & and the nbsp;).

Link to comment
Share on other sites

thank you very much janz beforehand by your inestimable and disinterested aid.

 

Modulo central de Ofertas

(Contribucion Specials on Default.php,

version: Specials on Default 3.0 - de nicko107 - de fecha 3 Oct 2006 )

archivo: catalog/includes/modules/default_specials.php

 

<?php
$info_box_contents = array();
 $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
 new infoBoxHeading($info_box_contents, true, false, tep_href_link(FILENAME_SPECIALS));

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
 $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIALS_PRODUCTS_MODULE);
  } else {
 $new = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price, s.specials_new_products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and s.status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_SPECIALS_PRODUCTS_MODULE);
  }


$info_box_contents = array();
 $row = 0;
 $col = 0;
 while ($default_specials = tep_db_fetch_array($new)) {
$default_specials['products_name'] = tep_get_products_name($default_specials['products_id']);
$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>');
$col ++;
if ($col > 2) {
  $col = 0;
  $row ++;
}
 }
 new contentBox($info_box_contents);
?>

<!-- default_specials_eof //-->

Link to comment
Share on other sites

I know nothing of STS. But from your description of the problem you seem to have an issue with product_info.php. The "hide" logic is added to the $product_check_query in the beginning of the file. For the Hide Products mod the code to ascertain the $customer_group_id is moved to before that $product_check_query. If you haven't than that might be the problem.

 

Thank you JanZ - I will check the sts_inc files as well as the Master Product files (I think there might be a product_info.php in there as well).

 

In the meantime - I am using Dynamenu for my categories menu and was trying to make the SQL Query changes manually in my dm_categories file and I keep getting an error that there is an unexpected '"' in the query line - here is the query I have:

$result = tep_db_query('select c.categories_id, c.sort_order, cd.categories_id, cd.categories_name, c.parent_id, p.products_id, p.products_master_status, pd.products_id, pd.products_name from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd, ' . TABLE_PRODUCTS . ' p, ' . TABLE_PRODUCTS_DESCRIPTION . ' pd where c.categories_id = cd.categories_id and p.products_id = pd.products_id and p.products_master_status = 1 and cd.language_id="' . (int)$languages_id .'" and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 '.$parent_query.'order by sort_order, cd.categories_name');

 

How would you restructure the query? I tried moving things around and just couldn't seem to get away from that error message. At the moment we don't have any categories that we would want to hide (and we only need it working to hide an entire category) but just in case we need to in the future I figure it's better to get it setup properly now than to try and remember what needs to be edited 6 months from now :blush:

 

Thanks again!

~Tracy
 

Link to comment
Share on other sites

I keep getting an error that there is an unexpected '"' in the query line - here is the query I have:
That query is a bit atypical since in osC standard notation is tep_db_query("select bla, bla") whereas here tep_db_query('select bla, bla') is used. In the find_in_set part the osC "standard" is used but for this notation you should turn the quotes around (first double quote and then the single quote). Also there should be a space before order by:

$result = tep_db_query('select c.categories_id, c.sort_order, cd.categories_id, cd.categories_name, c.parent_id, p.products_id, p.products_master_status, pd.products_id, pd.products_name from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd, ' . TABLE_PRODUCTS . ' p, ' . TABLE_PRODUCTS_DESCRIPTION . ' pd where c.categories_id = cd.categories_id and p.products_id = pd.products_id and p.products_master_status = 1 and cd.language_id="' . (int)$languages_id .'" and find_in_set("' . $customer_group_id . '", categories_hide_from_groups) = 0 '.$parent_query.' order by sort_order, cd.categories_name');

Link to comment
Share on other sites

That query is a bit atypical since in osC standard notation is tep_db_query("select bla, bla") whereas here tep_db_query('select bla, bla') is used. In the find_in_set part the osC "standard" is used but for this notation you should turn the quotes around (first double quote and then the single quote). Also there should be a space before order by:

 

Thank you JanZ - I thought I had tried reversing the quotes but apparently I missed something the first couple of times :blush: The menu is at least not giving me errors anymore - so I'm assuming all is well there now :)

 

I think I may have found the culprit with the product_info. Remember a while ago I learned that product_info wasn't actually what was showing my products and that it was actually master_products and master_listing that were performing this function?

 

Well - I have been looking through those two files and there are several queries - I'm not sure which one(s) need changing. The master_products.php file only has one query that is called by master_listing (I believe if memory serves me correctly) and that is:

$master_sql = "select  " . $select_column_list . " p.products_id,  p.manufacturers_id, p.products_tax_class_id, NULL as specials_new_products_price, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id where p.products_id = pd.products_id and p.products_master = '" . $thisquery['products_master'] . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

 

The master_listing.php is, I think, in need of possibly more than just the query change as it also has other SPPC edits as well - so I'm posting the whole source code for that one:

$listing_split = new splitPageResults($master_sql, MAX_DISPLAY_SEARCH_RESULTS, 'products_master');



 if ( ($listing_split->number_of_rows > 0) && ( (MASTER_PREV_NEXT_BAR_LOCATION == '1') || (MASTER_PREV_NEXT_BAR_LOCATION == '3') ) ) {


?>


<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 </tr>
</table>
<?php
 }



 $list_box_contents = array();

 for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
switch ($column_list[$col]) {
  case 'MASTER_LIST_MODEL':
	$lc_text = TABLE_HEADING_MODEL;
	$lc_align = '';
	break;
  case 'MASTER_LIST_NAME':
	$lc_text = TABLE_HEADING_PRODUCTS;
	$lc_align = '';
	break;
  case 'MASTER_LIST_DESCRIPTION':
	$lc_text = TABLE_HEADING_DESCRIPTION;
	$lc_align = 'center';
	break;
  case 'MASTER_LIST_ATTRIBUTES':
	$lc_text = TABLE_HEADING_ATTRIBUTES;
	$lc_align = 'center';
	break;				
  case 'MASTER_LIST_MANUFACTURER':
	$lc_text = TABLE_HEADING_MANUFACTURER;
	$lc_align = '';
	break;
  case 'MASTER_LIST_PRICE':
	$lc_text = TABLE_HEADING_PRICE;
	$lc_align = 'right';
	break;
  case 'MASTER_LIST_QUANTITY':
	$lc_text = TABLE_HEADING_QUANTITY;
	$lc_align = 'right';
	break;
  case 'MASTER_LIST_WEIGHT':
	$lc_text = TABLE_HEADING_WEIGHT;
	$lc_align = 'right';
	break;
  case 'MASTER_LIST_IMAGE':
	$lc_text = TABLE_HEADING_IMAGE;
	$lc_align = 'center';
	break;
  case 'MASTER_LIST_BUY_NOW':
	$lc_text = TABLE_HEADING_BUY_NOW;
	$lc_align = 'center';
	break;
	case 'MASTER_LIST_OPTIONS':
	  $lc_text = TABLE_HEADING_OPTIONS;
	  $lc_align = 'align="center"';
	  break;
}

if ( ($column_list[$col] != 'MASTER_LIST_BUY_NOW') && ($column_list[$col] != 'MASTER_LIST_IMAGE') && ($column_list[$col] != 'MASTER_LIST_MULTIPLE') && ($column_list[$col] != 'MASTER_LIST_DESCRIPTION') && ($column_list[$col] != 'MASTER_LIST_OPTIONS') ) {
  $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
}

$list_box_contents[0][] = array('align' => $lc_align,
								'params' => 'class="productListing-heading"',
								'text' => ' ' . $lc_text . ' ');
 }

 if ($listing_split->number_of_rows > 0) {
$rows = 0;
$master_query = tep_db_query($listing_split->sql_query);
// BOF Separate Pricing per Customer
 $no_of_listings = tep_db_num_rows($master_query);
  global $sppc_customer_group_id;
// global variable (session) $sppc_customer_group_id -> local variable customer_group_id

if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
} else {
$customer_group_id = $sppc_customer_group_id;
}

while ($_listing = tep_db_fetch_array($master_query)) {
$listing[] = $_listing;
$list_of_prdct_ids[] = $_listing['products_id'];
}
// next part is a debug feature, when uncommented it will print the info that this module receives

/*   echo '<pre>';
print_r($listing);
echo '</pre>'; */

$select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' ";
if ($no_of_listings > 1) {
for ($n = 1; $n < count($list_of_prdct_ids); $n++) {
$select_list_of_prdct_ids .= "or products_id = '".$list_of_prdct_ids[$n]."' ";
}
}

// get all product prices for products with the particular customer_group_id
// however not necessary for customer_group_id = 0
if ($customer_group_id != '0') {
$pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where (".$select_list_of_prdct_ids.") and pg.customers_group_id = '".$customer_group_id."' ");
//   $no_of_pg_products = tep_db_num_rows($pg_query);
 while ($pg_array = tep_db_fetch_array($pg_query)) {
 $new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '', 'final_price' => $pg_array['price']);
 }
for ($x = 0; $x < $no_of_listings; $x++) {
// replace products prices with those from customers_group table
if(!empty($new_prices)) {
   for ($i = 0; $i < count($new_prices); $i++) {
  if( $listing[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
$listing[$x]['products_price'] = $new_prices[$i]['products_price'];
$listing[$x]['final_price'] = $new_prices[$i]['final_price'];
  }
 }
} // end if(!empty($new_prices)
$listing[$x]['specials_new_products_price'] = ''; // makes sure that a retail specials price doesn't carry over to another customer group
$listing[$x]['final_price'] = $listing[$x]['products_price']; // final price should not be the retail special price
} // end for ($x = 0; $x < $no_of_listings; $x++)
} // end if ($customer_group_id != '0')

// an extra query is needed for all the specials

$specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where (".$select_list_of_prdct_ids.") and status = '1' and customers_group_id = '" .$customer_group_id. "'");
while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']);
}

// add the correct specials_new_products_price and replace final_price
for ($x = 0; $x < $no_of_listings; $x++) {

  if(!empty($new_s_prices)) {
  for ($i = 0; $i < count($new_s_prices); $i++) {
if( $listing[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
  $listing[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];
  $listing[$x]['final_price'] = $new_s_prices[$i]['final_price'];
}
  }
 } // end if(!empty($new_s_prices)
} // end for ($x = 0; $x < $no_of_listings; $x++)

//	while ($listing = tep_db_fetch_array($listing_query)) { (was original code)
for ($x = 0; $x < $no_of_listings; $x++) {
$rows++;

if (($rows/2) == floor($rows/2)) {
  $list_box_contents[] = array('params' => 'class="productListing-even"');
} else {
  $list_box_contents[] = array('params' => 'class="productListing-odd"');
}

$cur_row = sizeof($list_box_contents) - 1;

for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
  $lc_align = '';
  $lc_params = '';

  switch ($column_list[$col]) {
	case 'MASTER_LIST_MODEL':
	  $lc_align = '';
	  $lc_text = ' ' . $listing[$x]['products_model'] . ' ';
	  break;
	case 'MASTER_LIST_NAME':
	  $lc_align = '';
	  if (isset($HTTP_GET_VARS['manufacturers_id'])) {
		$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';
	  } else {
		$lc_text = ' ' . $listing[$x]['products_name'] . '</a> ';
	  }
	  break;
	case 'MASTER_LIST_DESCRIPTION':
	  $lc_align = '';
	  $lc_text = ' ' . osc_trunc_string(strip_tags($listing[$x]['products_description'], '<a><b><em><font><i><s><span><strong><sub><sup><u>'), MASTER_LIST_DESCRIPTION_LENGTH) . ' ';

	  break;			
	case 'MASTER_LIST_MANUFACTURER':
	  $lc_align = '';
	  $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a> ';
	  break;
	 case 'MASTER_LIST_PRICE':
	   $lc_align = 'right';
	   if (tep_not_null($listing[$x]['specials_new_products_price'])) {
		 $lc_text = ' <s>' .  $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span> ';
	   } else {
		 $lc_text = ' ' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' ';
	   }
	   break;
	case 'MASTER_LIST_QUANTITY':
	  $lc_align = 'right';
	  $lc_text = ' ' . $listing[$x]['products_quantity'] . ' ';
	  break;
	case 'MASTER_LIST_WEIGHT':
	  $lc_align = 'right';
	  $lc_text = ' ' . $listing[$x]['products_weight'] . ' ';
	  break;
	case 'MASTER_LIST_IMAGE':
	  $lc_align = 'center';
	  if (isset($HTTP_GET_VARS['manufacturers_id'])) {
		$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
	  } else {
		$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
	  }
	  break;

	case 'MASTER_LIST_BUY_NOW':

	  $lc_align = 'center';
	  $lc_valign = 'top';
	  if ((STOCK_CHECK == 'true')&&(tep_get_products_stock($listing[$x]['products_id']) < 1)) {
	  $lc_text = TEXT_STOCK;
	} elseif ((STOCK_CHECK == 'false')&&(tep_get_products_stock($listing[$x]['products_id']) < 1)) {
	  $qty_array = array();
	  for ($i=0; $ns = 20, $i <= $ns; $i++) {
	  $qty_array[] = array('id' => $i, 'text' => $i);

	  $lc_text = tep_draw_input_field('Qty_ProdId_' . $listing[$x]['products_id'], '', 'size="4"');

	  }
	} else {
	  $quantity = tep_get_products_stock($listing[$x]['products_id']);  
	  $qty_array = array();
	  for ($i=0; $ns = (($quantity < 20) ? $quantity : 20), $i <= $ns; $i++) {
	  $qty_array[] = array('id' => $i, 'text' => $i);

	  $lc_text = tep_draw_input_field('Qty_ProdId_' . $listing[$x]['products_id'], '', 'size="4"');

	  }
  }
	 break;

  case 'MASTER_LIST_OPTIONS':

		$lc_align = 'align="center"';
		$lc_text = '';
		// BOF: attribute options
		$opt_count=0;
		$products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing[$x]['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "' ORDER by products_options_id");
		while ($products_options_name_values = tep_db_fetch_array($products_options_name)) {
		  $opt_count++;
		  $products_options_array = array();
		  $lc_text .= '<b>' . $products_options_name_values['products_options_name'] . '</b><br />' . "\n";
		  $products_options = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$listing[$x]['products_id'] . "' and pa.options_id = '" . (int)$products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

		   while ($products_options_values = tep_db_fetch_array($products_options)) {
			 $products_options_array[] = array('id' => $products_options_values['products_options_values_id'], 'text' => $products_options_values['products_options_values_name'], 'style' => '');
			 if ($products_options_values['options_values_price'] != '0') {
			   $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options_values['price_prefix'] . $currencies->display_price($products_options_values['options_values_price'], tep_get_tax_rate($product_info_values['products_tax_class_id'])) .') ';
			 }
		   }
		 $lc_text .= tep_draw_pull_down_menu('id_'.$listing[$x]['products_id'].'[' . $products_options_name_values['products_options_id'] . ']', $products_options_array);
		 $lc_text .= '<br />';
		}
	  if($opt_count==0) {
		$lc_text = MASTER_TEXT_NONE;
	  }
	  // EOF: attribute options
	  break;
  }
  $list_box_contents[$cur_row][] = array('align' => $lc_align,
										 'valign' => $lc_valign,
										 'params' => 'class="productListing-data"',
										 'text'  => $lc_text);
}
 }

 new productListingBox($list_box_contents);
} else {
 $list_box_contents = array();

 $list_box_contents[0] = array('params' => 'class="productListing-odd"');
 $list_box_contents[0][] = array('params' => 'class="productListing-data"',
							 'text' => TEXT_NO_PRODUCTS);

 new productListingBox($list_box_contents);
}
?>	 
  <table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
 </table>
<?php
 if ( ($listing_split->number_of_rows > 0) && ((MASTER_PREV_NEXT_BAR_LOCATION == '2') || (MASTER_PREV_NEXT_BAR_LOCATION == '3')) ) {
?>	 
 <table border="0" width="100%" cellspacing="0" cellpadding="2">		  
 <tr>
	<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
	<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 </tr>
</table>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>

<?php
 }
?>

 

The only other page I'm not sure on is the product_info.php file in the sts_inc folder. I didn't see the same query that needs changing in the main product_info.php file - but there were some other queries - so I went ahead and edited them, but it didn't seem to make any difference (which is why I think it's with the above two files) - but thought I'd throw it in here just in case I missed something. I edited the $product_info_query and the $master_query and the if tep_session is registered SPPC statement - but I'm not sure if that is what I needed to edit or not :blush:

$products_id=intval($_GET['products_id']);
// Create variables for product ID, added in v4.0.6	
$template['productid'] = $products_id;
$template['productsid'] = $products_id; // Just for consistende with osC names

// Start the "Add to Cart" form
$template_pinfo['startform'] = tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_slave'));
// Add the hidden form variable for the Product_ID
$template_pinfo['startform'] .= tep_draw_hidden_field('products_id', $products_id);
$template_pinfo['endform'] = "</form>";

// BOF Separate Pricing Per Customer, hide products and categories from groups
 if(!tep_session_is_registered('sppc_customer_group_id')) { 
 $customer_group_id = '0';
 } else {
  $customer_group_id = $sppc_customer_group_id;
 }
// EOF Separate Price per Customer

// Get product information from products_id parameter
$product_info_query = tep_db_query("select p.products_master_status, p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . $products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0");
$product_info = tep_db_fetch_array($product_info_query);

// START Master Products
$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master =  '" . (int)$HTTP_GET_VARS['products_id'] . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0");
   $results = tep_db_fetch_array($master_query);

// BOF Separate Price per Customer

	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $products_id . "' and customers_group_id =  '" . $customer_group_id . "'");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
	$product_info['products_price']= $scustomer_group_price['customers_group_price'];
}
// EOF Separate Price per Customer
$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
} else {

// BOF Separate Price per Customer
	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $products_id . "' and customers_group_id =  '" . $customer_group_id . "'");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
	$product_info['products_price']= $scustomer_group_price['customers_group_price'];
}
// EOF Separate Price per Customer


  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}

if ($product_info['products_price']>0) {
  $qty_array = array();
  for ($i=0; $n2 = (($product_info['products_quantity'] < 20) ? $product_info['products_quantity'] : 20), $i <= $n2; $i++) {
	$qty_array[] = array('id' => $i, 'text' => $i); 
  }
  if (($product_info['products_quantity'] > 0) || (STOCK_CHECK == 'false')) {
	$template_pinfo['qtyproducts']= TEXT_QUANTITY . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array);
  } else {
	  $template_pinfo['qtyproducts']= TEXT_STOCK;
					  }
}				

$template_pinfo['slaveproducts']='';
if (($results['products_id'] != null) && ($product_info['products_master_status'] == 1)) {
  $sts->start_capture();
	  echo ' ';
  include(DIR_WS_MODULES . FILENAME_MASTER_PRODUCTS);
	  echo ' ';
  $sts->stop_capture ('slaveproducts', 'box');
  $template_pinfo['slaveproducts']= $sts->template['slaveproducts'];
	}
// END Master Products

$template_pinfo['regularprice'] = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
  $template_pinfo['regularpricestrike'] = "<s>" . $template_pinfo['regularprice'] . "</s>";
  $template_pinfo['specialprice'] = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']));
} else {
  $template_pinfo['specialprice'] = '';
  $template_pinfo['regularpricestrike'] = $template_pinfo['regularprice'];
}

$template_pinfo['productname'] = $product_info['products_name'];
$template_pinfo['productmodel'] =  $product_info['products_model'];

if (tep_not_null($product_info['products_image'])) {
 $template_pinfo['imagesmall'] = tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"');
 $template_pinfo['imagelarge'] = tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), '','','');
 $template_pinfo['product_popup']= '<script language="javascript"><!--'."\n".
							   'document.write(\'<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . (int)$products_id) . '\\\')">' . $template_pinfo['imagesmall'] . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>\');'."\n".
							   '//--></script>'."\n".
							   '<noscript>'."\n".
							   '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">'.$template_pinfo['imagesmall'] . '<br>' . TEXT_CLICK_TO_ENLARGE .'</a>'."\n".
							   '</noscript>'."\n";
} else {
 $template_pinfo['imagesmall'] ='';
 $template_pinfo['imagelarge'] ='';
 $template_pinfo['product_popup']='';	
}

$template_pinfo['productdesc'] = stripslashes($product_info['products_description']); 

// Get the number of product attributes (the select list options)
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);
// If there are attributes (options), then...
if ($products_attributes['total'] > 0) {
 // Print the options header
 $template_pinfo['optionheader'] = TEXT_PRODUCT_OPTIONS;

 // Select the list of attribute (option) names
 $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

 while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
$products_options_array = array();
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

// For each option name, get the individual attribute (option) choices
while ($products_options = tep_db_fetch_array($products_options_query)) {
  $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

  // If the attribute (option) has a price modifier, include it
  if ($products_options['options_values_price'] != '0') {
	$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
  }

}

// If we should select a default attribute (option), do it here
if (isset($cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']])) {
  $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
} else {
  $selected_attribute = false;
}

$template_pinfo['optionnames'] .= $products_options_name['products_options_name'] . ':<br>'; 
$template_pinfo['optionchoices'] .=  tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . "<br>"; 
 }
} else {
 // No options, blank out the template variables for them
 $template_pinfo['optionheader'] = '';
 $template_pinfo['optionnames'] = '';
 $template_pinfo['optionchoices'] = '';
}

// See if there are any reviews
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$_GET['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
 $template_pinfo['reviews'] = TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; 
} else {
 $template_pinfo['reviews'] = '';
}

// See if there is a product URL
if (tep_not_null($product_info['products_url'])) {
 $template_pinfo['moreinfolabel'] = TEXT_MORE_INFORMATION;
 $template_pinfo['moreinfourl'] = tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false); 
} else {
 $template_pinfo['moreinfolabel'] = '';
 $template_pinfo['moreinfourl'] = '';
}

$template_pinfo['moreinfolabel'] = str_replace('%s', $template_pinfo['moreinfourl'], $template_pinfo['moreinfolabel']);

// See if product is not yet available
if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
 $template_pinfo['productdatelabel'] = TEXT_DATE_AVAILABLE;
 $template_pinfo['productdate'] = tep_date_long($product_info['products_date_available']);
} else {
 $template_pinfo['productdatelabel'] = TEXT_DATE_ADDED;
 $template_pinfo['productdate'] = tep_date_long($product_info['products_date_added']); 
}

// Strip out %s values
$template_pinfo['productdatelabel'] = str_replace('%s.', '', $template['productdatelabel']);

// See if any product reviews
$template_pinfo['reviewsurl'] = tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params());
$template_pinfo['reviewsbutton'] = tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS);
$template_pinfo['addtocartbutton'] = tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);

// See if any "Also Purchased" items. Feature added in v4.0.6
$sts->start_capture();
if ((USE_CACHE == 'true') && empty($SID)) {
  echo tep_cache_also_purchased(3600);
} else {
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
$sts->stop_capture ('alsopurchased'); // Get the result to the main array
$template_pinfo['alsopurchased']= $sts->template['alsopurchased']; // Put it in the product info

?>

 

Sorry the post is so long - but I figure it's best to cover all bases at once if possible :blush:

~Tracy
 

Link to comment
Share on other sites

Francisco,

thank you very much janz beforehand by your inestimable and disinterested aid.

 

Modulo central de Ofertas

(Contribucion Specials on Default.php,

version: Specials on Default 3.0 - de nicko107 - de fecha 3 Oct 2006 )

archivo: catalog/includes/modules/default_specials.php

I guess changing the top part to this should do it:

<?php
$info_box_contents = array();
 $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
 new infoBoxHeading($info_box_contents, true, false, tep_href_link(FILENAME_SPECIALS));

// global variable (session) $sppc_customer_group_id -> local variable customer_group_id

 if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') {
 $customer_group_id = $_SESSION['sppc_customer_group_id'];
 } else {
  $customer_group_id = '0';
 }

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
 $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' and s.customers_group_id = '" . $customer_group_id . "' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIALS_PRODUCTS_MODULE);
  } else {
 $new = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price, s.specials_new_products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and s.status = '1' and s.customers_group_id = '" . $customer_group_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_SPECIALS_PRODUCTS_MODULE);
  }

Link to comment
Share on other sites

I am using Separate Pricing 4.1.1 and it is working fine except for 1 problem.

We have STS Templates installed and the pricing levels wont show on product_info.php.

I dont know how to modify the sts_product_info.php file

Here is the place I get stuck:

$template['regularpricestrike'] = "<s>" . $template['regularprice'] . "</s>";

$template['specialprice'] = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']));

} else {

// BOF Separate Price per Customer

$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id = '" . $customer_group_id . "'");

if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {

$product_info['products_price']= $scustomer_group_price['customers_group_price'];

}

// EOF Separate Price per Customer

$template['specialprice'] = '';

$template['regularpricestrike'] = $template['regularprice'];

 

The area I added the mod for Separate Price doesnt work.

 

Any ideas?

Link to comment
Share on other sites

I dont know how to modify the sts_product_info.php file
I don't know either because I have never seen it. But from the code you show it looks like you are way too late with the query for the group price because sts seems to have replaced the 'products_price' with 'regularprice' and that is used before you do the query. Moreover the array that is used is not called product_info but template so you need to change the code accordingly.
Link to comment
Share on other sites

Hi All,

I am using the SPPC contrib and would like to be able to offer shipping options based on the customer_group of the purchaser....

 

Can any one assist with any pointers on what variables may be available at the checkout_shipping that I could use in my shipping modules to filter based on customer_group ?

 

Any assistance welcome.

Link to comment
Share on other sites

Please ignore I have found the settable options, I had forgotten about in the SPPC contrib admin panel!!!

 

 

 

Hi All,

I am using the SPPC contrib and would like to be able to offer shipping options based on the customer_group of the purchaser....

 

Can any one assist with any pointers on what variables may be available at the checkout_shipping that I could use in my shipping modules to filter based on customer_group ?

 

Any assistance welcome.

Link to comment
Share on other sites

I am using Separate Pricing 4.1.1 and it is working fine except for 1 problem.

We have STS Templates installed and the pricing levels wont show on product_info.php.

I dont know how to modify the sts_product_info.php file

 

What version of STS are you using? If it's the same version I'm using I will be happy to post my includes/modules/sts_inc/product_info.php file - but I also have Master Products installed so you would need to just do a file comparison (like in WinMerge) and then only add the parts that are for SPPC to your file.

~Tracy
 

Link to comment
Share on other sites

Hi Guys,

 

JanZ recommended I post on here as i've got a few questions or require help with the use of QPBPP contribution with Easy Populate contrib. I'm sure its quite easy but unfortunately my PHP and MySQL programming isn't that great and I haven't got a clue where to start.

 

Could someone help me find a solution or an addition that will allow me to use Easy Populate to incorporate QPBPP values for the products.

 

I've already posted a topic but I was recommended to post in here

 

http://www.oscommerce.com/forums/index.php?showtopic=245678

 

Thanks so much to anyone who can help me :)

Link to comment
Share on other sites

I think I may have found the culprit with the product_info. Remember a while ago I learned that product_info wasn't actually what was showing my products and that it was actually master_products and master_listing that were performing this function?

 

Well - I have been looking through those two files and there are several queries - I'm not sure which one(s) need changing. The master_products.php file only has one query that is called by master_listing (I believe if memory serves me correctly) and that is:

$master_sql = "select  " . $select_column_list . " p.products_id,  p.manufacturers_id, p.products_tax_class_id, NULL as specials_new_products_price, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id where p.products_id = pd.products_id and p.products_master = '" . $thisquery['products_master'] . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

 

The master_listing.php is, I think, in need of possibly more than just the query change as it also has other SPPC edits as well - so I'm posting the whole source code for that one:

 

Hi JanZ - Any thoughts on this one yet?

 

Thanks,

~Tracy
 

Link to comment
Share on other sites

Again thank you very much janz and as always never to know again like being thankful. I already have left very little to finish, I let this to you to see if you can help me to solve it.

A hug

 

Box de la columna izquierda de Productos Destacados

(Contribucion Featured Products)

archivo: catalog/includes/boxes/featured.php

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License

 Featured Products V1.1
 Displays a list of featured products, selected from admin
 For use as an Infobox instead of the "Feature" Infobox  
*/

 if ($random_product = tep_random_select("select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, s.specials_new_products_price,  specials_new_products_price, p.products_date_added from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS)) {
 //("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {

?>
<!-- featured_products //-->
	  <tr>
		<td>
<?php
$random_product['products_name'] = tep_get_products_name($random_product['products_id']);
$random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);

$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_FEATURED);

new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS));

if (tep_not_null($random_product['specials_new_products_price'])) {
  $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
  $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
} else {
  $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
}

$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
							 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price);

new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- featured_products_eof //-->
<?php
 }
?>

 

Box de la columna derecha que muestra ofertas en scroll

(Contribucion Ofertas en scroll)

archivo: catalog/includes/boxes/specials_scroll.php

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 $rp_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_DISPLAY_SPECIALS_SCROLL);
 if (tep_db_num_rows($rp_query)) {
?>
<!-- specials //-->
	  <tr>
		<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_SPECIALS);

new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));

while ($random_product = tep_db_fetch_array($rp_query)) {
$rp .= '<center><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
$rp .= "</SPAN><BR />\n---------\n";
}

$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
							 'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "20" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$rp.'</span></MARQUEE>');

new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- specials_eof //-->
<?php
 }
?>

Link to comment
Share on other sites

Hi JanZ - Any thoughts on this one yet?

 

Thanks,

 

One other question - since installing the Hide Products / Categories from Groups for SPPC (still working on finishing the install) I've found that adding or editing products through Admin seems to take forever. The changes are being posted to the database quickly - because while Admin is still trying to realize that the change is completed I can see the change on the public side of the site. But Admin takes about 5+ minutes to load the page that lists the products again after clicking on "Update" to edit or add a product.

 

I did email support for my hosting company as well in case it has to do with their end. But figured I'd ask here too as there are only two contrib's I've been working on getting installed since I started noticing this slow down, and this is one of them. My guess is that the slow down and the contrib. aren't related - but since the contrib does make changes within the catalog part of the Admin I figured it best to ask :blush:

~Tracy
 

Link to comment
Share on other sites

Hi Guys,

 

JanZ recommended I post on here as i've got a few questions or require help with the use of QPBPP contribution with Easy Populate contrib. I'm sure its quite easy but unfortunately my PHP and MySQL programming isn't that great and I haven't got a clue where to start.

 

Could someone help me find a solution or an addition that will allow me to use Easy Populate to incorporate QPBPP values for the products.

 

I've already posted a topic but I was recommended to post in here

 

http://www.oscommerce.com/forums/index.php?showtopic=245678

 

Thanks so much to anyone who can help me :)

 

Anyone any ideas please?

Link to comment
Share on other sites

One other question - since installing the Hide Products / Categories from Groups for SPPC (still working on finishing the install) I've found that adding or editing products through Admin seems to take forever. The changes are being posted to the database quickly - because while Admin is still trying to realize that the change is completed I can see the change on the public side of the site. But Admin takes about 5+ minutes to load the page that lists the products again after clicking on "Update" to edit or add a product.

 

I did email support for my hosting company as well in case it has to do with their end. But figured I'd ask here too as there are only two contrib's I've been working on getting installed since I started noticing this slow down, and this is one of them. My guess is that the slow down and the contrib. aren't related - but since the contrib does make changes within the catalog part of the Admin I figured it best to ask :blush:

 

I can't say for sure, but I installed Hide Products / Categories from Groups for SPPC (and Price Breaks) and haven't had any issues with slow time.

 

Thanks,

Kristine

Kristine

Link to comment
Share on other sites

I can't say for sure, but I installed Hide Products / Categories from Groups for SPPC (and Price Breaks) and haven't had any issues with slow time.

 

Thanks,

Kristine

 

Thank you Kristine. I am just at a loss here. I can have 3 different browsers running at the same time - make a change to a product or add a product in each browser - and by the time I'm done with the third browser I'm still waiting for the first one to re-load the category I am in - but I can see all of the changes on the public side or by opening another browser window and looking at the category?? It seems to me that something within the admins categories.php page is causing it to take a long time to load :huh: I don't know what else would cause this. I have cleared my browsers cache, temporary files, etc... for all 3 browsers. I have the same problem in each of the 3 browsers so it isn't browser specific. Hopefully the host company will get back with me soon and let me know if it could be something on their end but since the changes to the database happen quickly I'm not sure if they are :blink:

~Tracy
 

Link to comment
Share on other sites

Thank you Kristine. I am just at a loss here. I can have 3 different browsers running at the same time - make a change to a product or add a product in each browser - and by the time I'm done with the third browser I'm still waiting for the first one to re-load the category I am in - but I can see all of the changes on the public side or by opening another browser window and looking at the category?? It seems to me that something within the admins categories.php page is causing it to take a long time to load :huh: I don't know what else would cause this. I have cleared my browsers cache, temporary files, etc... for all 3 browsers. I have the same problem in each of the 3 browsers so it isn't browser specific. Hopefully the host company will get back with me soon and let me know if it could be something on their end but since the changes to the database happen quickly I'm not sure if they are :blink:

 

Well - I heard back from the hosting company, and the servers load for both the site and the database servers are all in normal ranges. They said I should "Optimize my Database Tables" to see if that helps any. Does anyone here know what this means? :blush:

~Tracy
 

Link to comment
Share on other sites

Well - I heard back from the hosting company, and the servers load for both the site and the database servers are all in normal ranges. They said I should "Optimize my Database Tables" to see if that helps any. Does anyone here know what this means? :blush:

I am using a older SPPC

But the only option i need to add is that my company is located in NY and when NY wholesale account sing in they see tax. Is there anyway not to add tax.

Link to comment
Share on other sites

I am using a older SPPC

But the only option i need to add is that my company is located in NY and when NY wholesale account sing in they see tax. Is there anyway not to add tax.

 

I believe if you also run Hide Products and Categories from customer groups for SPPC you could setup products that are only shown to your wholesalers and then you can choose "no tax" for those products when you set them up.

 

There may be an easier way - but that is my first thought :blush:

~Tracy
 

Link to comment
Share on other sites

I think I may have found the culprit with the product_info. Remember a while ago I learned that product_info wasn't actually what was showing my products and that it was actually master_products and master_listing that were performing this function?

 

After much searching and much testing I am still at a total loss on how to get the Hide Products feature working with Master Products :(

 

There are two main queries for the master_listing.php page (found in the master_products.php page)

They are:

$master_query = tep_db_query("select products_master from " . TABLE_PRODUCTS . " where products_master LIKE '%" . $HTTP_GET_VARS['products_id'] . "%'");

and

$master_sql = "select  " . $select_column_list . " p.products_id,  p.manufacturers_id, p.products_tax_class_id, NULL as specials_new_products_price, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id where p.products_id = pd.products_id and p.products_master = '" . $thisquery['products_master'] . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

 

The master_listing.php entire page code is posted a page or two back on this board. I am pretty sure I will have to add this blurb to the master_listing.php page somewhere:

(query name edited already as I've been working on this)

// BOF SPPC Hide products and categories from groups
$master_sql .= " and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 ";
$master_sql .= " and find_in_set('" . $customer_group_id . "', c.categories_hide_from_groups) = 0 ";
// EOF SPPC Hide products and categories from groups

 

But adding that by itself doesn't do me any good so I'm guessing there are other things I need to change - but I'm not having any luck finding them. I try searching the install text for things similar to the code I think might need editing and I'm not having any luck finding similar bits of code to work with.

 

Does anybody out there have SPPC, Master Products and Hide Products and Categories from Customer Groups for SPPC all working together?

~Tracy
 

Link to comment
Share on other sites

I am using a older SPPC

But the only option i need to add is that my company is located in NY and when NY wholesale account sing in they see tax. Is there anyway not to add tax.

 

You may want to try & update your SPPC. I installed mine less than a year ago & you have the option to set a customer group as tax exempt or not tax exempt.

 

Thanks,

Kristine

Kristine

Link to comment
Share on other sites

I'm having a weird problem since trying to get hide products and categories from customer groups for SPPC up and running. If I am logged in as a Retail customer, I can go through the checkout process just fine.

 

If, however; I am logged in as a Wholesale customer - I can't get past the Shopping Cart page. It doesn't matter which "Checkout" link I use - all it does is re-load the shopping_cart.php page :huh:

 

Any thoughts?

 

Thank you,

~Tracy
 

Link to comment
Share on other sites

Join the conversation

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

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...