Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

[contribution] Total B2B


397 replies to this topic

#1 hozone

  • Community Member
  • 174 posts
  • Real Name:hOZONE
  • Gender:Male
  • Location:Italy

Posted 07 June 2004, 11:24

This contribution add B2B features to osCommerce.

About
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.
The products don't have only 1 price, but it is possible to set multiple prices
for products.
The administrator can create groups of users. Every users' group is associated
to one product price.
Every user has its own group associated.
Every products manufacture will have a discount for a groups.
The number of product prices can be set from:
"Configuration / My Store/ Number of prices per product".
Note: trying to reduce this value causes the automatic set of default price
      (price 1) of all those groups for which the reduction has caused an
      inconsistency with the prices.
      For ex.: if a group has price 3 and "Number of prices per product" is set
      to 2, this group will have as a new price the default price (price 1).

Pricing policies:
   temp_product_price =
                   IF the customer is in a group with price X
                      IF price X for selected product exist
           = temp_product_price X
        ELSE
           = temp_product_price 1 (default price)
     ELSE
        = temp_product_price 1 (default price)
   product price = IF exist(customer special price)
                      = customer special price
     ELSE IF exist(customer group special price)
        = customer group special price
     ELSE IF exist(special price)
        = special price
     ELSE IF exist(manufacturer discount for customer)
        = temp_product_price + manufacturer discount
     ELSE IF exist(manufacturer discount for customer's group)
        = temp_product_price + manufacturer discount
     ELSE IF exist(manufacturer discount)
        = temp_product_price + manufacturer discount
     ELSE
                      = temp_product_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:
- 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
- admin can choose if a default price should be accessible by guests. True/false
  choice for "allow guest to see prices" property in admin >> configuration >> my store.
  prices displayed for guest will not be computed, only "guest discount", from
  admin >> configuration >> my store, will change this prices.

osCommerce Italia support: http://www.oscommerceitalia.com

#2 hozone

  • Community Member
  • 174 posts
  • Real Name:hOZONE
  • Gender:Male
  • Location:Italy

Posted 07 June 2004, 11:30

download for osCommerce 2.2 MS2 @ http://www.oscommerce.com/community/contributions,2158
osCommerce Italia support: http://www.oscommerceitalia.com

#3 akkinmore

  • Community Member
  • 227 posts
  • Real Name:Shelly Akkinmore

Posted 07 June 2004, 12:41

Hi Davide,

I downloaded and can't open the file. It seems that the file is corrupted.
May I know this Total B2B is an improvement to CGDiscountSpecials? How do I upgrade from this verion to new one. Thanks for this great contribution. :lol:

#4 hozone

  • Community Member
  • 174 posts
  • Real Name:hOZONE
  • Gender:Male
  • Location:Italy

Posted 07 June 2004, 12:56

i can open this file with winrar 3.30

> May I know this Total B2B is an improvement to CGDiscountSpecials?
Yes, it is

> How do I upgrade from this verion to new one
there are many files to edit :(, you must edit one by one, manually
osCommerce Italia support: http://www.oscommerceitalia.com

#5 Mibble

  • Community Member
  • 13,404 posts
  • Real Name:JAO
  • Location:MA (US): 42n22, 71w04, Massachusetts

Posted 07 June 2004, 13:06

did you remove the references to the areas which do not work or did you leave them in the code, with comments, perhaps others can 'fix' what doesnt work?

#6 seank123

  • Community Member
  • 337 posts
  • Real Name:Sean Kennedy
  • Gender:Male

Posted 07 June 2004, 13:20

Hi

Nice contrib - works perfectly

But, I have a suggestion/requst.

Is it possible to implement price breaks?? EG: if someone orders 1 item they get the price assigned to the group that they are in, but if they order, for example 10+ of an item, they get a lower price -

1+ = £100.00
10+ = £95.00
20+ = £90.00

etc....

There is a contibution that does this but it has to change a few files that Total B2B has already changed....

Any chance of this being included in a leter version??

Cheers

#7 notset4life

  • Community Member
  • 85 posts
  • Real Name:Vin

Posted 07 June 2004, 16:16

akkinmore, on Jun 7 2004, 12:41 PM, said:

May I know this Total B2B is an improvement to CGDiscountSpecials? How do I upgrade from this verion to new one. Thanks for this great contribution. :lol:
Same question here....is this is improvement on CGI Discount Specials 1.4, or just a Name change so far?

#8 hozone

  • Community Member
  • 174 posts
  • Real Name:hOZONE
  • Gender:Male
  • Location:Italy

Posted 08 June 2004, 09:35

Mibble, on Jun 7 2004, 02:06 PM, said:

did you remove the references to the areas which do not work or did you leave them in the code, with comments, perhaps others can 'fix' what doesnt work?
comments like this

//CGDiscountSpecial start --> //TotalB2B start
etc...
osCommerce Italia support: http://www.oscommerceitalia.com

#9 hozone

  • Community Member
  • 174 posts
  • Real Name:hOZONE
  • Gender:Male
  • Location:Italy

Posted 08 June 2004, 09:36

notset4life, on Jun 7 2004, 05:16 PM, said:

akkinmore, on Jun 7 2004, 12:41 PM, said:

May I know this Total B2B is an improvement to CGDiscountSpecials? How do I upgrade from this verion to new one.  Thanks for this great contribution.  :lol:
Same question here....is this is improvement on CGI Discount Specials 1.4, or just a Name change so far?
it is CGDiscountSPecials + XPricesPerProducts + some new features.
osCommerce Italia support: http://www.oscommerceitalia.com

#10 hozone

  • Community Member
  • 174 posts
  • Real Name:hOZONE
  • Gender:Male
  • Location:Italy

Posted 08 June 2004, 09:37

seank123, on Jun 7 2004, 02:20 PM, said:

Hi

Nice contrib - works perfectly

But, I have a suggestion/requst.

Is it possible to implement price breaks?? EG: if someone orders 1 item they get the price assigned to the group that they are in, but if they order, for example 10+ of an item, they get a lower price -

1+ = £100.00
10+ = £95.00
20+ = £90.00

etc....

There is a contibution that does this but it has to change a few files that Total B2B has already changed....

Any chance of this being included in a leter version??

Cheers
i suppose it can be done... but now i don't have time :(
osCommerce Italia support: http://www.oscommerceitalia.com

#11 THX

  • Community Member
  • 42 posts
  • Real Name:JT

Posted 08 June 2004, 12:01

I am not sure if this is possible with your contribution(s) but what I would like is a contrib that allows a cost price entered for each product and then any number of per category % added to the cost price that only displays to customers of a certain group.

e.g.

Cost: $100

Group A: cost + 5% = $105
Group B: cost + 10% = $110

Each category could have its own seperate percentage applied to it, so category 1 has the percentages of 5%, 10%, 15% applied to it while category 2 has the percentages of 2%, 6% and 10% applied.

I know this sounds complicated and I hope I have explained it alright but it is a feature I'd like to add.

#12 akkinmore

  • Community Member
  • 227 posts
  • Real Name:Shelly Akkinmore

Posted 09 June 2004, 02:12

Hi

I upgraded this contrib from CGDiscount and I ran into some problems. I showed my products in columns instead of rows. After upgrading this contrib, all my product price shows $0. I have product_listing_col.php in catalog\includes\modules\ how do I modify product_listing_col.php to accommodate this contrib?

The product_listing_col.php is as follows:

****** begin *********
<!-- product_listing_col //-->
<?php

DEFINE('PRODUCT_LIST_COL_NUM',3);

$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr><td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table>
<?php
}

$info_box_contents = array();

if ($listing_split->number_of_rows > 0) {

$row = 0;
$col = 0;

$listing = tep_db_query($listing_split->sql_query);
while ($listing_values = tep_db_fetch_array($listing)) {

$listing_values['products_name'] = tep_get_products_name($listing_values['products_id']);

$lc_text= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_name'] . '</a><br>';

if ($listing_values['specials_new_products_price']) {
$lc_text .= '&nbsp;<s>' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</s>&nbsp;&nbsp;<span class="productSpecialPrice">' . $currencies->display_price($listing_values['specials_new_products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</span>&nbsp;';
} else {
$lc_text .= '&nbsp;' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '&nbsp;';
}

if (PRODUCT_LIST_BUY_NOW) {
$lc_text .= '<br><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</a>&nbsp;';
}

$info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"',
'text' => $lc_text);

$col ++;
if ($col > PRODUCT_LIST_COL_NUM-1) {
$col = 0;
$row ++;
}
}

new contentBox($info_box_contents);

} else {

$info_box_contents = array();

$info_box_contents[0] = array('params' => 'class="productListing-odd"');
$info_box_contents[0][] = array('params' => 'class="productListing-data"',
'text' => TEXT_NO_PRODUCTS);

new contentBox($info_box_contents);

}

if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<table width="100%">
<tr>
<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table>
<?php
}
?>

******** end *****

Can anyone help me? Thanks.

#13 akkinmore

  • Community Member
  • 227 posts
  • Real Name:Shelly Akkinmore

Posted 09 June 2004, 11:40

hi

Kindly ignore my previous posting. Problem solved... :lol:

#14 corwin43

  • Community Member
  • 19 posts
  • Real Name:Steve

Posted 11 June 2004, 17:26

Just curious...

Does this mod allow for category discounting?

Example: You assign all users to the same group (Default). Even guest users. You then assign a discount to one category of say 10%. This would then allow for purchasing of all items at normal pricing, and items of the one category at a 10% discount across the board.

#15 jogoto

  • Community Member
  • 18 posts
  • Real Name:Wolfram Palmer

Posted 15 June 2004, 16:22

Hi hozone,

very nice contribution.
But something strange happend in my shop. After installing the contrib all prices in the shop (product listing and info) are 16.00 €. In cart and on the the checkout... pages they are like they should but without tax. In the admin they are the same as before.
% discount works (e.g. 50% then they are all 8.00 €) but price 2,3,4... don`t work (still 16.00 €).
My tax rate is 16, so maybe it took that instead of the price.
Any suggestions where the mistake could be?

#16 jogoto

  • Community Member
  • 18 posts
  • Real Name:Wolfram Palmer

Posted 16 June 2004, 12:50

o.k.
Problem solved, there are two lines of code in product info and listing were not marked as a change to the original code.

But now I have two new problems:

1. because of this code
GROUP BY p.products_id
in four lines in index.php I lost my Prev/Next Navigation Bar in the product listing. Only
Products: 1 to 1 (of 1 total) Pages:  1
is left. Should be
Products: 1 to 5 (of 28 total) Pages:  6
and the navigation of course.

2. after moving from my local server to the internet server I got this in the shop:

Quote

1064 - You have an error in your SQL syntax near 'inner join customers c on g.customers_groups_id = c.customers_groups_id and c.c' at line 1

select g.customers_groups_price from customers_groups g inner join customers c on g.customers_groups_id = c.customers_groups_id and c.customers_id = ''

Only known difference is an older MySQL version (3.22.32) instead of 4.0.15 on the local server.

#17 jogoto

  • Community Member
  • 18 posts
  • Real Name:Wolfram Palmer

Posted 16 June 2004, 12:55

Quote

Does this mod allow for category discounting?

Just an idea:
If you do not use a manufacture you can give each categorie a "manufacture" with a manufacture discount.

#18 jogoto

  • Community Member
  • 18 posts
  • Real Name:Wolfram Palmer

Posted 21 June 2004, 13:53

Quote

2. after moving from my local server to the internet server I got this in the shop:

QUOTE

1064 - You have an error in your SQL syntax near 'inner join customers c on g.customers_groups_id = c.customers_groups_id and c.c' at line 1

select g.customers_groups_price from customers_groups g inner join customers c on g.customers_groups_id = c.customers_groups_id and c.customers_id = ''


Only known difference is an older MySQL version (3.22.32) instead of 4.0.15 on the local server.

"inner join" needs MySQL minimum version 3.23.17

#19 Maj

  • Community Member
  • 11 posts
  • Real Name:Maj

Posted 23 June 2004, 01:45

My two pennies to make things a little more complicated; Option to allow discount based on Category and Quantity is something I am definitely looking for, But to take it a step (or two) further with my wishful thinking a bunch of features/possibilities can be added with the following structure.
Every Customer is associated with 1 Group and each group could have one or more records in the following lookup table.

Group_Coupon_ID,
Category_ID,
Mfg._ID,
Qty,
Products_ID,
Bought_With_Products_ID,
Discount_%,
Start_Date,
End_Date
[SIZE=1]

Bought
Group With
Coupon Category Mfg_ID Qty Products Products Discount Start End
ID ID ID ID % Date Date

1 4 0 5 0 0 5.67 5/5/2004 7/31/2004
1 0 0 5 456 0 6.765 5/5/2004 7/31/2004
1 0 34 0 0 0 10 5/5/2004 7/31/2004
1 4 0 0 0 0 7.5 7/31/2004 8/30/2004
65432 23 0 0 0 0 5 5/25/2004 7/15/2004

[SIZE=7]
(A value of “0” in Category_ID or Mfg_ID or product_ID or Qty would read as ANY)

I think this structure can accommodate Category Discount, Manufacturers Discount, Coupons Discount, Product Discount, Quantity discount (down to product level), Product Discount, Discount if bought with related product, and can also include Option Discount by adding another column to the table. Also can control when the discount starts and when it ends.
Obivously a lot of coding is involved, I guess Davide would know the implication and amount of coding involved

[SIZE=1]
(please align text to view data in correct columns)

#20 jogoto

  • Community Member
  • 18 posts
  • Real Name:Wolfram Palmer

Posted 25 June 2004, 09:37

Still having problems.

I took a really fresh 2.2MS2 installation and replaced the files with the TotalB2B v1.1b files.
Only change: I reduced the "Maximum Value" of "Search Results" in the konfiguration to 5.
If I go to DVD Movies -> Action (9) I can see the first 5 movies. The Prev/Next Navigation Bar looks like this:

Quote

Displaying 1 to 1 (of 1 products)
Result Pages:  1
with no navigation.

Am I the only one with this problem around here?