Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Does this allow for seperate Whole sale and Retail prices? How does it work exactly, when someone signs up, are they set as a Retailer until the Admin adds them to the Wholesaler group?

 

Is it easy to add prices for the different groups? Is it within the product page or do you have to add the seperate prices in it's own page separate from the product information (similar to how you have to go to a special section to modify the options of the product)

 

You could also see this link for complete instructions on how it works!

Best & Thanks;
Marvin
----------------------
osCommerce 2.3.3.4 

Link to comment
Share on other sites

I was wondering if it is possible with this Contrib to also show only certain products to the Wholesalers that the retail customers can not see? Not just price differences?

If you would have read a few posts back you could have figured out that:

a. it doesn't at the moment

b. people are working on a modification of this contribution so it does.

 

The modification could be based on one for another contribution. Provided that works (and I do suppose it does) it only needs the admin side fixed. As a matter of fact I'm almost finished with that, so I do hope it works.

Link to comment
Share on other sites

wow JanZ, you rock! :thumbsup:

Just added the percent hack code for use in the categories.php, and it works real sweet :D

Took me a couple of days to get the contrib to work besides other contribs I had installed (EP,admin login, etc), as at first for some strange reason I couldnt access my products anymore as retail customer (I could when logged in as customer in a customer group), but now with the new version 4.1, that somehow is fixed as well.

 

You're doing all this lots of work for free!? I find that very noble of you, but isnt there a way (paypal or something) I/we could support you ? I would if I could cause it's a great contrib and really helps me a lot to recreate this website with shop the way I need to. B)

Link to comment
Share on other sites

Eelco,

Just added the percent hack code for use in the categories.php, and it works real sweet :D

Took me a couple of days to get the contrib to work besides other contribs I had installed (EP,admin login, etc), as at first for some strange reason I couldnt access my products anymore as retail customer (I could when logged in as customer in a customer group), but now with the new version 4.1, that somehow is fixed as well.

Glad to hear you have everything working fine.

You're doing all this lots of work for free!? I find that very noble of you, but isnt there a way (paypal or something) I/we could support you ? I would if I could cause it's a great contrib and really helps me a lot to recreate this website with shop the way I need to.  B)

I think Marvin will agree with me that if you want to something monetary, it should be best to sponsor osCommerce.
Link to comment
Share on other sites

Ok I'll give that a thought ;)

 

The only thing I'm still looking to be possible, is to also actually store those deduction percentages as percentages, as right now it converts into the price of the product minus the deduction percentage, and than stores that deducted price.

 

The reason I'm asking this is that would the default price be changed (using EasyPopulate or even manually), these customer group prices with a deduction prices wouldnt change along, meaning they all have to be changed one by one as well, while they actually are dependent on the basic price with this deduction percentage.

 

Prolly I'm asking too much now :) , but at least I've mentioned it, will have a look at it myself (just that im actually a novice php programmer and I'm not that really used to the osC and SPPC coding yet)

Link to comment
Share on other sites

There are some awesome additions in this update (v4.1). I love the restricted payment/shipment options for groups AND for customers. Great job Marvin and JanZ!

 

Unfortunately I cannot use it, because I can't get the "Product Attributes - Option Type Feature" to work perfectly with it. I DID, however, install SPPC v4.1 on a new test store just to check it out.

 

Again, fantastic work!

Link to comment
Share on other sites

Eelco,

meaning they all have to be changed one by one as well, while they actually are dependent on the basic price with this deduction percentage.
My personal feeling is that if you have all your products with customer group prices and the customer group price is dependent on the retail price by a percentage it would be much faster to use an sql script. You should change it depending on the customer group and percentage:

truncate products_groups;

insert into products_groups select '1' AS customers_group_id, (0.8 * p.products_price) AS customers_group_price, p.products_id FROM products p;

Truncate empties the table and then with the "insert into" it is filled again. Obviously the 0.8 reflects a 20% reduction.

 

With the manual entry i would think a simple JavaScript to change the field with the customer group price (like the retail price including sales tax on the admin/categories.php does) might work the fastest and cleanest (instant feed back). Haven't looked at it I must confess.

Link to comment
Share on other sites

I too have installed the 4.1 version (update from 4.o). I agree that the inclusion of payment and shipping options for groups is a wonderful improvement.

 

I only have one very, very minor suggestion regarding documentation in the files themselves. I suggest that the line where it announces that the file has been adapted for SPPC be standardised across all the files. At the moment, files show different SPPC versions (I suggest it say v.4.1) and dates (I suggest it show the date that the contribution was ready for uploading to the osC contribution page.

 

All kudos to Jan and Marvin for their tireless efforts to bring this contribution to life.

Link to comment
Share on other sites

Eelco,

 

Provided there are known relationships between customer group prices and the retail price, simply adding and changing some JavaScript in the admin/categories.php page will do automatic changing of prices when either the net or the gross price is changed. Changes are: adding update_cg_prices to updateGross and updateNet. Adding of the function update_cg_prices:

function updateGross() {
 var taxRate = getTaxRate();
 var grossValue = document.forms["new_product"].products_price.value;

 if (taxRate > 0) {
   grossValue = grossValue * ((taxRate / 100) + 1);
 }

 document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);
 update_cg_prices();
}

function updateNet() {
 var taxRate = getTaxRate();
 var netValue = document.forms["new_product"].products_price_gross.value;

 if (taxRate > 0) {
   netValue = netValue / ((taxRate / 100) + 1);
 }

 document.forms["new_product"].products_price.value = doRound(netValue, 4);
 update_cg_prices();
}

function update_cg_prices() {
var retail_price = document.forms["new_product"].products_price.value;
sppc_price_1 = 0.8 * retail_price;
sppc_price_2 = 0.7 * retail_price;
document.forms["new_product"].elements['sppcprice[1]'].value = doRound(sppc_price_1, 4)
document.forms["new_product"].elements['sppcprice[2]'].value = doRound(sppc_price_2, 4)
}
//--></script>

Of course this needs adaptation to your own situation...

Link to comment
Share on other sites

I have just installed ver. 4.0. How do I import my additional whole sale price from an excel? Is this possible?

 

I've been trying forever to get easy populate to work with the separat pricing per customer mod, and I finally figured out how (I couldn't find it in any of the forums, so this is my first useful contribution here).

 

Somewhere in the middle of easypopulate.php, you'll find the following lines-

// uncomment the customer_price and customer_group to support multi-price per product contrib

  $filelayout = array(

  'v_products_model'  => $iii++,

  'v_products_price'  => $iii++,

  'v_products_quantity'  => $iii++,

  'v_customer_price_1'  => $iii++,

  'v_customer_group_id_1'  => $iii++,

  'v_customer_price_2'  => $iii++,

  'v_customer_group_id_2'  => $iii++,

  'v_customer_price_3'  => $iii++,

  'v_customer_group_id_3'  => $iii++,

  'v_customer_price_4'  => $iii++,

  'v_customer_group_id_4'  => $iii++,

 

Actually, these line will be commented out.? For each customer group you have, uncomment one of the lines...I believe this includes your retail group, so if you have normal prices, and local prices (as I do) uncomment group id #1 and #2

 

 

Towards the bottom of the EP file, you can find where it breaks up the info from your text file into sql data.? It looks like this:

// and insert the new record

?  if ($v_customer_price_1 != ''){

? ? $result = tep_db_query('

? ? ?  INSERT INTO

? ? ? ? '.TABLE_PRODUCTS_GROUPS.'

? ? ?  VALUES

? ? ?  (

? ? ? ? ' . $v_customer_group_id_1 . ',

? ? ? ? ' . $v_customer_price_1 . ',

? ? ? ? ' . $v_products_id . ',

? ? ? ? ' . $v_products_price .'

? ? ? ? )'

? ? ?  );

?  }

?  if ($v_customer_price_2 != ''){

? ? $result = tep_db_query('

? ? ?  INSERT INTO

? ? ? ? '.TABLE_PRODUCTS_GROUPS.'

? ? ?  VALUES

? ? ?  (

? ? ? ? ' . $v_customer_group_id_2 . ',

? ? ? ? ' . $v_customer_price_2 . ',

? ? ? ? ' . $v_products_id . ',

? ? ? ? ' . $v_products_price . '

? ? ? ? )'

? ? ?  );

?  }

?  if ($v_customer_price_3 != ''){

? ? $result = tep_db_query('

? ? ?  INSERT INTO

? ? ? ? '.TABLE_PRODUCTS_GROUPS.'

? ? ?  VALUES

? ? ?  (

? ? ? ? ' . $v_customer_group_id_3 . ',

? ? ? ? ' . $v_customer_price_3 . ',

? ? ? ? ' . $v_products_id . ',

? ? ? ? ' . $v_products_price . '

? ? ? ? )'

? ? ?  );

?  }

?  if ($v_customer_price_4 != ''){

? ? $result = tep_db_query('

? ? ?  INSERT INTO

? ? ? ? '.TABLE_PRODUCTS_GROUPS.'

? ? ?  VALUES

? ? ?  (

? ? ? ? ' . $v_customer_group_id_4 . ',

? ? ? ? ' . $v_customer_price_4 . ',

? ? ? ? ' . $v_products_id . ',

? ? ? ? ' . $v_products_price . '

? ? ? ? )'

? ? ?  );

?  }

 

? }

 

The last part of these groups - ' . $v_products_price . ' - is not needed. Must've been a mistake. Erase that whole line. I don't know much about php or sql so I don't know why commenting the line won't work...but it won't.

 

Anyway, the line above the one you just erased has a comma at the end of it. Erase the comma so that sql knows to start another line.

 

I think that's it. Everything worked for me after that.

 

Just download the model/price/qty file, update what you need to update, and upload it again.

 

I have it working at http://shopping.essonline.us

Edited by theengel
Link to comment
Share on other sites

To hide products from customer groups, you should be able to use the Hide products from groups of customers contribution that was written for another contribution but should be applicable to SPPC too (have only checked it on the index.php page). I changed the admin code for the page admin/categories.php to make it work for SPPC. This adapted code also fixes the state of the check boxes in customers group prices when you press the back button after a preview.

 

Perhaps Caroline/goutbouyo can make this into a contribution? ;) :thumbsup:

Run the following sql command to add a column to the table products:

ALTER TABLE products ADD products_hide_from_groups VARCHAR(255) DEFAULT '@' NOT NULL;

/admin/categories.php

Line 4

***REPLACE***

 adapted for Separate Pricing Per Customer v4 2005/02/17
 
***WITH***
 
 adapted for Separate Pricing Per Customer v4.1, hide for these groups mod 2005/03/19
 
Line 211
 
***AFTER***

         $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';
         
***ADD***

// BOF Separate Price Per Customer, hide for these groups modification
         $hide_from_these_groups = '@,';
            if ( $HTTP_POST_VARS['hide'] ) { // if any of the checkboxes are checked
     foreach($HTTP_POST_VARS['hide'] as $val) {
     $hide_from_these_groups .= tep_db_prepare_input($val).','; 
     } // end foreach
     $hide_from_these_groups = substr($hide_from_these_groups,0,strlen($hide_from_these_groups)-1); // remove last comma
  }
// EOF Separate Price Per Customer, hide for these groups modification

Line 219-226

***REPLACE***

         $sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),
                                 'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),
                                 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),
                                 'products_date_available' => $products_date_available,
                                 'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),
                                 'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),
                                 'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),
                                 'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));


***WITH***

         $sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),
                                 'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),
                                 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),
                                 'products_date_available' => $products_date_available,
                                 'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),
                                 'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),
                                 'products_tax_class_id' =>  tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),
// BOF Separate Price Per Customer, hide for these groups modification
     'products_hide_from_groups' => $hide_from_these_groups,
// EOF Separate Price Per Customer, hide for these groups modification
                                 'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));

Line 388-408

***REPLACE***

 if ($action == 'new_product') {
   $parameters = array('products_name' => '',
                      'products_description' => '',
                      'products_url' => '',
                      'products_id' => '',
                      'products_quantity' => '',
                      'products_model' => '',
                      'products_image' => '',
                      'products_price' => '',
                      'products_weight' => '',
                      'products_date_added' => '',
                      'products_last_modified' => '',
                      'products_date_available' => '',
                      'products_status' => '',
                          'products_tax_class_id' => '',
                      'manufacturers_id' => '');

   $pInfo = new objectInfo($parameters);

   if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
     $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

***WITH***

 if ($action == 'new_product') { 
   $parameters = array('products_name' => '',
                      'products_description' => '',
                      'products_url' => '',
                      'products_id' => '',
                      'products_quantity' => '',
                      'products_model' => '',
                      'products_image' => '',
                      'products_price' => '',
                      'products_weight' => '',
                      'products_date_added' => '',
                      'products_last_modified' => '',
                      'products_date_available' => '',
                      'products_status' => '',
                          'products_tax_class_id' => '',
// BOF SPPC hide from groups mod
                      'products_hide_from_groups' => '',
// EOF SPPC hide from groups mod
                      'manufacturers_id' => '');


   $pInfo = new objectInfo($parameters);

   if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) { // BOF SPPC hide from groups mod
     $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.products_hide_from_groups, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); // EOF SPPC hide from groups mod
     
Line 561-610

***REPLACE***

All lines, between:

<!-- BOF Separate Pricing Per Customer -->

and

<!-- EOF Separate Pricing Per Customer -->

***WITH***

<!-- BOF Separate Pricing Per Customer -->
<?php
   $customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
   $header = false;
   while ($customers_group = tep_db_fetch_array($customers_group_query)) {
    
    if (tep_db_num_rows($customers_group_query) > 0) {
      $attributes_query = tep_db_query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $pInfo->products_id . "' and customers_group_id = '" . $customers_group['customers_group_id'] . "' order by customers_group_id");
    } else {
        $attributes = array('customers_group_id' => 'new');
    }
if (!$header) { ?>

   <tr bgcolor="#ebebff"">
   <td class="main" colspan="2" style="font-style: italic">Note that if a field is left empty, no price for that customer group will be inserted in the database.<br />
If a field is filled, but the checkbox is unchecked no price will be inserted either.<br />
If a price is already inserted in the database, but the checkbox unchecked it will be removed from the database.
</td>
   </tr>
<?php 
$header = true; 
} // end if (!header), makes sure this is only shown once   
?>
       <tr bgcolor="#ebebff">
      <td class="main"><?php 
            if (isset($pInfo->sppcoption)) {
   echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', (isset($pInfo->sppcoption[ $customers_group['customers_group_id']])) ? 1: 0);
     } else {
     echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', true) . ' ' . $customers_group['customers_group_name'];
     }
?>
 </td>
      <td class="main"><?php 
      if ($attributes = tep_db_fetch_array($attributes_query)) { 
      echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcprice[' . $customers_group['customers_group_id'] . ']', $attributes['customers_group_price']); 
      }  else {
       if (isset($pInfo->sppcprice[$customers_group['customers_group_id']])) { // when a preview was done and the back button used
        $sppc_cg_price = $pInfo->sppcprice[$customers_group['customers_group_id']];
       } else { // nothing in the db, nothing in the post variables
        $sppc_cg_price = '';
       }
   echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcprice[' . $customers_group['customers_group_id'] . ']', $sppc_cg_price);
 }  ?></td>
   </tr>
<?php
       } // end while ($customers_group = tep_db_fetch_array($customers_group_query))
?>
<!-- BOF SPPC hide from groups mod -->
         <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
         </tr>
         <tr>
           <td colspan="2" class="main" ><?php echo TEXT_HIDE_PRODUCTS_FROM_GROUP; ?></td>
         </tr>
<?php   
  $hide_customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id");
  $hide_from_groups_array = explode(',',$pInfo->products_hide_from_groups);
  $hide_from_groups_array = array_slice($hide_from_groups_array, 1); // remove "@" from the array
  while ($hide_customers_group = tep_db_fetch_array($hide_customers_group_query)) {
?>
     <tr bgcolor="#ebebff">
      <td class="main" colspan="2"><?php 
     if (isset($pInfo->hide)) {
   echo tep_draw_checkbox_field('hide[' . $hide_customers_group['customers_group_id'] . ']',  $hide_customers_group['customers_group_id'] , (isset($pInfo->hide[ $hide_customers_group['customers_group_id']])) ? 1: 0);
     } else {
     echo tep_draw_checkbox_field('hide[' . $hide_customers_group['customers_group_id'] . ']',  $hide_customers_group['customers_group_id'] , (in_array($hide_customers_group['customers_group_id'], $hide_from_groups_array)) ? 1: 0);
     } ?>??<?php echo $hide_customers_group['customers_group_name']; ?></td>
     </tr>
<?php
       } // end while ($hide_customers_group = tep_db_fetch_array($hide_customers_group_query))
?>
         <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
         </tr>
<!-- EOF Separate Pricing Per Customer -->


admin/includes/languages/english/categories.php

***ADD**

// BOF Hide product from groups
define('TEXT_HIDE_PRODUCTS_FROM_GROUP', 'Select Groups To Hide This Product From:');
// BOF Hide product from groups

catalog/index.php

Around line 245-249:

***REPLACE***

// EOF Separate Pricing per Customer
     }
   }

   if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
   
***WITH***

// EOF Separate Pricing per Customer
     }
   }
// BOF hide products from group
$listing_sql .= " and  find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 ";
// EOF hide products from group

   if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

 

In the same fashion change all the necessary sql's, see the Hide products from groups of customers contribution.

Link to comment
Share on other sites

Hi JanZ,

 

just installed the 4.1 version and upgraded to 4.1.1. Everything works perfectly. Thank you for the time and effort spend to develop this contribution.

 

May I ask you to elaborate a little bit more on how to show the retail price together with the wholesale (or any other groups price) in the product_info page, when the customer does not belong to the retail group. In this way the customer will know first hand what the difference in the price is between his group and the retail group.

 

e.g. Retail Price 100 EUR

Your Price 80 EUR

 

I read the instructions in the 4.1.1 changelog txt file about this matter but since I am not a programmer I cannot find out what to do exactly.

 

Yiannis :blink:

Link to comment
Share on other sites

Yiannis,

 

This is an example how you could show a list price. Of course you might want to put this in another spot, another font etc. The below code is a replacement for lines 81 (starting with $product_info_query) to 105 (ends just before: if (tep_not_null($product_info['products_model'])) } )

 

    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_price as list_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
// 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'];
}
$products_price = '';
if ($customer_group_id != '0') {
$products_price = '<span class="smallText">List Price: ';
$products_price .= $currencies->display_price($product_info['list_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
$products_price .= '</span><br>'; // customer group prices on the next line end of small text for retail prices	
}
     $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>';
// EOF Separate Price per Customer
   } 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'];
}

$products_price = '';
if ($customer_group_id != '0') {
$products_price = '<span class="smallText">List Price: ';
$products_price .= $currencies->display_price($product_info['list_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
$products_price .= '</span><br>'; // customer group prices on the next line end of small text for retail prices	
}

     $products_price .= $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
     // EOF Separate Price per Customer
   }

Link to comment
Share on other sites

On behalf of JanZ I would like to announce Quantity Price Breaks for Separate Pricing Per Customer

 

http://www.oscommerce.com/community/contributions,3039

 

This is a SPPC add-on that:

1) Allows quantity based pricing per product per customer group

2) Allow the ability to sell a product inlots of # quantity only

 

Once again JanZ has put his time and effort into helping the OScommerce community (especially all us SPPC users). Many Thanks!

Link to comment
Share on other sites

Eelco,

My personal feeling is that if you have all your products with customer group prices and the customer group price is dependent on the retail price by a percentage it would be much faster to use an sql script. You should change it depending on the customer group and percentage:

truncate products_groups;

insert into products_groups select '1' AS customers_group_id, (0.8 * p.products_price) AS customers_group_price, p.products_id FROM products p;

Truncate empties the table and then with the "insert into" it is filled again. Obviously the 0.8 reflects a 20% reduction.

 

Well the 'problem' is that not only do separate customers have seperate agreements on deduction percentages, but also the deduction percentage differs per product (customer A can have 30% deduction on product 1, 20% on product 2, while customer B can have 20% deduction on product 1 and 10% on product 2, and a retail customer just sees all products with their full price).

 

Therefore my cry for a possible way out of this :(

 

I'll have a look at the coding you suggested on the manual updating to see if that helps me any further.

Edited by Eelcovdg
Link to comment
Share on other sites

Eelco,

a possible way out of this
I don't know if it is applicable in your case, but it seems that Easy Populate (a way to update the database tables using a spread sheet like Excel) can be used to update the products_groups table (see post 665). I have never used Easy Populate or even looked at it, so I can't be of help there.

 

It looks like you haven taken "Separate Pricing Per Customer" literal ;)

Link to comment
Share on other sites

Jan, I am wanting to use a contribution that gives a discount based on the total size of the order (ie global quantity based, not individual product quantity based). this contribution seems to be the one I need: http://www.oscommerce.com/community/contri...ons,1159/page,6

 

can you tell me what modifications I would need to make to have it run with SPPC?

 

Once again, let me add my voice to the chorus of 'it is a fantastic thing that you are doing with this SPPC contribution'

 

Piquet

Link to comment
Share on other sites

Piquet,

can you tell me what modifications I would need to make to have it run with SPPC?
From a quick glance, I don't think they should interfere with each other. That module takes it information from what is in the shopping cart already, it doesn't look up any prices. You should be fine I think.

 

Thanks for your compliments. I'm not the only one doing this though, Marvin and Nate play a big part too with beta testing, documenting, and proposing functionality.

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...