Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Total B2B


hozone

Recommended Posts

I installed this just fine but I have a problem when I assigned a group discoutn to a customer the items I have on special are marked as follows and I do not know why... the line through $3.19 and the price as $3.25 but the sale price is $3.25... what is it doing? thanks!

 

product name $3.19 $3.25

Link to comment
Share on other sites

  • Replies 411
  • Created
  • Last Reply

Top Posters In This Topic

please disregard my last post I just realized I have not applied the updated version from CGD Discounts ? total b2b ... I am not sure how to do htis as I do not see how to modify the files I already have the CGD installed and other modu;les as well... how do I upgrade? thanks

Link to comment
Share on other sites

well it took a while but I figured out how to update the sql, but I did something wrong when I modified catalog/product_info.php i think as the catalog in admin does not reflect the tax I have to charge and on the product info page the price shows $7.75 for everything which is the tax rate?? ANy ideas how to fix this?? are there more files I m ay have messed up thanks so much this store is live and I am in a pickle!

Link to comment
Share on other sites

Thank you so much for responding so quickly! I went through and did each file but I ran into a few problems. It seems to work correctly with the exception of the following

 

in the admin center when I am m editing each catalog item it does not reflect the tax I have it set for. the net and gross price are the same

 

when I view new products via catalog/products_new.php the price shown is $7.75 for all items which is the local tax rate.

 

When I remove someone from the groups list it still gives them the discount

 

Any idea what files I messed up? thanks again so much this module is awesome!

Link to comment
Share on other sites

Hello people,

 

I hope this is the right thread to post this:

 

Well, I am using B2B Suite and I wanted to install the contribution for Call for Price. I don't actually know which one is good but if someone can recommend that would work well with that contribution. Has anyone insterted the code correctly to work with B2B?

Link to comment
Share on other sites

Hello people,

 

I hope this is the right thread to post this:

 

Well,  I am using B2B Suite and I wanted to install the contribution for Call for Price.  I don't actually know which one is good but if someone can recommend that would work well with that contribution.  Has anyone insterted the code correctly to work with B2B?

 

 

Hey Darkangel,

 

I havn't used the Call for Price mod but I thought I might share some words of wisdom.

 

I've hijacked a few mods, some custom made and contributions, into the B2B mod. You just have to make sure you review the basic logic above and below the code you are inserting, especially if there is any interaction with the B2B. Review and understand the logic of the code you are inserting; this way you can look at the general logic of the page you are modifying to see if there are any conflicts.

 

As always, backup each file before you edit it in case you want to "roll back" your work.

Link to comment
Share on other sites

Ok I have gotten the contribution to work, not fully but almost... I am having conflicts though!

 

The b2b code and the call for price code seem to conflict, they do work, but doesn't show the right price for the costumer in the new products nor in the product info.

 

Can anyone help with this:

 

This is the code that I am having trouble with:

 

 

// BOF: WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC. v3.0
           $my_products_name = $product_info_values['products_name'];
           $my_products_price = $product_info_values['products_price'];
           $my_specials_new_products_price = tep_get_products_special_price($product_info_values['products_id']);
           $my_products_quantity = tep_get_products_stock($product_info_values['products_id']);
// EOF: WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC. v3.0

   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
//***** START OF B2BSUITE MODIFICATION
           global $customer_id;
         $customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id =  '" . $customer_id . "'");
         $customer_group = tep_db_fetch_array($customer_group_query);
      	 $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group['customers_group_id'] . "'");
       if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query))
       $product_info['products_price']= $scustomer_group_price['customers_group_price'];

     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     //$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   global $customer_id;
 $customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id =  '" . $customer_id . "'");
 $customer_group = tep_db_fetch_array($customer_group_query);
 $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_group_id =  '" . $customer_group['customers_group_id'] . "'");
 if ( $customer_group['customers_group_id'] != 0) {
    if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
       $products_price = "";
  	 $products_price = $currencies->display_price($customer_group_price['customers_group_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
     } else {
   $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }
 } else {
   $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
	 }
//***** END OF B2BSUITE MODIFICATION

 

Can someone combine this? Has anyone gotten both this contribution together?

 

I greatly appreciate it!

Link to comment
Share on other sites

Dear all please provide your experience if it is possible to install the Total B2B in the CREloaded distribution of OSC

 

Thanks for your answer

 

 

Dear All from me, as well :wub:

 

What about adding this great code into good old MS1??

If someone actually did that I would really like to buy him/her a big can of beer or something...

 

Just curious if such thing is possible?!?

Thank you for any kind of comments!

 

My name is Dusan

and I can fly anywhere :ph34r:

Link to comment
Share on other sites

For anyone that experiences the problem some mentioned above about all there prices displaying 0. Please ensure that in the Admin under localization > currencies, you have your chosen currency set to default. I had no currency set to default.. changed my dollar to default and all has been fixed.

Link to comment
Share on other sites

hozone.

 

Could you work on maybe adding another feature. Say for instance I have these products"

 

Product A

Product B

 

I require customers to purcahse a case of Product A which is 12

I require customers to purchase a case of Product B which is 48

 

Now right now I have listed the individual prices of Product A and Product B.

 

Can you add a feature to where you can make it a requirement to purcahse 12 and 48 for each product rather than having to show the price for 12 and mark each product in it's description of "This price is for a case of 12" because if they see the price for a case, they may not like it rather than seeing the price of one initially.

 

I know there is a contribution that forces a customer to purcahse a minimum amount but that is only for all products. It allows you to set a minimum quanitty across the board but I need something that allows you to set a minimum quanitity for each individual product.

 

thanks in advance.

Link to comment
Share on other sites

@ sicanada

 

check that EVERY call to display_price has 4 paramenter passed (the first meust be the products id)

 

THIS IS MY CODE.

 

function display_price($products_id, $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'))) {

$query_guest_discount = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'GUEST_DISCOUNT'");

$query_guest_discount_result = tep_db_fetch_array($query_guest_discount);

$customer_discount = $query_guest_discount_result['configuration_value'];

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;

}

return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

} elseif (tep_session_is_registered('customer_id')) {

$query_A = tep_db_query("select m.manudiscount_discount from " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = 0 and m.manudiscount_customers_id = '" . $customer_id . "' and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");

$query_B = tep_db_query("select m.manudiscount_discount from " . TABLE_CUSTOMERS . " c, " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = c.customers_groups_id and m.manudiscount_customers_id = 0 and c.customers_id = '" . $customer_id . "' and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");

$query_C = tep_db_query("select m.manudiscount_discount from " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = 0 and m.manudiscount_customers_id = 0 and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");

if ($query_result = tep_db_fetch_array($query_A)) {

$customer_discount = $query_result['manudiscount_discount'];

} else if ($query_result = tep_db_fetch_array($query_B)) {

$customer_discount = $query_result['manudiscount_discount'];

} else if ($query_result = tep_db_fetch_array($query_C)) {

$customer_discount = $query_result['manudiscount_discount'];

} else {

$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) {

$products_price = $products_price + $products_price * abs($customer_discount) / 100;

} else {

$products_price = $products_price - $products_price * abs($customer_discount) / 100;

}

return $this->format(tep_add_tax($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(tep_add_tax($products_price, $products_tax) * $quantity);

} else {

return PRICES_LOGGED_IN_TEXT;

}

}

//TotalB2B end

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

I have installed B2B and hide_products but I have this error in the admin part when I edit the product :

 

Warning: Invalid argument supplied for foreach() in c:\web\easyphp1-8\www\catalog\admin\categories.php on line 558

 

 

It's near "Select groups to hide"

Link to comment
Share on other sites

Hello,

 

I have installed B2B and hide_products but I have this error in the admin part when I edit the product :

 

Warning: Invalid argument supplied for foreach() in c:\web\easyphp1-8\www\catalog\admin\categories.php on line 558

It's near "Select groups to hide"

 

 

line 558 of admin/categories.php

<td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>

doesn't have foreach( ...

 

:blink:

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

Link to comment
Share on other sites

 <?php
// ---BOF--Hide product from groups ------------------------------------//
 ?>
        <tr align="top"><td><? echo TEXT_HIDE_PRODUCTS_FROM_GROUP; ?></td>
  <td class="dataTableContent">
        <table border="0" cellpadding="0" cellspacing="0">
        <?php
        #Check which groups should be hidden
         if ($product_id != NULL){
        $product_hide_from_group_query = tep_db_query("select products_hide_from_groups from ".TABLE_PRODUCTS." where products_id =".$HTTP_GET_VARS['pID']);
       
        $hide_these_products = tep_db_fetch_array($product_hide_from_group_query);
 $hide = explode(',',$hide_these_products['products_hide_from_groups']);
 }


        $customers_groups_query = tep_db_query("select distinct customers_groups_id, customers_groups_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_groups_id != '" . 0 . "' order by customers_groups_id");
        $i=1;
        while ($customers_groups = tep_db_fetch_array($customers_groups_query)) {
foreach($hide as $h){
 if($h == $customers_groups['customers_groups_id']){
  $check_hidden = true;
   break;
 }else{
   $check_hidden = false;
 }
}
 #print the checkbox field
 echo  '<tr class="dataTableContent"><td>'.
       ($i).'. '.
       tep_draw_checkbox_field(
  'hide[' . ($i++) . ']',
  $customers_groups['customers_groups_id'] ,
  $check_hidden) . ' '
  . $customers_groups['customers_groups_name'].'</td></tr>';
        }#End of while
        ?>
        </table>
        </td></tr>

        <?php         
        //---EOF--Hide product from groups -----------------------------------// 
?>

Link to comment
Share on other sites

Nobody can help me ???
Perhaps you expect too much...

 

This part looks suspicious:

 ? ? ? #Check which groups should be hidden
? ? ? ? ?if ($product_id != NULL){

Can you try:

 ? ? ? #Check which groups should be hidden
if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {

You get the error because $hide is not an array. You can check that by adding some echo's:

? ? ? ? $hide_these_products = tep_db_fetch_array($product_hide_from_group_query);
?$hide = explode(',',$hide_these_products['products_hide_from_groups']);
?}

echo '<h3>Hide is: ';
echo $hide;
echo '</h3>';

? ? ? ? $customers_groups_query = tep_db_query("select distinct customers_groups_id, customers_groups_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_groups_id != '" . 0 . "' order by customers_groups_id");

If you just see "Hide is:" then $hide is NULL, so not an array.

Link to comment
Share on other sites

Thanks it's good now !!!

But I have another problem ...

 

The function whose hide the products doesn't work, I think it's that :

//--BOF hide products from group---
$group_id = tep_get_customer_groups_id($customer_id);
$listing_sql .= " and  find_in_set('".$group_id."', products_hide_from_groups) = 0 ";
//--EOF hide products from group---

 

Can you help me please ?

Link to comment
Share on other sites

The function whose hide the products doesn't work
Are you sure the field in the database is getting filled (check with phpMyAdmin)? I'm suspicious about this:

'hide[' . ($i++) . ']',

I have a feeling this doesn't work and that it should be something like:

 ? ? ?tep_draw_checkbox_field(
? 'hide['. $i. ']',
? $customers_groups['customers_groups_id'] ,
? $check_hidden) . ' '
? . $customers_groups['customers_groups_name'].'</td></tr>';
$i++;
? ? ? ? }#End of while

Better do a "view source" in the admin section if you see those checkboxes. The source code should read something like name="hide[1]" and not something like name="hide[(1)]" which I'm afraid it does.

Link to comment
Share on other sites

You're right : the field products_hide_from_groups isn't getting filled.

 

But if I put a valor myself, it's doesnt work no longer ...

 

Another question : With the B2B contribution (without hide price), is it normal that in the products' list and in the what's new box the price are 0 or a number like 325 for a product whose cost 50???

Link to comment
Share on other sites

But if I put a valor myself, it's doesnt work no longer ...
Sure you put it in as:

No value: @

One value: @,2

Two values: @,2,1

etcetera?

Another question : With the B2B contribution (without hide price), is it normal that in the products' list and in the what's new box the price are 0 or a number like 325 for a product whose cost 50???
Never installed B2B, but I think you already know that it doesn't sound like it should be.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...