Jump to content
hozone

[contribution] Total B2B

Recommended Posts

Hi,

 

I just made a fresh install on OsComm 2.2rc2a. It worked with a first try !! Very nice contribution. !!

 

I wanted to go with SPPC + QPBPP, but this package could really save some time as its already pre prepared, but still different from the QPBPP point of view which is very tempting. I'll give it a try later, so far this one looks excellent ! lol

 

And a question of course ;)

 

Since I don't like my wholesale customers guessing what is the normal retail price (guest prices) , I'd like to show also a normal price in the products_info and any of products listings that are in use. In the way specials does probably ...

Maybe % of discount could be also showed in the products_info. Should be accumulated rate of discount in % as you can raise the discount in different areas as I could see in the admin ...

 

Any solutions already ?

 

Thanks !

Edited by suhy

Share this post


Link to post
Share on other sites

Hi,

 

I noticed some strange behaviour with special prices for all groups of customers. I was using package 1.3b. While I was cjeching the package I noticed some files must be missing .. true.

Package 1.3a have few additional files. Looks like 1.3b is not complete.

I uploaded 1.3a completely and then overwrite it with 1.3b and now works OK. Must still cross check, but I assume should be OK.

 

Please post if any troubles spoted.

Share this post


Link to post
Share on other sites

Hi,

 

I installed totalb2b and everything seems to work ok, accept the checkout_confirmation.php page.

Just below you can find the error I get on checkout_confirmation

Fatal error: Call to undefined method currencies::display_price_nodiscount() in /home/trickebe/public_html/shop/checkout_confirmation.php on line 196

 

I hope you can help me to get totalb2b up and running.

 

Thanks a lot!

 

Regards,

Patrick

Share this post


Link to post
Share on other sites
Hi,

 

I installed totalb2b and everything seems to work ok, accept the checkout_confirmation.php page.

Just below you can find the error I get on checkout_confirmation

Fatal error: Call to undefined method currencies::display_price_nodiscount() in /home/trickebe/public_html/shop/checkout_confirmation.php on line 196

 

I hope you can help me to get totalb2b up and running.

 

Thanks a lot!

 

Regards,

Patrick

 

 

Hi,

 

In the 1.3b package some files are missing, its not a complete package ... Try first to upload all files from 1.3a and then just overwrite with 1.3b. Asuming you are running a new clean install ... Should be OK ...

 

Regards,

G

Share this post


Link to post
Share on other sites

try to install this contribution, but no space to set discount rate per group. That is when I noticed there are two files missing:

 

catalog/admin/manudiscount.php

catalog/admin/includes/languages/english/manudiscount.php

 

Did look in each of the three for them. no luck.

Share this post


Link to post
Share on other sites

im having trouble getting this thing to work, i have a wery modified osc so i went throu the diff files and made all the changes i could find.

 

What works:

No error messages anywhere, and in adminpanel everything seems to work.

New products seems to show right discount and wiewing a product seems to show right discount price

 

What dosnt work:

Produsctslisting in categories dosnt show me right discount

neither does shopping cart or checkout process

 

I do have STS v 2.1.0 module too, i read in this thread that might be it but i have no idea how to fix it, any ideas anyone ?

Edited by raggarsvin

Share this post


Link to post
Share on other sites

Hi,

 

i am using totalb2b. This contribution is great, but i am missing one feature.

After activating an account it should be useful to inform the customer about this progress via mail automatically.

 

I was searching this topic and read that someone suggested this feature already.

But it does not seem to be implemented yet.

 

Anyone an idea? How to fix this?

 

Thanks.

 

Bye

Alforno

Share this post


Link to post
Share on other sites

After installing this contribution:

 

1) If I set it up in admin to allow guest to view prices without being logged in to (true) I get the following error in the what's new box:

 

Fatal error: Call to undefined method currencies::calculate_price() in /catalog/includes/classes/currencies.php on line 82 and everything except the category box is gone

 

2) If I set it up to allow guest to be false - everything on index shows up, and it says you must be logged in to see prices. But, when I log in, I get the following error:

 

Fatal error: Call to undefined method currencies::calculate_price() in /catalog/includes/classes/currencies.php on line 90. amd everything except the category box in gone

Share this post


Link to post
Share on other sites

This is the part of the code for the above error in currencies.php

 

		//TotalB2B start
function display_price($products_id, $products_price, $products_tax, $quantity = 1) {
  $query_price_to_guest = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'ALLOW_GUEST_TO_SEE_PRICES'");
  $query_price_to_guest_result = tep_db_fetch_array($query_price_to_guest);	  
  if (($query_price_to_guest_result['configuration_value']=='true') && !(tep_session_is_registered('customer_id'))) {
	$customer_discount = tep_get_discount_b2b($products_id);
	if ($customer_discount >= 0) {
	  $products_price = $products_price + $products_price * abs($customer_discount) / 100;
	} else {
	  $products_price = $products_price - $products_price * abs($customer_discount) / 100;
	}
// line 82
	return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
  } elseif (tep_session_is_registered('customer_id')) {
	$customer_discount = tep_get_discount_b2b($products_id);
	if ($customer_discount >= 0) {
	  $products_price = $products_price + $products_price * abs($customer_discount) / 100;
	} else {
	  $products_price = $products_price - $products_price * abs($customer_discount) / 100;
	}
// line 90
  return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
  } else {
	return PRICES_LOGGED_IN_TEXT;
  }
}

function display_price_nodiscount($products_price, $products_tax, $quantity = 1) {
  global $customer_id;
  $query_price_to_guest = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'ALLOW_GUEST_TO_SEE_PRICES'");
  $query_price_to_guest_result = tep_db_fetch_array($query_price_to_guest); 
  if ((($query_price_to_guest_result['configuration_value']=='true') && !(tep_session_is_registered('customer_id'))) || ((tep_session_is_registered('customer_id')))) {
	return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
	} else {
		return PRICES_LOGGED_IN_TEXT;
	}
}
//TotalB2B end

Share this post


Link to post
Share on other sites

I've been using your contrib for some time now (no ploblems). Would like to know if there is any simple way to make it so it has two features found in some other B2B's. When the price is displayed to also display a MAP and list price for buyers/dealers?

Share this post


Link to post
Share on other sites

A specials price error in classes/shopping_cart.php:

 

//TotalB2B start
         $products_price = tep_xppp_getproductprice($prid);
         $customer_discount = tep_get_discount_b2b($prid);
         if ($customer_discount >= 0) {
           $products_price = $products_price + $products_price * abs($customer_discount) / 100;
         } else {
           $products_price = $products_price - $products_price * abs($customer_discount) / 100;
         }
         if ($special_price = tep_get_products_special_price($prid)) $products_price = $special_price;
         //TotalB2B end

 

to:

 

//TotalB2B start
         $products_price = tep_xppp_getproductprice($prid);
         $customer_discount = tep_get_discount_b2b($prid);

	  if ($special_price = tep_get_products_special_price($prid)) $products_price = $special_price;
	  if ($customer_discount >= 0) {
           $products_price = $products_price + $products_price * abs($customer_discount) / 100;
         } else {
           $products_price = $products_price - $products_price * abs($customer_discount) / 100;
         }

         //TotalB2B end

 

The specials price should come before the dicount or discounts are not applied to specials prices when the products are added to cart.

Share this post


Link to post
Share on other sites

Greetings hozone/Davide, and all,

 

I have two questions, if you are still watching and maintaining this contribution?

 

#1 - On the osCommerceITalia contribution website I was reading that your contribution may have been ported to version 2.3.1 with some successes per a recent post by "06voip" so, now wondering if you may have any new information or updates for us here?

 

-- I am very excited to use these features you have so graciously given us, but, a bit cautious to install it for fear of breaking something in the installation.

 

#2 - Do you know of any incompatibilties with other contributions, or more specific, what changes may need to be done to work in 2.3.1?

 

-- I have a fairly straight-forward secured install of osC 2.3.1 which has only other 2 contributions, the "Extra Product Fields" and one of the basic "% discount per customer" modules (which only displays at the end of checkout) I have installed 2.3.1 and the recommended security features after getting hacked last year by a nasty 2.2 php redirect exploit.. so don't want to go back to 2.2 for that reason alone.

 

Thanks in advance for any reply, and best wishes :)

Share this post


Link to post
Share on other sites

Hi to all,

 

I have installed TotalB2B and featured products.

Please if someone know how to bypass customer discount on featured products like as on specials.

 

Let me explain....

 

I choose some product to be my fetaured products, and I give for some customer for example 10% on manufacturer A. Two of my featured products are from manufacturer A, and I don't want to discount these two products.

 

Please I need advice or resolution ASAP.

 

thnx

Share this post


Link to post
Share on other sites

Hi I have installed oscommerce 2.3.1 and i tried many times to install Total B2B v1.4a and when I go to the new attributes like Customers Groups or Categories Discount I receive a blank page with a message

Not Found

 

The requested URL /mysite/admin/FILENAME_CATEDISCOUNT was not found on this server.

or

The requested URL /oscommerce23/admin/FILENAME_GROUPS was not found on this server.

 

Please help me

thnx

Share this post


Link to post
Share on other sites

The ALL CAPITALS filenames point to missing constants. Probably, you missed adding these constants to the file admin/includes/filenames.php.

 

Something like:

define('FILENAME_GROUPS', 'groups.php');

Share this post


Link to post
Share on other sites

Thank you very much

all it is ok I add

define('FILENAME_SPECIALS', 'specials.php');

define('FILENAME_CATEDISCOUNT', 'catediscount.php');

define('FILENAME_CATEMANUDISCOUNT', 'catemanudiscount.php');

define('FILENAME_MANUDISCOUNT', 'manudiscount.php');

define('FILENAME_GROUPS', 'customers_groups.php');

 

and it works

The only problem is, that when I go to catalog/specials then I receive a completely blank page.

thnx again

Share this post


Link to post
Share on other sites

Hallo.

Is there a possibility to use a Discount Code 2.6 for osCommerce Online Merchant v2.3.1 together with B2B?

I mean there is a code in checkout_payment.php

<?php
 // Discount Code 3.1.1 - start
 if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') {
?>
 <h2><?php echo TEXT_DISCOUNT_CODE; ?></h2>
 <div class="contentText">
   <table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="middle" height="25"><?php echo tep_draw_input_field('discount_code', $sess_discount_code, 'id="discount_code" size="10"'); ?></td>
    <td width="5"></td>
    <td valign="middle"><div id="discount_code_status"></div></td>
  </tr>
   </table>
 </div>
<?php
 }
 // Discount Code 3.1.1 - end
?>

 

How can I set to show this code only for those customers who do not belong to any discount group?

 

For ex.: if ((customers_discount !='true') && (customers_groups_id !='true') && (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true')) {

Share this post


Link to post
Share on other sites

Hi I'm testing Total B2B release "TotalB2B_2.3" for os comemrce 2.3.1.

 

The basic installations works fine.!

 

But I looking for this error, when I using the admin control panel

for special products "specials.php"

 

it works too but

 

But The problem is, that when I go to catalog/specials I receive a completely blank page. (too)

 

Do you have any possible suggestion for to correct this possible error?

 

I do believe that maybe depend from some wrong query inside "specials.php" or some else. But I'm not sure :(

 

 

Total B2B is a very usefull addons tks

 

Tks to anybody :)

 

medianet24

Edited by medianet24

Share this post


Link to post
Share on other sites

In PHP settings You probably do not have "display errors" set. Do it and You'll get error message. In my case I get this message:

Parse error: syntax error, unexpected '}' in ...\admin\specials.php on line 239

Share this post


Link to post
Share on other sites

Hello all.

 

I am a student and started my studies of e-commerce now. I chose a nominee oscommerce and have realized it is a very versatile platform and have a very active forum.

 

I began my studies by osCommerce Online Merchant v2.2 Release Candidate 2a by me seem more stable.

 

Installed it on my server and started studying. I found the Add-Ons, I thought fantastic and started installing some of my interest. So far so good, my problems started when trying to install "TotalB2B_1.4a_1", so I ask for help.

 

When configuring the "TotalB2B_1.4a_1" in a fresh install of OsCommerce v2.2RC2a, I came across the following error when importing the SQL statements to the database:

 

import:

 

post-304858-0-06409500-1356594789_thumb.gif

error:

 

post-304858-0-35440300-1356594788_thumb.gif

 

The SQL code is as follows:

 

ALTER TABLE customers ADD customers_discount DECIMAL(8,2) DEFAULT '-0' NOT NULL;

 

DROP TABLE IF EXISTS customers_groups;

CREATE TABLE customers_groups (

customers_groups_id INT(11) NOT NULL AUTO_INCREMENT,

customers_groups_name VARCHAR(32) NOT NULL DEFAULT '',

customers_groups_discount DECIMAL(8,2) NOT NULL DEFAULT '-0',

customers_groups_price INT(11) NOT NULL DEFAULT '1',

PRIMARY KEY (customers_groups_id)

) TYPE=MyISAM;

 

INSERT INTO customers_groups VALUES (1, 'Default', '-0.00', '1');

INSERT INTO customers_groups VALUES (2, 'WholeSale', '-20.00', '1');

 

ALTER TABLE customers ADD customers_groups_id INT( 11 ) DEFAULT '1' NOT NULL;

ALTER TABLE customers ADD customers_status int(1) NOT NULL default '0';

 

ALTER TABLE specials ADD customers_groups_id INT( 11 ) DEFAULT '0' NOT NULL;

ALTER TABLE specials ADD customers_id INT( 11 ) DEFAULT '0' NOT NULL;

 

DROP TABLE IF EXISTS manudiscount;

CREATE TABLE manudiscount (

manudiscount_id INT(11) NOT NULL AUTO_INCREMENT,

manudiscount_name VARCHAR(128) NOT NULL DEFAULT '',

manudiscount_groups_id INT(11) NOT NULL DEFAULT '0',

manudiscount_customers_id INT(11) NOT NULL DEFAULT '0',

manudiscount_manufacturers_id INT(11) NOT NULL DEFAULT '0',

manudiscount_discount DECIMAL(8,2) NOT NULL DEFAULT '-0',

PRIMARY KEY (manudiscount_id)

) TYPE=MyISAM;

 

DROP TABLE IF EXISTS catemanudiscount;

CREATE TABLE IF NOT EXISTS catemanudiscount (

catemanudiscount_id INT(11) NOT NULL AUTO_INCREMENT,

catemanudiscount_name VARCHAR(128) NOT NULL default '',

catemanudiscount_groups_id INT(11) NOT NULL default '0',

catemanudiscount_customers_id INT(11) NOT NULL default '0',

catemanudiscount_categories_id INT(11) NOT NULL default '0',

catemanudiscount_manufacturers_id INT(11) NOT NULL default '0',

catemanudiscount_discount DECIMAL(8,2) NOT NULL default '-0',

PRIMARY KEY (catemanudiscount_id)

) TYPE=MyISAM;

 

DROP TABLE IF EXISTS catediscount;

CREATE TABLE IF NOT EXISTS catediscount (

catediscount_id INT(11) NOT NULL AUTO_INCREMENT,

catediscount_name VARCHAR(128) NOT NULL default '',

catediscount_groups_id INT(11) NOT NULL default '0',

catediscount_customers_id INT(11) NOT NULL default '0',

catediscount_categories_id INT(11) NOT NULL default '0',

catediscount_discount DECIMAL(8,2) NOT NULL default '-0',

PRIMARY KEY (catediscount_id)

) TYPE=MyISAM;

 

DELETE from configuration_group WHERE configuration_group_title="TotalB2B";

INSERT INTO configuration_group VALUES ('', 'TotalB2B', 'TotalB2B - configuration options', 1, 1);

UPDATE configuration_group SET sort_order=last_insert_id() WHERE configuration_group_id=last_insert_id();

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES

('', 'Number Of Prices Per Products', 'XPRICES_NUM', '1', 'Number of prices per products<br><br><b>WARNING: Changing this value will delete prices entry in products table!</b><br><br><b>Every groups that use a deleted price will use product default price.</b>', (SELECT configuration_group_id FROM configuration_group WHERE configuration_group_title = 'TotalB2B'), '31', '2003-11-11 18:33:04', '0000-00-00 00:00:00', 'tep_update_prices', 'tep_cfg_pull_down_prices(')

, ('', 'Allow Guest To See Prices', 'ALLOW_GUEST_TO_SEE_PRICES', 'false', 'Allow guests to view default prices', (SELECT configuration_group_id FROM configuration_group WHERE configuration_group_title = 'TotalB2B'), '32', '', '2004-03-15 14:59:05', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')

, ('', 'Guest Discount', 'GUEST_DISCOUNT', '0', 'Guest discount', (SELECT configuration_group_id FROM configuration_group WHERE configuration_group_title = 'TotalB2B'), '33', '', '2004-03-15 14:59:05', NULL, '')

, ('', 'Special price (products price hiding)', 'SPECIAL_PRICES_HIDE', 'false', 'Special price (products price hiding)', (SELECT configuration_group_id FROM configuration_group WHERE configuration_group_title = 'TotalB2B'), '34', '', '2004-03-15 14:59:05', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')

, ('', 'New customer Enable', 'NEW_CUSTOMERS_ENABLED', 'false', 'Enable or disable new customers after their registration', (SELECT configuration_group_id FROM configuration_group WHERE configuration_group_title = 'TotalB2B'), '35', '', '2004-03-15 14:59:05', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

 

 

 

I need help to solve this problem.

 

I thank you all.

Edited by devlon1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×