Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

Hi,

 

Just a simple question, but I still haven't got this working, I've been trying for ages, could someone possibly show me the code to use to show information I decid only to show to customers in a specific group once they are logged in?

 

For example : This is a good seller for beginners (text for wholesalers not for Public).

 

Any help of any kind would be appreciated.

 

Thanx folks.

Share this post


Link to post
Share on other sites
For example : This is a good seller for beginners (text for wholesalers not for Public).
I guess this should do the trick:

<?php
// next line only necessary inside functions, might depend on where you put it in your code
// global $sppc_customer_group_id;
if $sppc_customer_group_id == '1') { // assuming wholesale has customer_group_id 1
echo 'This is a good seller for beginners';
}
?>

Share this post


Link to post
Share on other sites

Hey Jan,

 

Can you post me your shopping_cart.php files (both of them) here so that I can compare them to mine for Salemaker to work with SPPC?

 

I'd appreciate it.

 

I can get it to work up to the point in the shopping cart. It continues to show the regular price instead of the sale price. There is a piece of coding I had to use instead of what was in Salemaker's install file (found the code here on the OSC forums).

 

If you want, I can post you my shopping_cart.php files ... But, if you let me compare to yours I may be able to fix the issue. Thanks much!

 

Julie

Share this post


Link to post
Share on other sites

Julie,

Can you post me your shopping_cart.php files (both of them) here so that I can compare them to mine for Salemaker to work with SPPC?
The includes/classes/shopping_cart.php is the one in the Quantity Price Breaks for SPPC contribution wasn't changed for Salemaker (because the price thing is done in the class PriceFormatter.php, that one is changed by Salemaker). The other two shopping_cart.php files (one box, one in admin) are not changed for any of these contributions.

Share this post


Link to post
Share on other sites

i will in my shop SPPC insert and in germany we must have the tax display by price on the product_info.php

 

I will make 3 Groups:

 

1. customers (germany) tax-display incl.Vat + shipping

2. Dealer (germany) tax-display excl.Vat + shipping

3. Dealer (europe) tax-disply no_Vat + shipping

 

Can you tell me what can i do ?

Share this post


Link to post
Share on other sites
I will make 3 Groups:

 

1. customers (germany) tax-display incl.Vat + shipping

2. Dealer (germany) tax-display excl.Vat + shipping

3. Dealer (europe) tax-disply no_Vat + shipping

 

Can you tell me what can i do ?

Make dealer (germany) and dealer (europe) "tax exempt" and "show price without tax" in the admin section (customer_group.php). Did I miss anything in your question?

Share this post


Link to post
Share on other sites

1. customers (germany) tax-display incl.Vat + shipping

18.00EUR

[inkl. 16% VAT zzgl. shipping]

2. Dealer (germany) tax-display excl.Vat + shipping

18.00EUR

[excl. 16% VAT zzgl. shipping]

 

3. Dealer (europe) tax-disply no_Vat + shipping

18.00EUR

[taxfree zzgl. shipping]

 

this i must have as a show by price create in the admin is no problem but its must be show by price.

 

the tax_info contrieb is not the rigth for this.

Share this post


Link to post
Share on other sites

Klaus,

 

I think you want something like this (this doesn't handle the special prices, but this is just to see if this is what you mean) (changed code for product_info.php, around line 102 and further):

// EOF Separate Price per Customer

     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
     if ($customer_group_id == '1') { // dealer Germany
      $products_price .= "<br />\n[excl. 16% VAT zzgl. shipping]";
     } elseif ($customer_group_id == '1') { // dealer Europe
      $products_price .= "<br />\n[taxfree zzgl. shipping]";
     } else { // retail customers
      $products_price .= "<br />\n[inkl. 16% VAT zzgl. shipping]";
     } // end if ($customer_group_id == '1')
   }

   if (tep_not_null($product_info['products_model'])) {

Share this post


Link to post
Share on other sites

can you tell me what can i do for the configuration the SPPC

 

i can do a membergroup but who can i make the price for group 1,2,3,4..

 

group 1 = 10%

group2 = 2%

 

i cant configurea price i will make a b2b/b2c-shop what for contriebs must i have with sppc ?

Share this post


Link to post
Share on other sites
I wondered if it is posible to put the price break of sppc on a category instead of on a single product? :s

No, sorry. But knowing what you want to do you should look at post 912 a couple of pages back. There is an example of using other items in the cart to calculate a price break. You need something different, since you need to give a price break only on items that are in the same category, so additional code is needed (a separate function in the cart class I would think of) but that is the direction you should take IMHO.

Share this post


Link to post
Share on other sites

I have sleep :-" its works :blush:

This must i have in germany show tax by price:

1. customers (germany) tax-display incl.Vat + shipping
CODE
18.00EUR

[inkl. 16% VAT zzgl. shipping]

2. Dealer (germany) tax-display excl.Vat + shipping
CODE
18.00EUR

[excl. 16% VAT zzgl. shipping]


3. Dealer (europe) tax-disply no_Vat + shipping
CODE
18.00EUR

[taxfree zzgl. shipping]

 

This is my product_info.php/SPPC

 

    // BOF Separate Price per Customer

       $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_id . "'");
       if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
       $product_info['products_price']= $scustomer_group_price['customers_group_price'];
}
// EOF Separate Price per Customer

     $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 {
// BOF Separate Price per Customer
       $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_id . "'");
       if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
       $product_info['products_price']= $scustomer_group_price['customers_group_price'];
}
// EOF Separate Price per Customer

Must i complet change the mod of SPPC can you please make this. :'(

I have BTS in my store and the lines code is not the same.

(changed code for product_info.php, around line 102 and further):
CODE
// EOF Separate Price per Customer

    $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
    if ($customer_group_id == '1') { // dealer Germany
     $products_price .= "<br />\n[excl. 16% VAT zzgl. shipping]";
    } elseif ($customer_group_id == '1') { // dealer Europe
     $products_price .= "<br />\n[taxfree zzgl. shipping]";
    } else { // retail customers
     $products_price .= "<br />\n[inkl. 16% VAT zzgl. shipping]";
    } // end if ($customer_group_id == '1')
  }

  if (tep_not_null($product_info['products_model'])) {

Share this post


Link to post
Share on other sites
i can do a membergroup but who can i make the price for group 1,2,3,4..

 

group 1 = 10%

group2 = 2%

 

i cant configurea price i will make a b2b/b2c-shop  what for contriebs must i have with sppc ?

There is no such provision for group discounts in SPPC, it is all done on the individual product level. That doesn't mean you can't automate a few things. You can do an initial filling of the table products_groups using sql statements using products_price, the group discount etc.

 

On the admin page where you put in the prices you can add some JavaScript that takes the product price and uses the discount to change the price in the input box (kind of like it is done for price including tax). I think somewhere in this thread I posted an example of such code.

Share this post


Link to post
Share on other sites
Must i complet change the mod of SPPC can you please make this.

I have BTS in my store and the lines code is not the same.

But I'm not familiar with the BTS code, so I can't tell you where you have to put those changes in the code.... :(

Share this post


Link to post
Share on other sites
But I'm not familiar with the BTS code, so I can't tell you where you have to put those changes in the code.... :(

I can change it self, but i mean the orginal code of sppc who must it repleace/add/insert ?

must i change a line

// EOF Separate Price per Customer

    $products_price = '<s>' . $currencies->display_price($product_info['products_price'],

with this

(changed code for product_info.php, around line 102 and further):
CODE
// EOF Separate Price per Customer

   $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   if ($customer_group_id == '1') { // dealer Germany
    $products_price .= "<br />\n[excl. 16% VAT zzgl. shipping]";
   } elseif ($customer_group_id == '1') { // dealer Europe
    $products_price .= "<br />\n[taxfree zzgl. shipping]";
   } else { // retail customers
    $products_price .= "<br />\n[inkl. 16% VAT zzgl. shipping]";
   } // end if ($customer_group_id == '1')
 }

 if (tep_not_null($product_info['products_model'])) {

or repleace the complet mod

    // BOF Separate Price per Customer

      $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_id . "'");
      if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
      $product_info['products_price']= $scustomer_group_price['customers_group_price'];
}
// EOF Separate Price per Customer

    $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 {
// BOF Separate Price per Customer
      $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_id . "'");
      if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
      $product_info['products_price']= $scustomer_group_price['customers_group_price'];
}
// EOF Separate Price per Customer

Edited by nervens?ge

Share this post


Link to post
Share on other sites
No, sorry. But knowing what you want to do you should look at post 912 a couple of pages back. There is an example of using other items in the cart to calculate a price break. You need something different, since you need to give a price break only on items that are in the same category, so additional code is needed (a separate function in the cart class I would think of) but that is the direction you should take IMHO.

 

 

Thnx Jan, that will help me on my way i think. But if i'm correct that is for all products, right? So if i want it for only each category i can use that code combined with making a new one to seperate my categorys in my cart class??


Even in this dark place, yes, I am afraid of my own shadow.

 

 

 

Contributions | KnowledgeBase | osCommerce 2.2 pdf

Share this post


Link to post
Share on other sites
I can change it self, but i mean the orginal code of sppc who must it repleace/add/insert ?

must i change a line

Yes, change the line:

   $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));

to:

[CODE]   $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
  if ($customer_group_id == '1') { // dealer Germany
   $products_price .= "<br />\n[excl. 16% VAT zzgl. shipping]";
  } elseif ($customer_group_id == '1') { // dealer Europe
   $products_price .= "<br />\n[taxfree zzgl. shipping]";
  } else { // retail customers
   $products_price .= "<br />\n[inkl. 16% VAT zzgl. shipping]";
  } // end if ($customer_group_id == '1')

and you should be fine.

Share this post


Link to post
Share on other sites
But if i'm correct that is for all products, right? So if i want it for only each category i can use that code combined with making a new one to seperate my categorys in my cart class??

Yes, that is the idea. Probably, you will have to change the queries and the class to also have the category id available for each product. Then a new function should be made that instead of tep_get_products loops through that array too, but only gets the number of products from the same category.

Share this post


Link to post
Share on other sites

must i make it so ?

 

if ($customer_group_id == '1') //customer

if ($customer_group_id == '2') //dealer-german

if ($customer_group_id == '3') //dealer-europe

 

or is this a automatic generate the correct tax show on price ?

Share this post


Link to post
Share on other sites
Yes, that is the idea. Probably, you will have to change the queries and the class to also have the category id available for each product. Then a new function should be made that instead of tep_get_products loops through that array too, but only gets the number of products from the same category.

 

How about, instead of putting those colums with every product (and filling it in each time) why not put it as an option in each category? Or does that sounds a lot easier then it is :s


Even in this dark place, yes, I am afraid of my own shadow.

 

 

 

Contributions | KnowledgeBase | osCommerce 2.2 pdf

Share this post


Link to post
Share on other sites

Bye the way Jan, what does this mean:

 

Switch off alert for authentication: Alert off Alert on

 

 

Its in my customers-page - and when i turn it on, it gives a red dot under RA-column. But what does it do? :s

 

Greets, tom


Even in this dark place, yes, I am afraid of my own shadow.

 

 

 

Contributions | KnowledgeBase | osCommerce 2.2 pdf

Share this post


Link to post
Share on other sites

 $products_price = $currencies->display_price($product_info['products_price'],
 tep_get_tax_rate($product_info['products_tax_class_id']));
if ($customer_group_id == '1') { // dealer Germany
$products_price .= "<br />\n[dealer Germany]";
} elseif ($customer_group_id == '2') { // dealer Europe
$products_price .= "<br />\n[dealer Europe]";
} else { // retail customers
$products_price .= "<br />\n[customers]";
} // end if ($customer_group_id == '1')

 

customers/ group retail

dealer Germany/ group 1

dealer Europe/ group 2

 

its works thanks

Share this post


Link to post
Share on other sites

Tom,

How about, instead of putting those colums with every product (and filling it in each time) why not put it as an option in each category? Or does that sounds a lot easier then it is

Since in general it is exceptional that all products in the same category have the same price, that case was never coded for in osC and not in SPPC either. All the code that I have seen so far and that looks up a price, never takes the category in consideration.

what does this mean:

 

Switch off alert for authentication: Alert off Alert on

 

Its in my customers-page - and when i turn it on, it gives a red dot under RA-column. But what does it do?

It alerts you, nothing more, nothing less. It is used to quickly scan for customers who opened an account and filled in a tax id number (these are customers you need to check out and put them in another customer group). Since putting customers is done manually, it is nice to have a visual clue as to which new customers need "special attention". It doesn't "do" anything further.

Share this post


Link to post
Share on other sites

that is my code from product_info.php around text indicates depending upon customer group with the price to receive. so that it for Germany would be correct would have I in the whole shop to insert where price indicates is and that is very much the correct would be if this indicates of includes/classes/currencies.php is steered.

$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
if ($customer_group_id == '2') { // dealer Germany
$products_price .= "<br />\n[dealer Germany]";
} elseif ($customer_group_id == '3') { // dealer Europe
$products_price .= "<br />\n[dealer Europe]";
} elseif ($customer_group_id == '1') { // retail customers
$products_price .= "<br />\n[customers]";
}

here is my code of tax_info can to me someone say like that to be inserted there can?

  function display_price($products_price, $products_tax, $quantity = 1) {
        if (TAX_INFO_ONOFF == 'Enabled') {
        $return = $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
        global $tag;
        $return .= "<br><div class=\"tax_info\">" . sprintf(TEXT_INFO_TAX, $products_tax , tep_href_link(FILENAME_SHIPPING)) . "</div>";
        return $return;
        } else {
        return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
      }

Share this post


Link to post
Share on other sites
here is my code of tax_info can to me someone say like that to be inserted there can?
Looks indeed a much simpler solution to add it there. You would need three different TEXT_INFO_TAX according to customer_group_id of course and I assume the TAX_INFO_ONOFF comes from some other contribution?

 ?function display_price($products_price, $products_tax, $quantity = 1) {
? ? ? ? if (TAX_INFO_ONOFF == 'Enabled') {
? ? ? ? $return = $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
? ? ? ? global $tag;
if ($customer_group_id == '2') {
$text_info_tax = TEXT_INFO_TAX2;
} elseif ($customer_group_id == '3') {
$text_info_tax = TEXT_INFO_TAX3;
} else {
$text_info_tax = TEXT_INFO_TAX;
}

? ? ? ? $return .= "<br><div class=\"tax_info\">" . sprintf($text_info_tax, $products_tax , tep_href_link(FILENAME_SHIPPING)) . "</div>";
? ? ? ? return $return;
? ? ? ? } else {
? ? ? ? return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
? ? ? }

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

×