Contributions

Credit Modules (Category Index)
Search: 

CGDiscountSpecials

-----
This contribution allows to create Customers Groups, and to bind a discount rate
to them.
The administrator can set groups, group's discount, and bind customers to
groups.
This contribution adds a Discount Rate per Customers, the administrator can
easily edit discounts from the administration Customers panel.
Every Customers has it's own discount rate.
It is also possible to select the special prices for customers groups or single
customers.
Prices Policies:
product price = customer special price OR
customer group special price OR
special price OR
base price + customer discount + customer's group discount
Prices priority is here visualized. For example suppose that a special price
"X" is inserted for the product "PRODUCT" only for the customers "PINCO", bind
to group "GROUP", and also a special price "Y" is insert for the product
"PRODUCT" only for the group "GROUP". Price for customers "PINCO" of the
product "PRODUCT" will be "X", not "Y"!.
Other Features:
- users must be logged in to see prices
- every user can see the personalized prices calculated using the
pricing policies above.
- administrator can:
. add and set users groups
- every group has:
. a discount rate (only administrator can set the discount value)
. if present a special personal price per product
- every customers:
. a discount rate (only administrator can set the discount value)
. a group (only administrator can bind customers to groups)
. if present a special personal price per product

Please visit osCommerceITalia @ http://www.oscommerceitalia.com

Expand All / Collapse All

sub total fix 15 Mar 2006

Hello!

This fixes the subtotal on the checkout_confirmation.php page.
This is my first post on osc contributions! Hope it works for you! I found that it does not work for all osc installations.



Installation:

->option 1: copy the file included to catalog/includes/classes

->option 2: modify your file yourself like this:

FIND:
if ($products[$i]['attributes']) {
$subindex = 0;
reset($products[$i]['attributes']);
while (list($option, $value) = each($products[$i]['attributes'])) {
$attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
$attributes = tep_db_fetch_array($attributes_query);

$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
'value' => $attributes['products_options_values_name'],
'option_id' => $option,
'value_id' => $value,
'prefix' => $attributes['price_prefix'],
'price' => $attributes['options_values_price']);

$subindex++;
}
}

ADD UNDER THE FOUND CODE:
//pinkcrow begin

if (is_array($products[$i]['attributes']) && sizeof($products[$i]['attributes'])>1) {
$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
global $customer_id;
$query = tep_db_query("select g.customers_groups_discount from " . TABLE_CUSTOMERS_GROUPS . " g inner join " . TABLE_CUSTOMERS . " c on g.customers_groups_id = c.customers_groups_id and c.customers_id = '" . $customer_id . "'");
$query_result = tep_db_fetch_array($query);
$customers_groups_discount = $query_result['customers_groups_discount'];
$query = tep_db_query("select customers_discount from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
$query_result = tep_db_fetch_array($query);
$customer_discount = $query_result['customers_discount'];
$customer_discount = $customer_discount + $customers_groups_discount;
if ($customer_discount >= 0) {
$shown_price = $shown_price + $shown_price * abs($customer_discount) / 100;
} else {
$shown_price = $shown_price - $shown_price * abs($customer_discount) / 100;
}
}
else {
$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
}

//pinkcrow end





That's all!

Regards,
PinkCrow,
http://www.pinkcrow.net


CGDiscountSpecials --> Total B2B hOZONE 7 Jun 2004
CGDiscountSpecials 1.4b fix plus german hhaller 3 Jun 2004
CGDiscountSpecials 1.4b fix hOZONE 15 Apr 2004
CGDiscountSpecials 1.4b hOZONE 15 Apr 2004
CGDiscountSpecials 1.4 hOZONE 1 Apr 2004
CGDiscountSpecials 1.3f hOZONE 1 Apr 2004
CGDiscountSpecials 1.3e hOZONE 26 Mar 2004
guest price display BigT 15 Mar 2004
CGDiscountSpecials 1.3d hOZONE 7 Mar 2004
CGDiscountSpecials 1.3c hOZONE 29 Feb 2004
CGDiscountSpecials 1.3 hOZONE 2 Feb 2004
CGDiscountSpecials 1.2 hOZONE 23 Nov 2003
CGDiscountSpecials hOZONE 18 Nov 2003

Note: Contributions are used at own risk.