Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

i have a problem where if i edit the customers info the customergroup always goes back to retail. so basically i want the dropdown to already select the current setting not just select retail everytime so if i edit a customer of a diff group i have to remeber to put them back in the right group everytime.
And that is exactly what a correctly installed version of SPPC will do. Why don't you try the file that was included in the package? The same is true for your other "problem".

Share this post


Link to post
Share on other sites
i got my tax_id field moved from the address_book table to customers table now... now can you tell me what code to add to make the tax_id show up on all the orders that each wholesale customer submits??
Akin to adding the customer group name to the order (add entry_company_tax_id to the $order_query and echo it on the appropriate place):

catalog/admin/includes/classes/order.php (optional but needed if you add showing customers group name in the order, see next change)

Line 3

**AFTER**

 $Id: order.php,v 1.7 2003/06/20 16:23:08 hpdl Exp $

**ADD** 

 adapted for Separate Pricing Per Customer 2006/04/13

Line 28

**REPLACE**

  $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

**WITH**

  // BOF add SPPC customers_group_name to the info
  $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, o.customers_telephone, o.customers_email_address, customers_address_format_id, customers_group_name, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " o left join " . TABLE_CUSTOMERS . " using(customers_id) left join " . TABLE_CUSTOMERS_GROUPS . " using(customers_group_id) where orders_id = '" . (int)$order_id . "'");
  // EOF add SPPC customer_group_name to the info

Line 58

**AFTER**

						  'format_id' => $order['customers_address_format_id'],

**ADD**

						  // BOF SPPC
						  'customers_group_name' => $order['customers_group_name'],
						  // EOF SPPC

-------------------------------------------------------------------------------------------------------

catalog/admin/orders.php (optional)

**AFTER**
 $Id: orders.php,v 1.112 2003/06/29 22:50:52 hpdl Exp $

**ADD**
 adapted for Separate Pricing Per Customer v4 2005/12/10

Lines 151-153 (you should have added the optional change of admin/includes/classes/order.php above)

**AFTER**

			<td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
			<td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
		  </tr>

**ADD**

	  <!-- // BOF Separate Pricing Per Customer -->
		  <tr>
			<td class="main"><b><?php echo TABLE_HEADING_CUSTOMERS_GROUPS .":"; ?></b></td>
			<td class="main"><?php echo $order->customer['customers_group_name']; ?></td>
		  </tr>
	 <!-- // EOF Separate Pricing Per Customer -->

You probably will have to add it as customers.entry_company_tax_id to the $order_query above.

Share this post


Link to post
Share on other sites
does anyone know how can i keep them from adding certain items to their cart, but still let them see the items and info. (kinda like a gallery).
Look at the Hide Price if $0 contribution and Hide Price if $0 for "Quantity Price Breaks for SPPC 4.1.1" contribution or search this topic (also). It has been discussed and I think a bit extended to prevent people from manually changing the url to add such a zero priced item to their cart (for a zero price :) )

Share this post


Link to post
Share on other sites

Alright, I must be a total dunderhead. I've installed this mod and everything on the board seems to be working just fine.

I spent an hour going through the entire admin section of my catalog site and I can't seem to find any damn way to add more customer groups. Is there a way to do it through the web interface, or do you have to define new groups directly through MySQL?

I read through the first 3 pages of this thread intending to find my answer, but then realized that it's 137 pages long.

So what's the scoop?

 

Thanks,

David

Share this post


Link to post
Share on other sites
I can't seem to find any damn way to add more customer groups. Is there a way to do it through the web interface, or do you have to define new groups directly through MySQL?

I read through the first 3 pages of this thread intending to find my answer, but then realized that it's 137 pages long.

So what's the scoop?

You do that on a new page in the admin section, customer_groups.php from the top of my head for which you should have added a link to the "customers" box in the admin.

Share this post


Link to post
Share on other sites
You do that on a new page in the admin section, customer_groups.php from the top of my head for which you should have added a link to the "customers" box in the admin.

Below is that code in my catalog/admin/boxes/customers.php file.

 

<?php
/*
 $Id: customers.php,v 1.16 2003/07/09 01:18:53 hpdl Exp $
 adapted for Separate Pricing Per Customer v3.6 2005/01/28

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- customers //-->
	  <tr>
		<td>
<?php
 $heading = array();
 $contents = array();

 $heading[] = array('text'  => BOX_HEADING_CUSTOMERS,
				 'link'  => tep_href_link(FILENAME_CUSTOMERS, 'selected_box=customers'));
// original code below:
/*  if ($selected_box == 'customers') {
$contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .
							   '<a href="' . tep_href_link(FILENAME_ORDERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_ORDERS . '</a>');
 } */
// BOF Separate Pricing Per Customer
 if ($selected_box == 'customers') {
$contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .
				'<a href="' . tep_href_link(FILENAME_ORDERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_ORDERS . '</a><br>' . 
				'<a href="' . tep_href_link('customers_groups.php', '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_GROUPS . '</a>');
 }
// EOF Separate Pricing Per Customer
 $box = new box;
 echo $box->menuBox($heading, $contents);
?>
		</td>
	  </tr>
<!-- customers_eof //-->

 

When I surf to www.store.com/catalog/admin/customers_groups.php directly it shows up and works fine. But there is no link in my admin sidebar to allow me to select it. Was that supposed to be something I have to code directly? If so, where? I'm not at all familiar with how to make php do it's thing.

 

Thanks,

David

Share this post


Link to post
Share on other sites

I posted this as its own thread out in support, but maybe it should be here instead:

 

I believe I need the Separate Pricing Per Customer contribution for this, but I thought I'd confirm (as the installation is incredibly long!!) before trying. Also, I believe it's not a 100% fit, so I thought I'd see if anyone has any tips.

 

Here's the situation:

We want to set certain people (and only certain people) up as resellers. This should give them two things: a 30% discount for themselves, and the ability to refer people to the site at discounts of 10%. They can give people a PIN that, when they create an account, makes them eligible for this 10% off all purchases in this account. We'd like the resellers to also be able to see, under their own login, a report of all the sales done with their PIN that they hand out.

 

I'm guessing the last part will have to be done by hand, but I'm curious about the first part. I'm not clear yet with SPPC how people get assigned to these groups - it looks like possibly by putting in a tax ID. I guess this is what I'd have to modify so that it not only checked to see if it's there, but if it's a proper PIN in some sort of table. Is there anything in SPPC equivalent to this, or has anyone done anything similar?

 

Thanks for any advice/suggestions you may have to offer!

Share this post


Link to post
Share on other sites
Akin to adding the customer group name to the order (add entry_company_tax_id to the $order_query and echo it on the appropriate place):

catalog/admin/includes/classes/order.php (optional but needed if you add showing customers group name in the order, see next change)

Line 3

**AFTER**

 $Id: order.php,v 1.7 2003/06/20 16:23:08 hpdl Exp $

**ADD** 

 adapted for Separate Pricing Per Customer 2006/04/13

Line 28

**REPLACE**

  $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

**WITH**

  // BOF add SPPC customers_group_name to the info
  $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, o.customers_telephone, o.customers_email_address, customers_address_format_id, customers_group_name, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " o left join " . TABLE_CUSTOMERS . " using(customers_id) left join " . TABLE_CUSTOMERS_GROUPS . " using(customers_group_id) where orders_id = '" . (int)$order_id . "'");
  // EOF add SPPC customer_group_name to the info

Line 58

**AFTER**

						  'format_id' => $order['customers_address_format_id'],

**ADD**

						  // BOF SPPC
						  'customers_group_name' => $order['customers_group_name'],
						  // EOF SPPC

-------------------------------------------------------------------------------------------------------

catalog/admin/orders.php (optional)

**AFTER**
 $Id: orders.php,v 1.112 2003/06/29 22:50:52 hpdl Exp $

**ADD**
 adapted for Separate Pricing Per Customer v4 2005/12/10

Lines 151-153 (you should have added the optional change of admin/includes/classes/order.php above)

**AFTER**

			<td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
			<td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
		  </tr>

**ADD**

	  <!-- // BOF Separate Pricing Per Customer -->
		  <tr>
			<td class="main"><b><?php echo TABLE_HEADING_CUSTOMERS_GROUPS .":"; ?></b></td>
			<td class="main"><?php echo $order->customer['customers_group_name']; ?></td>
		  </tr>
	 <!-- // EOF Separate Pricing Per Customer -->

You probably will have to add it as customers.entry_company_tax_id to the $order_query above.

i do not understand how to "add customers.entry_company_tax_id" to the $order_query above...

i tried this:

<tr>
<td class="main"><b><?php echo TABLE_HEADING_CUSTOMERS_GROUPS .":"; ?></b></td>
<td class="main"><?php echo $order->customer['customers_group_name']; ?></td>
</tr>
//AJG addition for tax id
<tr>
<td class="main"><b><?php echo TABLE_HEADING_CUSTOMERS .":"; ?></b></td>
<td class="main"><?php echo $order->customer['entry_company_tax_id']; ?></td>
</tr>
//end AJG addition for tax id

am i even close to being on the right track?

 

 

wait... i think i got it...

Edited by herot

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Share this post


Link to post
Share on other sites
am i even close to being on the right track?

 

 

wait... i think i got it...

 

This post has been edited by herot: Today, 10:14 AM

 

nope i do not have it...

Edited by herot

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Share this post


Link to post
Share on other sites

Hello

Advanced search works ok but when order by price i get this error at advanced_search_result.php.

 

1109 - Unknown table 'p2pef' in where clause

 

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id), products_description pd left join specials_retail_prices s on p.products_id = s.products_id , categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '3' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%123456%' or p.products_model like '%123456%' or m.manufacturers_name like '%123456%' or p2pef.products_extra_fields_value like '%123456%' or pd.products_description like '%123456%') )

 

[TEP STOP]

These are the contributions I've installed

Separate Price Per Customer v4.1.1 Spanish

Extra Fields v2.0j

 

I look for similar questions but i can?t found the solution.

 

<?php
/*
 $Id: advanced_search_result.php,v 1.72 2003/06/23 06:50:11 project3000 Exp $
 adapted for Separate Pricing Per Customer 2005/02/06

 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_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH);

 $error = false;

 if ( (isset($HTTP_GET_VARS['keywords']) && empty($HTTP_GET_VARS['keywords'])) &&
   (isset($HTTP_GET_VARS['dfrom']) && (empty($HTTP_GET_VARS['dfrom']) || ($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING))) &&
   (isset($HTTP_GET_VARS['dto']) && (empty($HTTP_GET_VARS['dto']) || ($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING))) &&
   (isset($HTTP_GET_VARS['pfrom']) && !is_numeric($HTTP_GET_VARS['pfrom'])) &&
   (isset($HTTP_GET_VARS['pto']) && !is_numeric($HTTP_GET_VARS['pto'])) ) {
$error = true;

$messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
 } else {
$dfrom = '';
$dto = '';
$pfrom = '';
$pto = '';
$keywords = '';

if (isset($HTTP_GET_VARS['dfrom'])) {
  $dfrom = (($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dfrom']);
}

if (isset($HTTP_GET_VARS['dto'])) {
  $dto = (($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dto']);
}

if (isset($HTTP_GET_VARS['pfrom'])) {
  $pfrom = $HTTP_GET_VARS['pfrom'];
}

if (isset($HTTP_GET_VARS['pto'])) {
  $pto = $HTTP_GET_VARS['pto'];
}

if (isset($HTTP_GET_VARS['keywords'])) {
  $keywords = $HTTP_GET_VARS['keywords'];
}

$date_check_error = false;
if (tep_not_null($dfrom)) {
  if (!tep_checkdate($dfrom, DOB_FORMAT_STRING, $dfrom_array)) {
	$error = true;
	$date_check_error = true;

	$messageStack->add_session('search', ERROR_INVALID_FROM_DATE);
  }
}

if (tep_not_null($dto)) {
  if (!tep_checkdate($dto, DOB_FORMAT_STRING, $dto_array)) {
	$error = true;
	$date_check_error = true;

	$messageStack->add_session('search', ERROR_INVALID_TO_DATE);
  }
}

if (($date_check_error == false) && tep_not_null($dfrom) && tep_not_null($dto)) {
  if (mktime(0, 0, 0, $dfrom_array[1], $dfrom_array[2], $dfrom_array[0]) > mktime(0, 0, 0, $dto_array[1], $dto_array[2], $dto_array[0])) {
	$error = true;

	$messageStack->add_session('search', ERROR_TO_DATE_LESS_THAN_FROM_DATE);
  }
}

$price_check_error = false;
if (tep_not_null($pfrom)) {
  if (!settype($pfrom, 'double')) {
	$error = true;
	$price_check_error = true;

	$messageStack->add_session('search', ERROR_PRICE_FROM_MUST_BE_NUM);
  }
}

if (tep_not_null($pto)) {
  if (!settype($pto, 'double')) {
	$error = true;
	$price_check_error = true;

	$messageStack->add_session('search', ERROR_PRICE_TO_MUST_BE_NUM);
  }
}

if (($price_check_error == false) && is_float($pfrom) && is_float($pto)) {
  if ($pfrom >= $pto) {
	$error = true;

	$messageStack->add_session('search', ERROR_PRICE_TO_LESS_THAN_PRICE_FROM);
  }
}

if (tep_not_null($keywords)) {
  if (!tep_parse_search_string($keywords, $search_keywords)) {
	$error = true;

	$messageStack->add_session('search', ERROR_INVALID_KEYWORDS);
  }
}
 }

 if (empty($dfrom) && empty($dto) && empty($pfrom) && empty($pto) && empty($keywords)) {
$error = true;

$messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
 }

 if ($error == true) {
tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(), 'NONSSL', true, false));
 }

 $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH));
 $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, tep_get_all_get_params(), 'NONSSL', true, false));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE_2; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_browse.gif', HEADING_TITLE_2, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td>
<?php
// create column list
 $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
				   'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
				   'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
				   'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
				   'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
				   'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
				   'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
				   'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

 asort($define_list);

 $column_list = array();
 reset($define_list);
 while (list($key, $value) = each($define_list)) {
if ($value > 0) $column_list[] = $key;
 }

  // BOF Separate Pricing Per Customer
 if(!tep_session_is_registered('sppc_customer_group_id')) { 
 $customer_group_id = '0';
 } else {
  $customer_group_id = $sppc_customer_group_id;
 }
  // EOF Separate Pricing Per Customer

 $select_column_list = '';

 for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
switch ($column_list[$i]) {
  case 'PRODUCT_LIST_MODEL':
	$select_column_list .= 'p.products_model, ';
	break;
  case 'PRODUCT_LIST_MANUFACTURER':
	$select_column_list .= 'm.manufacturers_name, ';
	break;
  case 'PRODUCT_LIST_QUANTITY':
	$select_column_list .= 'p.products_quantity, ';
	break;
  case 'PRODUCT_LIST_IMAGE':
	$select_column_list .= 'p.products_image, ';
	break;
  case 'PRODUCT_LIST_WEIGHT':
	$select_column_list .= 'p.products_weight, ';
	break;
}
 }

  // BOF Separate Pricing Per Customer
  $status_tmp_product_prices_table = false;
  $status_need_to_get_prices = false;
  // find out if sorting by price has been requested
  if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) ){
$_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
  $status_need_to_get_prices = true;
  }
  }

  if ((tep_not_null($pfrom) || tep_not_null($pto) || $status_need_to_get_prices == true) && $customer_group_id != '0') { 
  $product_prices_table = TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id;
  // the table with product prices for a particular customer group is re-built only a number of times per hour
  // (setting in /includes/database_tables.php called MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE, in minutes)
  // to trigger the update the next function is called (new function that should have been
  // added to includes/functions/database.php)
  tep_db_check_age_products_group_prices_cg_table($customer_group_id);
  $status_tmp_product_prices_table = true;   
  } elseif ((tep_not_null($pfrom) || tep_not_null($pto) || $status_need_to_get_prices == true) && $customer_group_id == '0') {
  // to be able to sort on retail prices we *need* to get the special prices instead of leaving them
  // NULL and do product_listing the job of getting the special price
  // first make sure that table exists and needs no updating
  tep_db_check_age_specials_retail_table();
  $status_tmp_special_prices_table = true;
  } // end elseif ((tep_not_null($pfrom) || (tep_not_null($pfrom)) && .... 

  if ($status_tmp_product_prices_table == true) {
  $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, tmp_pp.products_price, p.products_tax_class_id, if(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price ";
  } elseif ($status_tmp_special_prices_table == true) {
 $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, if(s.status, s.specials_new_products_price, p.products_price) as final_price ";	
  } else {
 $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, NULL as specials_new_products_price, NULL as final_price ";	
  }
  // next line original select query
  // $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";


 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
$select_str .= ", SUM(tr.tax_rate) as tax_rate ";
 }

  if ($status_tmp_product_prices_table == true) {
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
  } elseif ($status_tmp_special_prices_table == true) {
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id , " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
  } else {// START: Extra Fields Contribution
//  $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
 $from_str = "from (" . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id) left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id=p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
// END: Extra Fields Contribution

  }
 // EOF Separate Pricing Per Customer
 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
if (!tep_session_is_registered('customer_country_id')) {
  $customer_country_id = STORE_COUNTRY;
  $customer_zone_id = STORE_ZONE;
}
$from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";
 }

 $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

 if (isset($HTTP_GET_VARS['categories_id']) && tep_not_null($HTTP_GET_VARS['categories_id'])) {
if (isset($HTTP_GET_VARS['inc_subcat']) && ($HTTP_GET_VARS['inc_subcat'] == '1')) {
  $subcategories_array = array();
  tep_get_subcategories($subcategories_array, $HTTP_GET_VARS['categories_id']);

  $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'";

  for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
	$where_str .= " or p2c.categories_id = '" . (int)$subcategories_array[$i] . "'";
  }

  $where_str .= ")";
} else {
  $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'";
}
 }

 if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
$where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
 }

 if (isset($search_keywords) && (sizeof($search_keywords) > 0)) {
$where_str .= " and (";
for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) {
  switch ($search_keywords[$i]) {
	case '(':
	case ')':
	case 'and':
	case 'or':
	  $where_str .= " " . $search_keywords[$i] . " ";
	  break;
	default:
	  $keyword = tep_db_prepare_input($search_keywords[$i]);// START: Extra Fields Contribution
//		  $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
	  $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%' or p2pef.products_extra_fields_value like '%" . tep_db_input($keyword) . "%'";
// END: Extra Fields Contribution

if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";
	  $where_str .= ')';
	  break;
  }
}
$where_str .= " )";
 }

 if (tep_not_null($dfrom)) {
$where_str .= " and p.products_date_added >= '" . tep_date_raw($dfrom) . "'";
 }

 if (tep_not_null($dto)) {
$where_str .= " and p.products_date_added <= '" . tep_date_raw($dto) . "'";
 }

 if (tep_not_null($pfrom)) {
if ($currencies->is_set($currency)) {
  $rate = $currencies->get_value($currency);

  $pfrom = $pfrom / $rate;
}
 }

 if (tep_not_null($pto)) {
if (isset($rate)) {
  $pto = $pto / $rate;
}
 }
 // BOF Separate Pricing Per Customer
  if ($status_tmp_product_prices_table == true) {
 if (DISPLAY_PRICE_WITH_TAX == 'true') {
if ($pfrom > 0) $where_str .= " and (IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")";
if ($pto > 0) $where_str .= " and (IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")";
 } else {
if ($pfrom > 0) $where_str .= " and (IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) >= " . (double)$pfrom . ")";
if ($pto > 0) $where_str .= " and (IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) <= " . (double)$pto . ")";
 }
  } else { // $status_tmp_product_prices_table is not true: uses p.products_price instead of cg_products_price
   // because in the where clause for the case $status_tmp_special_prices is true, the table 
   // specials_retail_prices is abbreviated with "s" also we can use the same code for "true" and for "false"
	 if (DISPLAY_PRICE_WITH_TAX == 'true') {
if ($pfrom > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")";
if ($pto > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")";
 } else {
if ($pfrom > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) >= " . (double)$pfrom . ")";
if ($pto > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) <= " . (double)$pto . ")";
  }
  } 
// EOF Separate Pricing Per Customer

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
$where_str .= " group by p.products_id, tr.tax_priority";
 }


 if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
  if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
	$HTTP_GET_VARS['sort'] = $i+1 . 'a';
	$order_str = ' order by pd.products_name';
	break;
  }
}
 } else {
$sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
$sort_order = substr($HTTP_GET_VARS['sort'], 1);
$order_str = ' order by ';
switch ($column_list[$sort_col-1]) {
  case 'PRODUCT_LIST_MODEL':
	$order_str .= "p.products_model " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
	break;
  case 'PRODUCT_LIST_NAME':
	$order_str .= "pd.products_name " . ($sort_order == 'd' ? "desc" : "");
	break;
  case 'PRODUCT_LIST_MANUFACTURER':
	$order_str .= "m.manufacturers_name " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
	break;
  case 'PRODUCT_LIST_QUANTITY':
	$order_str .= "p.products_quantity " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
	break;
  case 'PRODUCT_LIST_IMAGE':
	$order_str .= "pd.products_name";
	break;
  case 'PRODUCT_LIST_WEIGHT':
	$order_str .= "p.products_weight " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
	break;
  case 'PRODUCT_LIST_PRICE':
	$order_str .= "final_price " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
	break;
}
 }

 $listing_sql = $select_str . $from_str . $where_str . $order_str;

 require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>
	</td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(array('sort', 'page')), 'NONSSL', true, false) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
  </tr>
</table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Thanks in advance for your help.

Share this post


Link to post
Share on other sites
p2pef.products_extra_fields_value like '%" . tep_db_input($keyword) . "%'";

// END: Extra Fields Contribution

Search for this string in your file and check your Extra Fields Contribution install. There must be something wrong

Share this post


Link to post
Share on other sites
Hello

Advanced search works ok but when order by price i get this error at advanced_search_result.php.

 

1109 - Unknown table 'p2pef' in where clause

 

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id), products_description pd left join specials_retail_prices s on p.products_id = s.products_id , categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '3' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%123456%' or p.products_model like '%123456%' or m.manufacturers_name like '%123456%' or p2pef.products_extra_fields_value like '%123456%' or pd.products_description like '%123456%') )

 

[TEP STOP]

These are the contributions I've installed

Separate Price Per Customer v4.1.1 Spanish

Extra Fields v2.0j

 

I just noticed I have this error also on advanced_search_result.php when sorting by price. I'll review the code again and let you know if I fix it.


----------------------------------------------------

Share this post


Link to post
Share on other sites
Search for this string in your file and check your Extra Fields Contribution install. There must be something wrong

 

Well, I've tried lots of different things, but since I am not a php programmer, I'm a bit stumped. I think the problem with Extra Fields and SPPC on advanced_search_result is somewhere here:

 

if ($status_tmp_product_prices_table == true) {
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
  } elseif ($status_tmp_special_prices_table == true) {
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id , " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
  } else {
 // START: Extra Fields Contribution
//  $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
 $from_str = "from (" . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id) left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id=p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
// END: Extra Fields Contribution

 

Extra fields makes the change to the $from_str on the default osC advanced_search page. SPPC adds 2 additional $from_str lines based on if/else. I would guess that the 2 additional SPPC $from_str statements need to be modified also but not sure how. The extra fields syntax is different from the original osC and SPPC syntax, and when I do a simple copy/paste of the "Table_Products_to_Products_Extra_Fields. . ." part, I get more syntax errors. . .

Edited by Vines

----------------------------------------------------

Share this post


Link to post
Share on other sites
if ($status_tmp_product_prices_table == true) {
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
  } elseif ($status_tmp_special_prices_table == true) {
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id , " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
  } else {
 // START: Extra Fields Contribution
//  $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
 $from_str = "from (" . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id) left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id=p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
// END: Extra Fields Contribution

Obviously your select does not include the table TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS in that case:
select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id), products_description pd left join specials_retail_prices s on p.products_id = s.products_id , categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '3' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%123456%' or p.products_model like '%123456%' or m.manufacturers_name like '%123456%' or p2pef.products_extra_fields_value like '%123456%' or pd.products_description like '%123456%') )
Try to add it to the other selects as well:
if ($status_tmp_product_prices_table == true) {
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id left join " . TABLE_MANUFACTURERS . " m  on m.manufacturers_id=p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
  } elseif ($status_tmp_special_prices_table == true) {
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id left join " . TABLE_MANUFACTURERS . " m  on m.manufacturers_id=p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id , " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
  } else {
 // START: Extra Fields Contribution
//  $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
 $from_str = "from (" . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id) left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id=p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
// END: Extra Fields Contribution

Edited by texmaxx

Share this post


Link to post
Share on other sites
Obviously your select does not include the table TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS in that case:Try to add it to the other selects as well:

 

Texmaxx,

 

THANK YOU! Works like a charm. . I see the changes that you made to make it work. Definitely appreciate the fast assistance. I guess I'll be taking a php class sometime :-)


----------------------------------------------------

Share this post


Link to post
Share on other sites

I posted this in the EZier New Fields contribution support topic but thought I would post it here also as it relates to getting EZier New Fields to work with SPPC.

 

I've managed to get EZier to work with SPPC well, except that EZier no longer displays on the advanced search or on the product listing pages on index.php. I've scoured the code diffs for both of these and can't figure out why the data does not show up for Retail Price and Savings.

 

If anyone else is having this problem with integrating EZier New Fields and SPPC and getting the retail price and savings to show up in the product listing, I figured out the problem. Here's the solution:

 

Once SPPC is installed and you go to install EZier following the instructions, you get to the modifications for catalog/includes/modules/product_listing.php:

 

FIND:

 

case 'PRODUCT_LIST_MANUFACTURER':

$lc_align = '';

$lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';

break;

case 'PRODUCT_LIST_PRICE':

$lc_align = 'right';

if (tep_not_null($listing['specials_new_products_price'])) {

$lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';

} else {

$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

}

break;

case 'PRODUCT_LIST_QUANTITY':

$lc_align = 'right';

$lc_text = ' ' . $listing['products_quantity'] . ' ';

break;

 

REPLACE WITH:

 

case 'PRODUCT_LIST_MANUFACTURER':

$lc_align = '';

$lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';

break;

// EZier New Fields added

case 'PRODUCT_LIST_RETAIL_PRICE':

$lc_align = 'right';

if ((tep_not_null($listing['products_retail_price'])) && ($listing['products_retail_price']) > 0) {

$lc_text = '<font color="#55508a">' . $currencies->display_price($listing['products_retail_price'], tep_get_tax_rate($listing['products_tax_class_id']));

} else {

$lc_text = ' ';

}

break;

// End EZier New Fields added

case 'PRODUCT_LIST_PRICE':

$lc_align = 'right';

if (tep_not_null($listing['specials_new_products_price'])) {

$lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';

} else {

$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

}

break;

// EZier New Fields added

 

case 'PRODUCT_LIST_SAVE':

 

$lc_align = 'right';

 

if (tep_not_null($listing['specials_new_products_price'])) {

 

$lc_save = round(100 - (( $listing['specials_new_products_price'] / $listing['products_retail_price'] ) * 100 ));

 

$lc_text = '<font color="red"> ' . $lc_save . '% </font>';

 

} else {

 

if ((tep_not_null($listing['products_retail_price'])) && ($listing['products_retail_price']) > 0) {

 

$lc_save = round(100 - (( $listing['products_price'] / $listing['products_retail_price'] ) * 100 ));

 

$lc_text = '<font color="red"> ' . $lc_save . '% </font>';

 

} else {

 

$lc_text = ' ';

 

}}

 

break;

 

// End EZier New Fields added

case 'PRODUCT_LIST_QUANTITY':

$lc_align = 'right';

$lc_text = ' ' . $listing['products_quantity'] . ' ';

break;

 

You will note that a compare to the SPPC version of the section above shows that all sections of code beginning "($listing('manufacturers_AND_SO_ON" in the EZier instructions has been changed to "($listing[x]('manufacturers_AND_SO_ON" in the SPPC code.

 

To make the EZier fields (Retail Price and Savings) show up on the product listing, simply insert the missing "[x]" after $listing and before the "(" in all instances of the EZier code.

 

This worked for me.

 

Or, if you don't care to look at the fix, you can just copy paste this code instead of the code stated in the EZier instructions:

 

case 'PRODUCT_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;
	  // EZier New Fields added
				case 'PRODUCT_LIST_RETAIL_PRICE':
						 $lc_align = 'right';
						 if ((tep_not_null($listing[$x]['products_retail_price'])) && ($listing[$x]['products_retail_price']) > 0) {
						 $lc_text = '<font color="#55508a">' . $currencies->display_price($listing[$x]['products_retail_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])); 
						 } else {
						 $lc_text = ' ';
						 }
						 break;
				// End EZier New Fields added
				case 'PRODUCT_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;
	  // EZier New Fields added
				case 'PRODUCT_LIST_SAVE':
						 $lc_align = 'right';
						 if (tep_not_null($listing[$x]['specials_new_products_price'])) {
						 $lc_save = round(100 - (( $listing[$x]['specials_new_products_price'] / $listing[$x]['products_retail_price'] ) * 100 ));
						 $lc_text = '<font color="red"> ' . $lc_save . '% </font>';
						 } else {
						 if ((tep_not_null($listing[$x]['products_retail_price'])) && ($listing[$x]['products_retail_price']) > 0) {
						 $lc_save = round(100 - (( $listing[$x]['products_price'] / $listing[$x]['products_retail_price'] ) * 100 ));
						 $lc_text = '<font color="red"> ' . $lc_save . '% </font>';
						 } else {
						 $lc_text = ' ';
						 }}
						 break;
				// End EZier New Fields added
				case 'PRODUCT_LIST_QUANTITY':
		$lc_align = 'right';
		$lc_text = ' ' . $listing[$x]['products_quantity'] . ' ';
		break;


----------------------------------------------------

Share this post


Link to post
Share on other sites

Is it possible to set up a blanket price for certain customers that is a percentage off? Currently we have everything set up but would like an easy way to update our 2000 products for the two different types of customers that we have as well as when we use easypopulate to import new customers it seems like we will have to edit the script to also create these new rows in the new pricing table?

Share this post


Link to post
Share on other sites

Here is another question related to integrating Ezier New Fields with Quantity Price Break for SPPC. I've spent the last couple of days putting these three together and it's pretty much working perfectly as far as I can tell, with one exception.

 

I previously had SPPC and Ezier New Fields working perfectly together. Then, I decided I need Quantity Price Break, so I backed up all my SPPC with Ezier files, then shifted to SPPC with Quantity Price Break. I test QPB for SPPC and this was working fine. So, then I went back into these files and re-added the Ezier New Fields code.

 

I'm actually pretty impressed that I was able to do this and get it working 99%, given my lack of PHP expertise. There is only one problem now with the integration. The EZier fields on the product_info.php page do not read properly for special price customer groups anymore. The "retail price" and "your price" and thus "savings" remain at the default values regardless of whether the customer is in a different group. This was working fine before I tried to include QPB. Fortunately, all of the cart functionality and the QPB price break prices in the heading are the right prices for each customer group, it's just the part of the product listing that is generated by ezier_new_fields.php that are messed up.

 

Here's the code. I'm hoping a php guru or someone who has put these three together before can easily spot the problem. It was such a complicated thing to put these 3 together, I'm sure that it's something simple. I just can't see it.

 

Thoughts, comments, questions? Thanks!

 

<?php
/*
 $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $
 adapted for Separate Pricing Per Customer v4 and Price Break 1.11.3 2005/03/12

 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_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);

 // BOF Separate Price per Customer
 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
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
// BOF: Header Tag Controller v2.5.7
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
 <title><?php echo TITLE; ?></title>
<?php
}
// EOF: Header Tag Controller v2.5.7
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="3">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
 if ($product_check['total'] < 1) {
?>
  <tr>
	<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="3" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="3">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
 } else {
// BOF Separate Price per Customer, Price Break 1.11.3 mod
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_pdfupload, pd.products_url, p.products_retail_price, p.products_price, NULL as specials_new_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_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 = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);
// EOF Separate Price per Customer, Price Break mod
tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

// BOF Separate Pricing per Customer, Price Break 1.11.3 mod
  $pf->loadProductSppc((int)$HTTP_GET_VARS['products_id'], (int)$languages_id, $product_info);
  $products_price = $pf->getPriceString();
// EOF Separate Pricing per Customer, Price Break 1.11.3 mod

if (tep_not_null($product_info['products_model'])) {
  $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
} else {
  $products_name = $product_info['products_name'];
}
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
	   <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
		<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
				</tr>
				</table></td></tr>
				<tr>
				<td>
						<table border="0">
						   <tr>
							 		 <td class="main" align="center" valign="top">

					<?php
if (tep_not_null($product_info['products_image'])) {
?>

<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>
</td>

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

<?php

		// START: Extra Fields Contribution v2.0i  with fix
 list($products_id_clean) = split('{', $product_info['products_id']);
 $extra_fields_query = tep_db_query("
				  SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value ,pef.products_extra_fields_status as status
				  FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
		 LEFT JOIN  ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
		ON ptf.products_extra_fields_id=pef.products_extra_fields_id
		WHERE ptf.products_id=".$products_id_clean." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
		ORDER BY products_extra_fields_order");

 while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
	if (! $extra_fields['status'])  // show only enabled extra field
	   continue;
	echo '

  <b><font color="#922248">'.$extra_fields['name'].': </b></font>';
	echo '<font color="#333333">' .$extra_fields['value'].'<BR></font> '; 	
 }
// END: Extra Fields Contribution

?>
</td>
<td class="main" valign="top" align="center">

					<?php
					}
					include(DIR_WS_MODULES . 'ezier_new_fields.php');
					?>
						<br><br>
				  <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>
				<br><br><br>

<?php
if (tep_not_null($product_info['products_pdfupload'])) {
?>
	  <table border="1" cellspacing="0" cellpadding="5" align="right">
		<tr>
		  <td align="center">
						<!-- Add Video Extract -->
						  <?php
 if ($product_info['products_pdfupload'] == '') {
 echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_pdfupload']) . '">' . TEXT_CLICK_TO_PDFUPLOAD2 . '</a>';
 } else {
 echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_pdfupload']) . '">' . TEXT_CLICK_TO_PDFUPLOAD . '</a>';
 }
 ?>
<!-- End Video Extract -->

						</br>

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

	  <?php
}
?>






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

  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main">
<hr>						




	  <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
$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 ($products_attributes['total'] > 0) {
?>
	  <table border="0" cellspacing="0" cellpadding="2">
		<tr>
		  <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
		</tr>
<?php
  $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 . "'");
	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 ($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 (isset($cart->contents[$HTTP_GET_VARS['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;
	}
?>
		<tr>
		  <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
		  <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
		</tr>
<?php
  }
?>
	  </table>
<?php
}
?>
	</td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
?>
  <tr>
	<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
}

if (tep_not_null($product_info['products_url'])) {
?>
  <tr>
	<td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
}

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
  <tr>
	<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
  </tr>
<?php
} else {
?>
  <tr>
	<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
  </tr>
<?php
}
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
<!--  BOF price-break-1.11.3  <td class="main" align="right"><?php // echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); 
?></td> -->
			 <td class="main" align="right">
			  <table border="0" align="right">
				<tr><td align="center">
				  <?php echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"'); ?>
				</td></tr>
				<tr><td align="center">
				  <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>
				</td></tr>
			  </table>
			</td> <!-- EOF price-break-1.11.3 -->
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td>
<?php
if ((USE_CACHE == 'true') && empty($SID)) {
  echo tep_cache_also_purchased(3600);
} else {
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
 }
?>
	</td>
  </tr>
</table></form></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


----------------------------------------------------

Share this post


Link to post
Share on other sites

I'm back at the shipping thing again. Through the forums here, I found a fast way to set up the tax/shipping zones at http://www.oscommerce.com/community/contributions,3404. Now I have three zones: lower US, outlying US, and Canada, each with the full complement of allowed states/provinces. Later I'll add "rest of the world".

 

step 2, I copied the shipping module table.php (both parts) and adjusted for the two new zones. I've done this before for my wholesale customers who get different shipping rates and it works great. Now I have lower48table.php, outlyingtable.php, and canadatable.php. Through admin, install each, set each shipping table to its correct zone and filled in the table rate. all good, so far.

 

But of course - - - :(

 

When I set a Canadian customer to use only canadatable.php in the admin, it works perfect. I have SPPC 4.0. But osc doesn't pick it up on a default setting. There's just no shipping option at all - no 'free shipping' notice, nothing.

 

the only one that appears to work as expected is lowertable. When I pretend to be someone from Alaska or Canada, no shipping option shows at all. All the shipping table files are identical except for the one word that tells them apart (throughout). Any clues where to start trouble shooting? I've already read through 6 months of forums posts on shipping/zones/table etc. Any reason for the SPPC section to skip looking at the state/zone correctly?

 

TIA as always -


Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA

Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad)

Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO

Share this post


Link to post
Share on other sites
When I set a Canadian customer to use only canadatable.php in the admin, it works perfect. I have SPPC 4.0. But osc doesn't pick it up on a default setting. There's just no shipping option at all - no 'free shipping' notice, nothing.

 

the only one that appears to work as expected is lowertable. When I pretend to be someone from Alaska or Canada, no shipping option shows at all. All the shipping table files are identical except for the one word that tells them apart (throughout). Any clues where to start trouble shooting? I've already read through 6 months of forums posts on shipping/zones/table etc. Any reason for the SPPC section to skip looking at the state/zone correctly?

You are sure you went to the "Customers Groups" page and enabled the new shipping options for the group(s)?

 

SPPC does not look at zones at all, it interferes very early on, when the code is looking for the installed shipping options. Then the "weeding out" is done for the customer groups. The shipping options themselves determine whether they are enabled or not based on a query for the zones. This is for example the code in flat.php:

	  $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);

  if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
	$check_flag = false;
	$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
	while ($check = tep_db_fetch_array($check_query)) {
	  if ($check['zone_id'] < 1) {
		$check_flag = true;
		break;
	  } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
		$check_flag = true;
		break;
	  }
	}

	if ($check_flag == false) {
	  $this->enabled = false;
	}
  }

So there is no need to enable the canadatable.php only for Canadian customers if that is already dealt with in admin using the zones.

Share this post


Link to post
Share on other sites
Is it possible to set up a blanket price for certain customers that is a percentage off? Currently we have everything set up but would like an easy way to update our 2000 products for the two different types of customers that we have as well as when we use easypopulate to import new customers it seems like we will have to edit the script to also create these new rows in the new pricing table?
You can use some simple sql commands to insert new prices like that. See this post for example.

Share this post


Link to post
Share on other sites
Below is that code in my catalog/admin/boxes/customers.php file.
Looks fine to me. If you added
define('BOX_CUSTOMERS_GROUPS', 'Customers Groups');

to admin/includes/languages/english.php it should show up as a link named Customers Groups in the admin once you clicked on the "Customers" links in the admin/index.php page or in the side bar.

Share this post


Link to post
Share on other sites
We want to set certain people (and only certain people) up as resellers. This should give them two things: a 30% discount for themselves, and the ability to refer people to the site at discounts of 10%. They can give people a PIN that, when they create an account, makes them eligible for this 10% off all purchases in this account. We'd like the resellers to also be able to see, under their own login, a report of all the sales done with their PIN that they hand out.

 

I'm guessing the last part will have to be done by hand, but I'm curious about the first part. I'm not clear yet with SPPC how people get assigned to these groups - it looks like possibly by putting in a tax ID. I guess this is what I'd have to modify so that it not only checked to see if it's there, but if it's a proper PIN in some sort of table. Is there anything in SPPC equivalent to this, or has anyone done anything similar?

With some small changes to create_account.php you can indeed check for the correct PIN (could be hard code in that file or read from a text file or indeed from a table) and add the new customer group to the sql array that is inserted. Normally SPPC relies on the default '0' to be entered.

 

It has been discussed with sample code not so long ago in this thread how to put new customers groups based on a choice when creating an account. The create_account.php page from the current SPPC version(s) does not recognize the new customer group immediatly when creating an account. That will be mentioned there also.

Share this post


Link to post
Share on other sites

would there be a way to make it so that retail customers do not have to create an account in order to purchase...?

Edited by herot

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

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

×