Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order editor - ToTalB2B please help!


matraz

Recommended Posts

Posted

Hello,

 

order editor is a very usefull contribution, but I use ToTalB2B. This means special prices/discount per customer.

 

The order editor contribution only works with Separate Pricing Per Customer.

 

Can anybody help me out to change that part of SPPC (Separate Pricing Per Customer. ) into the TotalB2B query?

 

 

if (ORDER_EDITOR_USE_SPPC == 'true') {

 

// first find out the customer associated with this order ID..

$c_id_result = tep_db_query('SELECT customers_id

FROM orders

WHERE orders_id="' . (int)$oID . '"');

 

$cid = tep_db_fetch_array($c_id_result);

if ($cid){

$cust_id = $cid['customers_id'];

// now find the customer's group.

$c_g_id_result = tep_db_query('SELECT customers_group_id

FROM customers

WHERE customers_id="' . $cust_id . '"');

 

$c_g_id = tep_db_fetch_array($c_g_id_result);

if ($c_g_id){

$cust_group_id = $c_g_id['customers_group_id'];

// get the price of the product from the products_groups table.

$price_result = tep_db_query('SELECT customers_group_price

FROM products_groups

WHERE products_id="' . $add_product_products_id . '"

AND customers_group_id="' . $cust_group_id . '"');

 

$price_array = tep_db_fetch_array($price_result);

if ($price_array){

// set the price of the new product to the group specific price.

$product['products_price'] = $price_array['customers_group_price'];

}

}

}

}

//end sppc patch

 

 

 

This is a part out (product_info.php) about the TotalB2B code. Is is possible to integrade this into my order editor?

 

 

CODE

//TotalB2B start

$product_info['products_price'] = tep_xppp_getproductprice($product_info['products_id']);

//TotalB2B end

 

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

 

//TotalB2B start

$query_special_prices_hide = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'SPECIAL_PRICES_HIDE'");

$query_special_prices_hide_result = tep_db_fetch_array($query_special_prices_hide);

if ($query_special_prices_hide_result['configuration_value'] == 'true') {

$products_price = '<span class="productSpecialPrice">' . $currencies->display_price_nodiscount($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

} else {

$products_price = '<s>' . $currencies->display_price($product_info['products_id'], $product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price_nodiscount($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

}

//TotalB2B end

 

 

} else {

//TotalB2B start

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

//TotalB

 

 

Sorry for my bad english!

 

but thanks a lot for helping me!!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...