Contributions
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
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
Now i will develop "Total B2B", use this contribution instead of "CGDiscountSpecials"
or "XPricesPerProduct".
http://www.oscommerce.com/community/contributions,2158
For further informations visit
osCommerce forum @ http://forums.oscommerce.com
> http://forums.oscommerce.com/index.php?act=ST&f=7&t=96770
or osCommerceITalia (italian forum) @ http://www.oscommerceitalia.com
> http://www.oscommerceitalia.com/modules.php?name=Forums&file=viewtopic&p=5038#5038
added support for german language.
This includes the whole "1.4b fix" package.
v1.4bfix-plus-German - by hhaller (1.4bfix-plus-german)
----
. modified files for german.
changed files are:
. catalog/includes/languages/german.php
. catalog/admin/includes/languages/german.php
. catalog/admin/includes/languages/german/customers.php
. catalog/admin/includes/languages/german/specials.php
added files:
. catalog/admin/includes/languages/german/customers_groups.php
1.4 has ome bug, this version work
v1.4b - by hOZONE
----
. apply a discount to guest prices.
v1.4 - by hOZONE
----
. apply the hack from BigT(bigtiti@hotmail.com) to allow guest to see prices.
v1.3f - by hOZONE
----
. fixed a bug in ordering products by price in:
catalog/index.php
v1.3e - by hOZONE
----
. fixed a bug in showing prices in:
.. catalog/includes/modules/new_products.php
features :
- Enables admin to choose wether a default price should be accessible by guests.
description :
- true/false choice for "allow guest to see prices" property in admin >> configuration >> my store
- prices displayed will be computed from rules defined for group 'default'
. fixed a bug in showing specials in:
catalog/specials.php
v1.3c - by hOZONE
----
. fixed a bug in calculating prices in:
catalog/includes/modules/new_products.php
catalog/includes/boxes/shopping_cart.php
catalog/shopping_cart.php
v1.3 - by hOZONE
----
. fixed a bug in calculating prices in:
catalog/includes/modules/classes/currencies.php
catalog/includes/modules/classes/shopping_cart.php
v1.2 - by hOZONE
. clean some code in catalog/admin/customers_groups.php
. some bug fixed
-----
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
Note: Contributions are used at own risk.