Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing per customer problem


Guest

Recommended Posts

Hi, I am a newcomer :oops: to php and oscommerce so please excuse my ignorance if this is a stupid mistake ive made.

 

I have installed seperate pricing per customer and it all seems to be working ok except on the catalog/product_info page the price shows a $0.00 unless the user is logged in.

 

Is there something i have done to the code.

 

I think this is the code concerned

 

<?php

} else {

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 = '" . $languages_id . "'");

$product_info = tep_db_fetch_array($product_info_query);

 

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {

$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 {

global $customer_id;

$customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");

$customer_group = tep_db_fetch_array($customer_group_query);

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

if ( $customer_group['customers_group_id'] != 0) {

if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {

$products_price = $currencies->display_price($customer_group_price['customers_group_price'], tep_get_tax_rate($product_info_values['products_tax_class_id']));

} else {

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

}

} else {

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

}

}

?>

 

Thanks fo any help :)

Link to comment
Share on other sites

Meant to say, if you are logged in as a trade customer it shows the price fine but if you are logged in as retail or not logged in it doesnt work:(

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Hi all,

 

It's hard to implement, but it's a GREAT contribution.

 

Needs an update though to get working with OSC 2.2 MS1. The author himself says it was written for a late 2002 snapshot of OSC. I've got it working almost flawlessly, only the broken products_new.php.

 

As soon as I get that fixed I'm gonna commit myself to making an update install for MS1.

 

Regards

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.
Note: Your post will require moderator approval before it will be visible.

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...