Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

I'm hoping someone can help me see the error of my ways. Let's say that I want to use this contribution but I don't need it to be as locked down as it is. So, I'd like to be able to get to the index page and set the customer_group_id there as the entry to the store. So, I'd be passing the customer_group_id via the URL and setting the session variable on that page to be carried throughout.

 

Isn't it as simple as adding a line to index.php

 

$_SESSION['sppc_customer_group_id'] = $HTTP_GET_VARS['gID'];

 

where the URL is http://www.storeURL.com/index.php?gID=1 for customer group 1

http://www.storeURL.com/index.php?gID=2 for customer group 2

 

Forgive me for my ignorance! Any help is MUCH appreciated!

 

I should have mentioned that I'm using SPPC with the "Hide Products & Categories" contribution so I basically want any group's view of the storefront to be easily accessible and not to require a login (as the SPPC contribution allows for the one designated admin email). Once they reach the point where they register, I'll automatically set a hidden field to specify their group based on the group's pricing that they're viewing.

Edited by nikikelly
Link to comment
Share on other sites

Just wanted to follow up and say I figured it out. I just need to put the following code on the page LEADING INTO the homepage:

	$sppc_customer_group_id = $HTTP_GET_VARS['gID'];
tep_session_register('sppc_customer_group_id');

 

I was trying to do that on the index page and it wasn't working.

Link to comment
Share on other sites

I am getting this error: Fatal error: Call to undefined function: tep_image_button()

 

After I attempted to install a modification called OSC2.2MS2_Keep_Image_Proportions_1_2_3. When I did this I got the above error so I put back all my original files. I still get the error even though I have put back my original files. I also deleted the configuration from sql. I never did touch the admin files. What is my next step? I know it has to be in the html_output files because that's the only file I changed. This is the code it's referring to:

	if (tep_not_null($width) && tep_not_null($height)) {
  $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';

Link to comment
Share on other sites

I am getting this error: Fatal error: Call to undefined function: tep_image_button()

 

After I attempted to install a modification called OSC2.2MS2_Keep_Image_Proportions_1_2_3. When I did this I got the above error so I put back all my original files. I still get the error even though I have put back my original files.

That function is there, in admin/includes/functions/html_output.php around line 128:

////
// Output a function button in the selected language
 function tep_image_button($image, $alt = '', $params = '') {
global $language;

return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $params);
 }

So either you uploaded the wrong file (or a file with changes in it) or in the wrong place (catalog instead of admin?). Or the code for the function is inside the curly braces of another function.

Link to comment
Share on other sites

Just wanted to follow up and say I figured it out. I just need to put the following code on the page LEADING INTO the homepage:

	$sppc_customer_group_id = $HTTP_GET_VARS['gID'];
tep_session_register('sppc_customer_group_id');

 

I was trying to do that on the index page and it wasn't working.

You need to be more careful with that, to avoid people messing with your code (sql injection perhaps?).

 

gId is most likely an integer (because customer_group_id is one), so make sure it is one!

 if ( isset($_GET['gID']) && !isset($_SESSION['sppc_customer_group_id']) ) {
 $sppc_customer_group_id = (int)$_GET['gID'];
 tep_session_register('sppc_customer_group_id');
}

Link to comment
Share on other sites

Hello again,

 

the SPPC Contribution is working perfectly I'm really grateful. Just one question, is there any way possible to show both prices?

For example:

 

Groups:

1. Retail

2. Wholesale

 

Me as a wholesale customer to see wholesale prices, but also the retail price to see the difference. This two prices shuold be shown only in product_info.

 

What should I do?

 

Thank you. :blush:

Link to comment
Share on other sites

Me as a wholesale customer to see wholesale prices, but also the retail price to see the difference. This two prices shuold be shown only in product_info.

 

What should I do?

You already got that information when you do the product_info_query (p.products_price). For simplicity you might add it twice but then "as retail_price":

$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, pd.products_url, p.products_price, p.products_price as retail_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

Then echo $product_info['retail_price'] when $customer_group_id > 0.

Link to comment
Share on other sites

Hi

 

hope there's someone with a better knowledge of PHP than me! I am trying to combine PWA with SPPC (with price breaks) but have run into a bit of a problem. I am using winmerge to make the changes.

 

The file I have a problems with is catalog/admin/order.php

 

The PWA file has the following code:

 

if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
}

 

The SPPC file has this on the same line numbers:

if (isset($HTTP_GET_VARS['cID'])) {
	// BOF Separate Pricing Per Customer
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status'])) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
  // EOF Separate Pricing Per Customer
}

 

Can anyone tell me how I can combine the 2 successfully? I think I need to check whether its a PWA order or a SPPC group order and run the correct "$orders_query_raw =" call, but how do I do that?

 

I know its asking a lot but if anyone can help I would really appreciate it. I have also posted a copy of this on the PWA thread.

 

Thanks

 

Chris

Link to comment
Share on other sites

This contribution set is really a wonderful thing, i install SPPC 4.2.1 at first, i hope i can success to install "Quantity Price Breaks for Separate Pricing Per Customer v1.02 2005/09/03, but i found it is so difficult to find our the exactlly code to replace, could any body give some advice "how can i install quantity price break after SPPC? Is it proper to install "Quantity Price Breaks for Separate Pricing Per Customer v1.02 2005/09/03"?

 

Thanks very much!

Link to comment
Share on other sites

Can anyone tell me how I can combine the 2 successfully? I think I need to check whether its a PWA order or a SPPC group order and run the correct "$orders_query_raw =" call, but how do I do that?

I compared the code of the PWA file you posted with the original code and I don't see any difference. The only thing that SPPC does is add some more joins to be able to pick up the customer group id (should be retail for PWA I assume) so my guess is you can safely use the SPPC code without trouble with PWA in this file.

Link to comment
Share on other sites

Is it proper to install "Quantity Price Breaks for Separate Pricing Per Customer v1.02 2005/09/03"?

Version 1.02 is from March 3, 2007 so the files are not the RC2a files but the manual instructions should still be correct for most if not all of the files (there are not that many files that need changing).

Link to comment
Share on other sites

I compared the code of the PWA file you posted with the original code and I don't see any difference. The only thing that SPPC does is add some more joins to be able to pick up the customer group id (should be retail for PWA I assume) so my guess is you can safely use the SPPC code without trouble with PWA in this file.

 

Thanks Jan, your guess was correct. The SPPC code worked fine for PWA. Fantastic, time-saving contrib with quick and knowledgable support.

 

Chris

Link to comment
Share on other sites

Version 1.02 is from March 3, 2007 so the files are not the RC2a files but the manual instructions should still be correct for most if not all of the files (there are not that many files that need changing).

 

Thanks Jan! Your tip encourage me to try Quantity Price Breaks 1.31 and 1.29 on SPPC 4.2.1a, finally i found 1.29 is more easier to install, so i just do it, use your contributions. Now, catagories in admin work is good, shoping card work is good, product info page work good, how ever, i have not though the admin>catalog>Manufacturers show the following message:

 

1052 - Column 'manufacturers_id' in field list is ambiguous

 

select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified, manufacturers_featured, manufacturers_featured_until, manufacturer_featured, manufacturer_featured_until, mi.manufacturers_htc_title_tag from manufacturers m LEFT JOIN manufacturers_info mi on m.manufacturers_id = mi.manufacturers_id where mi.languages_id = '1' order by manufacturers_name limit 0, 20

 

[TEP STOP]

 

I am a newbie to MySQL, so, could anyone could give me a tip to go out of this.

 

Thanks in advance and kindest regards to you all!

Link to comment
Share on other sites

1052 - Column 'manufacturers_id' in field list is ambiguous

 

select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified, manufacturers_featured, manufacturers_featured_until, manufacturer_featured, manufacturer_featured_until, mi.manufacturers_htc_title_tag from manufacturers m LEFT JOIN manufacturers_info mi on m.manufacturers_id = mi.manufacturers_id where mi.languages_id = '1' order by manufacturers_name limit 0, 20

 

[TEP STOP]

 

I am a newbie to MySQL, so, could anyone could give me a tip to go out of this.

Since manufacturers_id is both in the table manufacturers and manufacturers_info MySQL doesn't know which one to select when you just use manufacturers_id in the query. Of course it doesn't make any difference but MySQL doesn't know that. So you should tell MySQL which one to use:

select m.manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified, manufacturers_featured, manufacturers_featured_until, manufacturer_featured, manufacturer_featured_until, mi.manufacturers_htc_title_tag from manufacturers m LEFT JOIN manufacturers_info mi on m.manufacturers_id = mi.manufacturers_id where mi.languages_id = '1' order by manufacturers_name limit 0, 20

Link to comment
Share on other sites

Since manufacturers_id is both in the table manufacturers and manufacturers_info MySQL doesn't know which one to select when you just use manufacturers_id in the query. Of course it doesn't make any difference but MySQL doesn't know that. So you should tell MySQL which one to use:

select m.manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified, manufacturers_featured, manufacturers_featured_until, manufacturer_featured, manufacturer_featured_until, mi.manufacturers_htc_title_tag from manufacturers m LEFT JOIN manufacturers_info mi on m.manufacturers_id = mi.manufacturers_id where mi.languages_id = '1' order by manufacturers_name limit 0, 20

 

Wow, it work. you are so smart, Jan. you teach me one lesson about how to figure out problem from error message!

 

Highly appriciate for your work!

Link to comment
Share on other sites

Excuse me, it is me again. it seem i am not careful enough, I found all product price in price colum of product_listing page show 0.00, after i install "Quantity Price Breaks Per Product v1.2.9 1242" on "Separate Pricing Per Customer (SPPC) Version 4.2.1a".

 

In the step to modify product_listing.php, the manual said:

 

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

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

}

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

replace with

 

 

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

$pf->parse($listing);

$lc_text = $pf->getPriceStringShort();

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

 

My relate original code is

 

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

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

}

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

 

after change to

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

$pf->parse($listing);

$lc_text = $pf->getPriceStringShort();

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

the price just show 0.00.

 

Is that somewhere i have done correctly? Thanks very much for your help!

Link to comment
Share on other sites

after change to

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

$pf->parse($listing);

$lc_text = $pf->getPriceStringShort();

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

the price just show 0.00.

 

Is that somewhere i have done correctly? Thanks very much for your help!

 

I am sorry, I think i have figure it out following the logic l learned from Jan, after change my " $pf->parse($listing);" to " $pf->parse($listing[$x]);, it work.

 

Sorry for post too many post bother you.

Link to comment
Share on other sites

i'm a bit nervous about installing this on my live site - it is possible to duplicate my site as a test site, install SPPC, test it then copy the site back?

 

or is this what is normally done anyway... :rolleyes:

Link to comment
Share on other sites

i'm a bit nervous about installing this on my live site - it is possible to duplicate my site as a test site, install SPPC, test it then copy the site back?

 

or is this what is normally done anyway... :rolleyes:

That is how it is done ideally... Do it on your own computer using a backup of your site, then make the changes. If everything works fine, do the database changes on the live site first and then start uploading your new files (start with the admin section or try to follow the sequence in which the files are changed in the install.html. That was done in such a sequence as to try to avoid errors on the site as much as possible while doing the changes.

Link to comment
Share on other sites

Hello Jan,

 

I migrated my oscommerce to another server and I am getting this error:

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials_retail_prices s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '4' and p2c.categories_id = '18'

 

[TEP STOP]

 

 

This should be a PHP5 issue. With PHP4, oscommerce was working fine.

 

I tried your your solution provided in the link below and it didn't work:

 

http://www.oscommerce.com/forums/lofiversion/i...hp?t280441.html

 

I found this contrib:

 

Error Message - 1054 - Unknown column 'p.products_id' in 'on clause'

See: http://addons.oscommerce.com/info/4654

 

This contrib only fixes this problem with a fresh Oscommerce Shop (Unmodified site). My friend used it and it worked out.

 

I've tryed to hack it to get work with SPPC but I did not manage.

 

Below is the part of my actual index.php that is supposed to be modified:

 

// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
	// BOF Separate Pricing Per Customer
if ($status_product_prices_table == true) {

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, 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 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
} else { // either retail or no need to get correct special prices
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, 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 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, 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 from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, 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 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m  left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  }
} else {
// show the products in a given categorie
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory;
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, 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 from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, 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 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, 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 from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, 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 from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  } // end else { // either retail...
// EOF Separate Pricing per Customer
  }
}

 

 

Any idea on how to fix this issue within the above code?

 

Thanks for helping.

 

JBS7

Link to comment
Share on other sites

I have installed SPPC working fine and I'm interested in Quantity Price Breaks Per Product, but the version adapted for SPPC seems too old. I'm reading the documentation of current versions of Quantity Price Breaks Per Product but it's too hard for me to adapt it to SPPC.

 

Can you help me or give me a clue please??? :(

 

do you recommend Quantity Price Breaks for Separate Pricing Per Customer v1.02?

I checked it but I get the first problem modifying the first file since the code I must search is not included actually

Edited by Retro
Link to comment
Share on other sites

I migrated my oscommerce to another server and I am getting this error:

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

Any idea on how to fix this issue within the above code?

If you download the latest SPPC version and copy over that part from index.php to your index.php you should be fine again. You will have a problem with advanced_search_results.php too. Use the one from a later/the latest version of SPPC too.

Link to comment
Share on other sites

Join the conversation

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

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...