Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

SPPC doesn't seem to be working correctly with the attributes in my store. It correctly configures the discount for the base price and then uses that discount for all the attribute prices, instead of calculating the percentage.

 

So for a 10% discount I get

 

small: retail price - $10.00, discount price: $9.00

med: retail price $15.00, discount price: $14.00

large: retail price $20.00, discount price: $19.00

 

What I should get it is -

small: retail price - $10.00, discount price: $9.00

med: retail price $15.00, discount price: $13.50

large: retail price $20.00, discount price: $18.00

 

I am using Quick Group Discount Module For SPPC and Quick Updates for SPPC 1.4, but neither will apply to attributes. I can manually do each one in Product Attributes, but would like to apply the discount to all attributes of all products.

 

I also have actually attribute prices installed... so I'm not sure where to look to solve this problem. I've been reading the forums all morning but can't put together a solution. It seems I just need SPPC to calculate percentage discount price after attribute price is added, instead of before, but I'm not that handy with php code.

 

Thanks in advance.

Share this post


Link to post
Share on other sites

I'll ask this in a different way.. is there a way to apply quick price updates to attributes and have the percentage price come out correct? I have 200 pages of attributes and it will be a nightmare to edit each group for each attribute through the product attributes panel...

I am hoping someone will respond...

Share this post


Link to post
Share on other sites
I'll ask this in a different way.. is there a way to apply quick price updates to attributes and have the percentage price come out correct? I have 200 pages of attributes and it will be a nightmare to edit each group for each attribute through the product attributes panel...

Of course SPPC is not using settings of percentage discounts but as was mentioned several times in this thread you can insert/update prices for groups using those discounts with an sql command.

 

With attributes that might be possible (haven't tried it, might be tricky) but surely you can write a little PHP script that queries the products_attributes table for products_attributes_id, products_id, options_values_price, and price_prefix and then inserts those prices in the correct way using a multiplier (like 0.9 for a 10% discount) on the options_values_price and the different customer groups and insert/updates those values in the table products_attributes_group.

Share this post


Link to post
Share on other sites

With 257 pages and no real search feature to find my problem, I am hoping that someone will help me figure this out. I went through several pages in this forum and can't find the answer. This particular add on, very cool, should have its own forum with categories so we can locate our problem and see where the post is resolved.

 

I uploaded SPPC 4.2.0 and 4.2.2 and everything seems to be fine except when I created in the shopping cart a new user account this error message came up:

 

1146 - Table 'db280358598.TABLE_CUSTOMERS_GROUPS' doesn't exist

 

select c.customers_group_id, cg.customers_group_show_tax, cg.customers_group_tax_exempt, cg.group_specific_taxes_exempt from customers c left join TABLE_CUSTOMERS_GROUPS cg using(customers_group_id) where c.customers_id = '5'

 

[TEP STOP]

 

I have installed both sppc_v421_install.sql and sppc_v42_install.sql.

 

In my SQL admin I don't see any of the above items. How I do I fix this?

 

I am using osCommerce Online Merchant v2.2 RC2a

Share this post


Link to post
Share on other sites

Thanks for the reply! I have the percentage discount working but not for the attributes... Your add-on for quick updates allows calculation by percentage so not sure where the need for a separate sql command would come in, for the base price anyway...

 

Unfortunately I don't have the skills to write such a PHP script, not even close! ... the hints are appreciated but I wouldn't really know where to start. extremely important to resolve.. since my store is already live and my customers are getting incorrect prices for any item with a price different from the base price. In the meantime I am slogging through the attributes table product by product.

 

Just a bit surprised this hasn't come up and been solved previously... was hoping it was! It is getting very difficult to search navigate this forum!

 

 

Of course SPPC is not using settings of percentage discounts but as was mentioned several times in this thread you can insert/update prices for groups using those discounts with an sql command.

 

With attributes that might be possible (haven't tried it, might be tricky) but surely you can write a little PHP script that queries the products_attributes table for products_attributes_id, products_id, options_values_price, and price_prefix and then inserts those prices in the correct way using a multiplier (like 0.9 for a 10% discount) on the options_values_price and the different customer groups and insert/updates those values in the table products_attributes_group.

Share this post


Link to post
Share on other sites
1146 - Table 'db280358598.TABLE_CUSTOMERS_GROUPS' doesn't exist

It looks like you didn't add the define for this table in either the admin/includes/database_tables.php or the equivalent page on the catalog side.

Share this post


Link to post
Share on other sites
It looks like you didn't add the define for this table in either the admin/includes/database_tables.php or the equivalent page on the catalog side.

 

The instructions didn't say anything about this. Is there any details somewhere about this?

Share this post


Link to post
Share on other sites

How can I integrate the special price for a specific customer group into STS??

 

anything like this $Customertype1price$ exists???

Share this post


Link to post
Share on other sites
It looks like you didn't add the define for this table in either the admin/includes/database_tables.php or the equivalent page on the catalog side.

 

Does an earlier version of SPPC have these tables? It is odd to me that the download doesn't have certain tables and doesn't mention anything about this in the instructions.

Share this post


Link to post
Share on other sites

Does SPPC 4.2.2 work with the new osCommerce Online Merchant v3.0 Alpha 5?

 

And one other question, please indulge me:

 

My server is using PHP Version 4.4.9 and osCOM v3.0 requires v5.2.0+ (with MySQLi extension). How does one install PHP 5.2 on the server if it is pre-stalled with my ISP host?

Edited by bradybarrows

Share this post


Link to post
Share on other sites

Hello all! And Thanxs to the author for this great contrib.

 

However, I have been trying to remove the "choice for logging in under any customer group" in login.php.

I need help on how to log customers on under the group i choose for them.

Any suggestions will be greatly appreciated.

Share this post


Link to post
Share on other sites
The instructions didn't say anything about this. Is there any details somewhere about this?

Yes, in the install file (HTML) these are the additional table defines for SPPC in the admin/includes/database_tables.php file:

// BOF Separate Pricing Per Customer
 define('TABLE_PRODUCTS_GROUPS', 'products_groups');
 define('TABLE_CUSTOMERS_GROUPS', 'customers_groups');
 define('TABLE_PRODUCTS_GROUP_PRICES', 'products_group_prices_cg_');
 define('TABLE_PRODUCTS_ATTRIBUTES_GROUPS', 'products_attributes_groups');
// EOF Separate Pricing Per Customer

Share this post


Link to post
Share on other sites
How can I integrate the special price for a specific customer group into STS??

 

anything like this $Customertype1price$ exists???

Not a clue, I'm not familiar with STS but ask TracyS perhaps? I think she used STS and SPPC.

Share this post


Link to post
Share on other sites
However, I have been trying to remove the "choice for logging in under any customer group" in login.php.

I need help on how to log customers on under the group i choose for them.

Only the person who logs in with the email address that is added in a language file (you!) will see that option. No one else, no need to worry about that.

Share this post


Link to post
Share on other sites
Does SPPC 4.2.2 work with the new osCommerce Online Merchant v3.0 Alpha 5?

 

And one other question, please indulge me:

 

My server is using PHP Version 4.4.9 and osCOM v3.0 requires v5.2.0+ (with MySQLi extension). How does one install PHP 5.2 on the server if it is pre-stalled with my ISP host?

No, SPPC 4.2.2 does not work on the v3 version. Totally different animal in very many respects.

I haven't looked at making a version for v3 yet.

There are only three contributons for v3 at the moment (plus some language pack). V3 alpha 5 is very new so if you need a lot of contributions I would suggest to stay with osC 2.2 rc2a for the moment.

Share this post


Link to post
Share on other sites

 

Jan Zonjee,

 

I initially installed Separate Pricing Per Customer v 4.2.2 full with french languages files by leirisset which didn't have on the in the admin/includes/database_tables.php file the following code:

 

// BOF Separate Pricing Per Customer

define('TABLE_PRODUCTS_GROUPS', 'products_groups');

define('TABLE_CUSTOMERS_GROUPS', 'customers_groups');

define('TABLE_PRODUCTS_GROUP_PRICES', 'products_group_prices_cg_');

define('TABLE_PRODUCTS_ATTRIBUTES_GROUPS', 'products_attributes_groups');

// EOF Separate Pricing Per Customer

 

Also, in leirisset's version it didn't have in the catalog/includes/languages/english/login.php file the following code:

 

// BOF Separate Pricing Per Customer

// define the email address that can change customer_group_id on login

define('SPPC_TOGGLE_LOGIN_PASSWORD', 'root@localhost');

// EOF Separate Pricing Per Customer

 

Since you supplied me the code and I then later noticed that you have the following download:

 

Separate Pricing Per Customer (SPPC) Version 4.2.2

 

I decided to delete the entire shopping cart, upload a clean version of the osCommerce Online Merchant v2.2 Release Candidate 2a and also downloaded your version of Separate Pricing Per Customer (SPPC) Version 4.2.2, upload everything, re-installed the mySQL database, and start all over. However, when I log into admin and click on CUSTOMERS I still get this following error message:

 

1146 - Table 'db280358598.TABLE_CUSTOMERS_GROUPS' doesn't exist

 

select count(*) as total from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join TABLE_CUSTOMERS_GROUPS cg on c.customers_group_id = cg.customers_group_id

 

I checked the admin/includes/database_tables.php file and the following code exits:

 

// BOF Separate Pricing Per Customer

define('TABLE_PRODUCTS_GROUPS', 'products_groups');

define('TABLE_CUSTOMERS_GROUPS', 'customers_groups');

define('TABLE_PRODUCTS_GROUP_PRICES', 'products_group_prices_cg_');

define('TABLE_PRODUCTS_ATTRIBUTES_GROUPS', 'products_attributes_groups');

// EOF Separate Pricing Per Customer

 

What am I doing wrong? I am following the instructions and I still get the same error message. Also, if this is any help to you, I get this error message in my store when trying to access a product item:

 

Fatal error: Call to undefined function: tep_db_check_age_specials_retail_table() in /homepages/43/d101564082/htdocs/mountainwinery/store/index.php on line 157

Edited by bradybarrows

Share this post


Link to post
Share on other sites
What am I doing wrong? I am following the instructions and I still get the same error message. Also, if this is any help to you, I get this error message in my store when trying to access a product item:

 

Fatal error: Call to undefined function: tep_db_check_age_specials_retail_table() in /homepages/43/d101564082/htdocs/mountainwinery/store/index.php on line 157

I downloaded the version of leirisset but I can find all these things.

The install instructions are all in HTML. Perhaps there is an error in there (that I would have introduced most likely) that hides code from you in the browser you use but that does not happen in other browsers?

That particular function is supposed to have been added to catalog/includes/functions/database.php. You didn't by accident added it after the php closing tag ( ?> )did you?

Share this post


Link to post
Share on other sites
I downloaded the version of leirisset but I can find all these things.

The install instructions are all in HTML. Perhaps there is an error in there (that I would have introduced most likely) that hides code from you in the browser you use but that does not happen in other browsers?

That particular function is supposed to have been added to catalog/includes/functions/database.php. You didn't by accident added it after the php closing tag ( ?> )did you?

 

I checked catalog/includes/functions/database.php. and everything is before the ?>.

 

I am using MacOS Safari and Firefox and get the same error messages. I have three times uploaded SPPC. The first time with 4.2.0 and it was the best one since I was able to see the different pricing when adding a new product. I guess I will have to go back to 4.2.0. My understanding of the install is to replace the files that come with osCommerce Online Merchant v2.2 Release Candidate 2a with the SPPC files. I haven't gone through every file and checked the changes since I found that the changes have all already been done in the SPPC files. After about six pages, I figured all the files were correct.

 

Does this have something to do with mySQL not getting the tables? What if I uninstall the files using sppc_v421_uninstall.sql and then install again using the sppc_v42_install.sql. I will try it and see what happens.

Share this post


Link to post
Share on other sites
What if I uninstall the files using sppc_v421_uninstall.sql and then install again using the sppc_v42_install.sql. I will try it and see what happens.

 

I did uninstall v421 and uploaded v42 and the error message in the shopping cart I had before:

 

Fatal error: Call to undefined function: tep_db_check_age_specials_retail_table() in /homepages/43/d101564082/htdocs/mountainwinery/store/index.php on line 157

 

the above error message is gone. A little improvement. However, when I go into the admin control panel I still get the same error message when adding a new product or editing an existing product:

 

1146 - Table 'db280358598.TABLE_CUSTOMERS_GROUPS' doesn't exist

 

select customers_group_id, customers_group_name from TABLE_CUSTOMERS_GROUPS where customers_group_id != '0' order by customers_group_id

 

[TEP STOP]

 

Also the fields below Products Price (Gross): in the store/admin/categories.php?cPath=&action=new_product page are missing. The above error message is displayed on the page.

 

Any ideas what I can do to fix this?

Share this post


Link to post
Share on other sites

I decided to upload a completely new osCommerce Online Merchant v2.2 Release Candidate 2a with Separate Pricing Per Customer v4.0 (Complete Revision) by Marvin Miller to see what happens. As you know, this is tedious doing it again. I am either not following the instructions correctly or there is some conflict with my MacOS browsers, because I get shopping cart just fine, but when I log into the admin control panel I get a different error message:

 

1146 - Table 'db281075074.TABLE_ADMINISTRATORS' doesn't exist

 

select id from TABLE_ADMINISTRATORS limit 1

 

[TEP STOP]

 

Can't someone please tell me what I am doing wrong? Why can't I get SPPC to work with OMv2.2?

 

If I check mySQL I don't see any TABLE_ADMINSTRATORS.

 

I have no idea how to correct this error message. I have no idea what 'select id from TABLE_ADMINSTRATORS means. Please, help me figure this out.

Share this post


Link to post
Share on other sites
when I log into the admin control panel I get a different error message:

 

1146 - Table 'db281075074.TABLE_ADMINISTRATORS' doesn't exist

 

select id from TABLE_ADMINISTRATORS limit 1

 

[TEP STOP]

 

Can't someone please tell me what I am doing wrong? Why can't I get SPPC to work with OMv2.2?

 

If I check mySQL I don't see any TABLE_ADMINSTRATORS.

 

I have no idea how to correct this error message. I have no idea what 'select id from TABLE_ADMINSTRATORS means. Please, help me figure this out.

There is no TABLE_ADMININSTRATORS because in the PHP code the define TABLE_ADMINISTRATORS is used which is taken from admin/includes/database_tables.php:

  define('TABLE_ADMINISTRATORS', 'administrators');

So it looks like you are mixing versions of osC which is not really much of a problem if you know what the differences are and what to do about them.

SPPC 4.2.2 does have that define added.

Share this post


Link to post
Share on other sites
There is no TABLE_ADMININSTRATORS because in the PHP code the define TABLE_ADMINISTRATORS is used which is taken from admin/includes/database_tables.php:

  define('TABLE_ADMINISTRATORS', 'administrators');

So it looks like you are mixing versions of osC which is not really much of a problem if you know what the differences are and what to do about them.

SPPC 4.2.2 does have that define added.

 

I've been trying weeks to get this contrib to work but had no luck. I keep getting 'Table Missing' missing errors in Admin despite the database clearly having these. It's so frustrating because it's taken me around 3-5 hours each time to bloody install it and each time I've ended up reverting back to my original setup.

 

Is there any other contributions that do the same as this, except they work?

Share this post


Link to post
Share on other sites
I've been trying weeks to get this contrib to work but had no luck. I keep getting 'Table Missing' missing errors in Admin despite the database clearly having these. It's so frustrating because it's taken me around 3-5 hours each time to bloody install it and each time I've ended up reverting back to my original setup.

 

Is there any other contributions that do the same as this, except they work?

This contribution works fine for a lot of people. If you get an error that a table is missing and the database having it, it might mean that you haven't added the define. But then the table you would be missing would have a name like table_customers_groups or TABLE_CUSTOMERS_GROUPS and not customers_groups.

 

Removing a contribution and then adding it again is crazy. If you have a problem with your car do you take the engine apart completely and then put it together again or do you repair what needs repairing?

Share this post


Link to post
Share on other sites

Hi Jan,

 

You were kind enough to help me setup this code, and I'm hoping you can help me debug and see why my product options aren't showing on my product info page. I have a post here:

http://forums.oscommerce.com/index.php?s=&...t&p=1388396

 

The other page I thought of is the sts_inc/product_info.php page - code below. Any thoughts?

 

<?php
/*
 $Id: product_info.php,v 4.3SP1 2006/11/15 23:55:58 rigadin Exp $
 adapted for Separate Pricing Per Customer v4.1.x, Hide products and categories from groups 2006/05/28

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

 Copyright (c) 2006 osCommerce

 Released under the GNU General Public License
Based on: Simple Template System (STS) - Copyright (c) 2004 Brian Gallagher - brian@diamondsea.com
STS v4.3SP1 by Rigadin (rigadin@osc-help.net)
*/

$products_id=intval($HTTP_GET_VARS['products_id']);
// Create variables for product ID, added in v4.0.6	
//$template_pinfo['productid'] = $products_id; // Deprecated in STS4.3SP1
$template_pinfo['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 Price per Customer
 // 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;
 }

// 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 left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) 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");
   $results = tep_db_fetch_array($master_query);
// EOF Separate Pricing Per Customer, Hide products and categories from groups

// 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_input_field('Qty_ProdId_' . $product_info['products_id'], '', 'size="4"');
 } 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'] . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 ");
$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'] = sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); // Modified in v4.5
 $template_pinfo['productdate'] = tep_date_long($product_info['products_date_available']);
} else {
 $template_pinfo['productdatelabel'] = sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added']) ); // Modified in v4.5
 $template_pinfo['productdate'] = tep_date_long($product_info['products_date_added']); 
}

// Strip out %s values
//$template_pinfo['productdatelabel'] = str_replace('%s.', '', $template['productdatelabel']); // Removed in v4.5
/* Not using Reviews
// 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
?>


~Tracy
 

Share this post


Link to post
Share on other sites

Hi Jan

 

I've had to take over our store from somebody else and dont know much about oscommerse so please excuse my ignorance but how would I see if SPPC is installed or not. For instance on each product I can ad a different price for every customer group, Doest this mean I already have sppc?

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

×