Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

Normaly Quick Discount Module For SPPC creates the discount price based on the product price.

 

I want to change that. So Quick Discounts Module For SPPC creates the discount price only based on the product price if there is no customer group based product price for the choosen customer group. If there is a customer group based product price Quick Discount Module For SPPC should create the discount price based on the customer group based product price.

No that also doesn't fit my needs. I don't want to overwrite the customers_products_price with an discount value. I want a new entry for prices with given discount.

 

But I figured out what I need:

			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * p.products_price), p.products_id from products p");

Sadly this doesn't help me because when I have a product without sppc price (but with a discount) the sppc price is automaticaly set to 0.000.

The way SPPC was set up will make this will not work the way you want to do it now. If there is no sppc price in products_groups, automatically the retail price is used. When there is an entry in the table products_groups for a products_id the sppc price will be taken from that table.

 

Perhaps you can store your customers_group_discount_price in a separate table that you left join with products_groups to get either the sppc price or the customer_group_discount_price.

$products_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p");
$products = tep_db_fetch_array($products_query);

for ($count = 1; $count <= count($products); $count++) {
 if ($products_groups['customers_group_id'] == $sppc['customers_group_id']) { //only use the selected customer group
if ($products_groups['customers_group_price'] == '') { //no customer group price defined
	tep_db_query ("insert into products_groups_discounts (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * p.products_price), p.products_id from products p where p.products_id=".$count);
} else if ($products_groups['customers_group_price'] > '0') { //customer group price defined
	tep_db_query ("insert into products_groups_discounts (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * pg.customers_group_price), p.products_id from products_groups pg, products p where p.products_id=".$count." and pg.customers_group_id=". $sppc['customers_group_id']");
}
 }	 
}

But there are some failures within:

2. The for statement doesnt work. the result is always only the first product from products table.

True, because you only retrieved the first result of the query. You need to use while ($products = tep_db_fetch_array($products_query)); and then you don't need the for loop either.

Share this post


Link to post
Share on other sites
I have RC2a and i wont install the sppc... they are changes on de database?

The changes on the database by RC2a do not conflict with the changes for SPPC. From what I have seen so far is that you can still add SPPC manually to RC2a. Only (so far) on admin/products_attributes.php this will be different. Quite a few code changes (not so in other files, although all the id tags have changed making the diffs not working on adding the SPPC "tag line" as line 4).

Share this post


Link to post
Share on other sites
The way SPPC was set up will make this will not work the way you want to do it now. If there is no sppc price in products_groups, automatically the retail price is used. When there is an entry in the table products_groups for a products_id the sppc price will be taken from that table.

 

Perhaps you can store your customers_group_discount_price in a separate table that you left join with products_groups to get either the sppc price or the customer_group_discount_price.

 

True, because you only retrieved the first result of the query. You need to use while ($products = tep_db_fetch_array($products_query)); and then you don't need the for loop either.

 

 

Hi, the last dasy I was busy. Here's the result:

  function tep_get_products_ids() {
$foo_query = tep_db_query("select products_id from " . TABLE_PRODUCTS);
while ($foo = tep_db_fetch_array($foo_query)) {
  $foo_array[] = array('id' => $foo['products_id']);
}

return $foo_array;
 }

 for ($count = 1; $count <= sizeof(tep_get_products_ids()); $count++) {

$products_groups_query = tep_db_query("select pg.customers_group_price, pg.customers_group_price,  pg.products_id from " . TABLE_PRODUCTS_GROUPS . " pg where pg.products_id = " . $count);
$products_groups = tep_db_fetch_array($products_groups_query);

if ($products_groups['customers_group_price'] == '') {
  tep_db_query ("insert into products_groups_discounts (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * p.products_price), p.products_id from products p where p.products_id=".$count);

} else {
  tep_db_query ("insert into products_groups_discounts (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * pg.customers_group_price), p.products_id from products p, products_groups pg where p.products_id=".$count);
}
 }  
 tep_db_query ("update " . TABLE_CUSTOMERS_GROUPS . " set customers_group_discount=" . $_POST['customers_group_discount'] . " where customers_group_id = " . $sppc['customers_group_id'] . " limit 1;");

 

The only problem that's still left: When I'm changing prices (creating a discount) for a group and there's a sppc price for the same product but for another customer group these price is used for the actual customer group.

I think the argument from the if clause is not ok, so I must integrate a checkup for the customer group.

 

I'm sure my result is not the best but it's the first try.

 

And thank ypu for your help. I'm checking your last additions now.

Share this post


Link to post
Share on other sites

Ok, I solved the last problem.

You have to replace:

	$products_groups_query = tep_db_query("select pg.customers_group_price, pg.customers_group_price,  pg.products_id from " . TABLE_PRODUCTS_GROUPS . " pg where pg.products_id = " . $count);

Into:

	$products_groups_query = tep_db_query("select pg.customers_group_price,  pg.products_id, pg.customers_group_id from " . TABLE_PRODUCTS_GROUPS . " pg where pg.products_id = " . $count . " and pg.customers_group_id = " . $sppc['customers_group_id']);

 

and replace:

		tep_db_query ("insert into products_groups_discounts (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * pg.customers_group_price), p.products_id from products p, products_groups pg where p.products_id=".$count);

Into:

		tep_db_query ("insert into products_groups_discounts (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * pg.customers_group_price), p.products_id from products p, products_groups pg where p.products_id=".$count . " and customers_group_id = " . $sppc['customers_group_id']);

 

Btw. in the original was one pg.customers_group_price too much.

Edited by Grinse

Share this post


Link to post
Share on other sites

Ok. I checked my code and even if it's sometimes not perfect coded it's ok now.

I'll offer the new feature with some others in some days.

 

Discription:

You can add a discount between 0 and 100 percent per customer group. It's based on Quick Group Discounts Module For SPPC (http://www.oscommerce.com/community/contributions,5569).

 

Normal behavior of that Contribution:

- You have an extra page where you can set a discount for each customer group.

- The discount is always based on the products price and overwrites the customer group price. So if you change the products price you have to redo the discount calculation.

 

New now:

- You can specify the discount in the customer group window from sppc. No extra page is needed.

- There is a check routine if you enter negative or above 100 percent.

- The discount is now based on normal product price if there is no sppc group price set. If there is a special (customer) group price than the discount is based on that price.

- Everytime when you change the discount, product price or sppc price for a group the whole price is (re-)calculated.

- On the frontend (products_info.php) you can now see if there is a sppc price, a price with discount or just the normal product price (see xtcommerce for an example).

- If you delete a customer group also the saved discounts and sppc prices for that group are deleted.

 

What I'm working on:

- Multilanguage support for the sppc group [finished].

- A image for every sppc group [almost finished].

- A box in the frontend with customer group information for example the image for the group, the multilanguage name, the given discount (if there is one), the tax info (based on tax info for sppc) [nearly finished].

Share this post


Link to post
Share on other sites

Ok. I checked my code and even if it's sometimes not perfect coded it's ok now.

I'll offer the new feature with some others in some days.

 

Discription:

You can add a discount between 0 and 100 percent per customer group. It's based on Quick Group Discounts Module For SPPC (http://www.oscommerce.com/community/contributions,5569).

 

Normal behavior of that Contribution:

- You have an extra page where you can set a discount for each customer group.

- The discount is always based on the products price and overwrites the customer group price. So if you change the products price you have to redo the discount calculation.

 

New now:

- You can specify the discount in the customer group window from sppc. No extra page is needed.

- There is a check routine if you enter negative or above 100 percent.

- The discount is now based on normal product price if there is no sppc group price set. If there is a special (customer) group price than the discount is based on that price.

- Everytime when you change the discount, product price or sppc price for a group the whole price is (re-)calculated.

- On the frontend (products_info.php) you can now see if there is a sppc price, a price with discount or just the normal product price (see xtcommerce for an example).

- If you delete a customer group also the saved discounts and sppc prices for that group are deleted.

 

What I'm working on:

- Multilanguage support for the sppc group [finished].

- A image for every sppc group [almost finished].

- A box in the frontend with customer group information for example the image for the group, the multilanguage name, the given discount (if there is one), the tax info (based on tax info for sppc) [nearly finished].

Share this post


Link to post
Share on other sites

Hi,

I've a question to you Jan:

Are you planing to update Quantity Price Breaks for Separate Pricing Per Customer (http://www.oscommerce.com/community/contributions,3039) (version 1.02.2 based on qpbpp v.1.1.3) to your actual version of Quantiy Price Breaks Per Product (http://www.oscommerce.com/community/contributions,1242) (version 1.2.8)?

 

I'm asking because I want to implement Quantity Price Breaks and it seems as the newer (non SPPC compatible) version has a better performance.

Edited by Grinse

Share this post


Link to post
Share on other sites

Dear Jan,

 

You are right. The adjust_qty is only called when adding a product to the cart. Not afterward. I needed several hours to get a fix for that. Problems with objects being re-set and still not recognizing the new data. I did this on an older SPPC installation that I added a register_globals contribution too. Had to change a couple of things to make that work.

It works!!!

 

What I don't understand:

$pfs = new PriceFormatterStore;

But there is no class PriceFormatterStore in my osc, or might it be that I have such an old version?

 

I added a register_globals contribution too
Which one is that? I need to do this as well...

 

Thank you very much!

 

Kind regards

Götz

Edited by texmaxx

Share this post


Link to post
Share on other sites
Are you planing to update Quantity Price Breaks for Separate Pricing Per Customer (http://www.oscommerce.com/community/contributions,3039) (version 1.02.2 based on qpbpp v.1.1.3) to your actual version of Quantiy Price Breaks Per Product (http://www.oscommerce.com/community/contributions,1242) (version 1.2.8)?

 

I'm asking because I want to implement Quantity Price Breaks and it seems as the newer (non SPPC compatible) version has a better performance.

How do you mean better performance? Faster or more options?

 

I added a mod to the regular QPBPP to enable grouping products for a discount (say 6 CD's get a better price, nobody wants 6 the same CD's). With a little PHP knowledge you can put add that to the SPPC version too, but for SPPC it would be nice to also be able to make it different for different groups. That would take quite a bit time that I don't have at the moment. So I think I will update the SPPC version one of these days to RC2a and tackle the problem that texmaxx found.

 

Regarding performance there should not be much difference between the regular and SPPC versions. The SPPC version uses a few more queries but not excessive.

Share this post


Link to post
Share on other sites

Götz,

What I don't understand:

$pfs = new PriceFormatterStore;

But there is no class PriceFormatterStore in my osc, or might it be that I have such an old version?

Yes, that is in QPBPP for a while now. Somebody found out that PriceFormatter is called 5 times for each product in the shopping cart. And then the query in the regular one was wrong too, so it got very slow. That is why PriceFormatterStore was added. It does 1 query for all the products in the cart (SPPC version 3) and then if PriceFormatter is called, it first looks if the info is already store in PriceFormatterStore and uses that if so. If not, it does the query and adds it for the other times it might be called.

 

Which one is that? I need to do this as well...

Of course you can upgrade your osC to RC2a. In this particular case I used Register Globals Easy which was less work than adding the Register Globals contribution. I think the osC upgrade is preferable, but more work.

Share this post


Link to post
Share on other sites
How do you mean better performance? Faster or more options?

 

I added a mod to the regular QPBPP to enable grouping products for a discount (say 6 CD's get a better price, nobody wants 6 the same CD's). With a little PHP knowledge you can put add that to the SPPC version too, but for SPPC it would be nice to also be able to make it different for different groups. That would take quite a bit time that I don't have at the moment. So I think I will update the SPPC version one of these days to RC2a and tackle the problem that texmaxx found.

 

Regarding performance there should not be much difference between the regular and SPPC versions. The SPPC version uses a few more queries but not excessive.

Ah, ok. I thought I've read that you written somewhere that you improved the performance by removing some sql querys.

Share this post


Link to post
Share on other sites

HI,

I have osC MS2.2 just done the install to a fresh setup of osc ms2.2, i think the module is working but when I try to open the category page from the admin section, it loads empty categories, I can see the top section and the side section but the actual categories and products never shown along with the bottom of the page, I think the page is not loading fully due to an error,

Can any one help me with where to start looking, I can provide logins to the admin area if any one can help me, thank you all.

Share this post


Link to post
Share on other sites

Hi everyone

 

I got an unsual problem. I am using the lastest oscommerce RC2 and have Seperate Pricing Per Customer v4.20 and Active Countries v2.11 installed. Everything seems to work fine except for the fact that i can't change a person's group. In customer details i am getting the following error just above the Customer Group pull down (also pull down shows blank because of the following error i am guessing):

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ...\catalog\admin\includes\functions\database.php on line 99

 

I think the problem has to do with something in the following code in \catalog\admin\customers.php file:

 

<!-- BOC - Separate Pricing Per Customer v4.20 -->
<tr>
 <td class="main"><?php echo ENTRY_CUSTOMERS_GROUP_NAME; ?></td>
 <?php
 if ($processed != true) {
 $index = 0;
 while ($existing_customers =  tep_db_fetch_array($existing_customers_query)) {
 $existing_customers_array[] = array("id" => $existing_customers['customers_group_id'], "text" => " ".$existing_customers['customers_group_name']." ");
   ++$index;
 }
 } // end if ($processed != true )
?>
 <td class="main"><?php if ($processed == true) {
   echo $cInfo->customers_group_id . tep_draw_hidden_field('customers_group_id');
 } else {
 echo tep_draw_pull_down_menu('customers_group_id', $existing_customers_array, $cInfo->customers_group_id);
 } ?></td>
</tr>
<!-- EOC - Separate Pricing Per Customer v4.20 -->

 

Can anyone tell me how to fix this prob please?

 

Thanks in advance

Share this post


Link to post
Share on other sites
Can anyone tell me how to fix this prob please?

Hard to say really. The query should have been right above the start of the HTML:

	$existing_customers_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
// EOF Separate Pricing Per Customer
	$customers = tep_db_fetch_array($customers_query);
	$cInfo = new objectInfo($customers);
} // this is the end of switch ($action)
 }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

You might have forgotten it, or it might be outside of the code executed for switching on $action. Or perhaps there has been another query after it, so the results no longer available. You might try adding that query again, right above the part you suspect of being the trouble spot.

Share this post


Link to post
Share on other sites
I think the page is not loading fully due to an error,

Better find out what the error is. This is hard to debug.

Share this post


Link to post
Share on other sites

Hi Jan,

I hope I am not trawling old ground here but I have come up with a problem on a new install that I got the impression was fixed by "SPPC attributes mod rev. 1"

I did a clean install with RC2 + SPPC 4.2.0 and everything works fine except that for the attributes, the price still displays as the "Retail" price on product info, but when you click add to cart, the cart price shows the correct "wholesale" price.

I have also modded for sort product options (attributes) in conjunction with Options as images, which alters the option_images file. I tried reversing the mods etc, but just cannot trace the problem.

 

Any help or pointers much appreciated.

Share this post


Link to post
Share on other sites

Has anyone successfully combined All Products with Hide products from customer groups for SPPC?

 

I want it so if someone is logged on and click All Products, they only see the products relevant to their group. I guess it also has to be set up for SPPC as well, so the prices/specials show properly.

 

Has anyone accomplished this so far?

 

I haven't quite got my head around the SPPC code.

Share this post


Link to post
Share on other sites

what im after is that when the user registerers, the prices immediately update or change to member or other group prices. is this possible?

 

Other thing is i cannot see RETAIL listed when i try to add a product. the retail column is not displayed even tough its added.

 

I hope to hear from you guys and by the way its an amazin module. I really appritiate this..

 

Many Many Thanks in advance

Share this post


Link to post
Share on other sites
Has anyone tried with RC2 yet? I just made SPPC work with it, there is a few changes since instead of javascript they use mysql indexes. I have been checking it and using my calculator and everything seems to be working great. If anyone wants i can upload it and u can compare and see what i did. Maybe you can find any bugs so we can fix it and get a nice RC2 stable version.

Hi,

At the moment I give RC2 a try.

 

I figured out some wrong entries in the install.htm:

1. Section catalog/products_new.php (install.html line 4494):

			<td colsp?an="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

has to be:

			<td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

 

2. Section catalog/includes/modules/new_products.php (install.html line 3170 - 3173):

 $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

should be:

//	$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

I think the changes are ok.

 

3. Section catalog/includes/modules/new_products.php (install.html line 1610):

		tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "')");

should:

		tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "')");

Changes are also ok.

 

4. Section catalog/includes/modules/new_products.php (install.html line 1640 - 1642):

  $prev_attribute_page = $attribute_page - 1;
 $next_attribute_page = $attribute_page + 1;
?>

doesn't exist but it's just a comment to add. So forget the change.

 

5. Section catalog/includes/modules/new_products.php (install.html line 1656):

			<td colspan="7" class="smallText">

doesn't exist. But what have to be changed now?

Maybe:

			<td colspan="7"><?php echo tep_black_line(); ?></td>

into:

			<td colspan="8"><?php echo tep_black_line(); ?></td>

 

6. Section catalog/includes/modules/new_products.php (install.html 1783):

			<td align="center" class="smallText"> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&attribute_page=' . $attribute_page, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_edit.gif', IMAGE_UPDATE); ?></a>  <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&attribute_page=' . $attribute_page, 'NONSSL') , '">'; ?><?php echo tep_image_button('button_delete.gif', IMAGE_DELETE); ?></a> </td>

doesn't exist. it's now:

			<td align="center" class="smallText"> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&' . $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_edit.gif', IMAGE_UPDATE); ?></a>  <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&' . $page_info, 'NONSSL') , '">'; ?><?php echo tep_image_button('button_delete.gif', IMAGE_DELETE); ?></a> </td>

 

So replace:

<?php // BOF SPPC attributes hide for groups mod with button for pop-up window for group prices and hide ?>
		<td align="center" class="smallText"><?php echo $hide_info = tep_get_hide_info($customers_groups, $attributes_values['attributes_hide_from_groups']); ?></td>
		<td align="center" class="smallText"> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&attribute_page=' . $attribute_page, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_edit.gif', IMAGE_UPDATE); ?></a>  <?php echo '<a href="java script:void(0)" onmouseover="window.status=\'' . TEXT_MOUSE_OVER_GROUP_PRICES . '\';return true;" onmouseout="window.status=\'\'; return true;" onclick="window.open(\'' . tep_href_link(FILENAME_ATTRIBUTES_GROUPS, 'attribute_id=' . $attributes_values['products_attributes_id'], 'NONSSL') . '\',\'' . NAME_WINDOW_ATTRIBUTES_GROUPS_POPUP . '\',\'menubar=yes,resizable=yes,scrollbars=yes,status=no,location=no,width=500,hei
ght=350\');return false">' . tep_image_button('button_group_prices.gif', TEXT_GROUP_PRICES); ?></a>  <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&attribute_page=' . $attribute_page, 'NONSSL') , '">'; ?><?php echo tep_image_button('button_delete.gif', IMAGE_DELETE); // EOF SPPC attributes hide for groups mod
					?></a> </td>

with:

			<td align="center" class="smallText"><?php echo $hide_info = tep_get_hide_info($customers_groups, $attributes_values['attributes_hide_from_groups']); ?></td>
		<td align="center" class="smallText"> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&' . $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_edit.gif', IMAGE_UPDATE); ?></a>  <?php echo '<a href="java script:void(0)" onmouseover="window.status=\'' . TEXT_MOUSE_OVER_GROUP_PRICES . '\';return true;" onmouseout="window.status=\'\'; return true;" onclick="window.open(\'' . tep_href_link(FILENAME_ATTRIBUTES_GROUPS, 'attribute_id=' . $attributes_values['products_attributes_id'], 'NONSSL') . '\',\'' . NAME_WINDOW_ATTRIBUTES_GROUPS_POPUP . '\',\'menubar=yes,resizable=yes,scrollbars=yes,status=no,location=no,width=500,hei
ght=350\');return false">' . tep_image_button('button_group_prices.gif', TEXT_GROUP_PRICES); ?></a>  <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&' . $page_info, 'NONSSL') , '">'; ?><?php echo tep_image_button('button_delete.gif', IMAGE_DELETE); ?></a> </td>

Share this post


Link to post
Share on other sites
what im after is that when the user registerers, the prices immediately update or change to member or other group prices. is this possible?

You can add that logic in create_acccount.php. Now it is left to MySQL to insert 0 as the default for customer_group_id, but you explicitly add logic or a hard-coded value for customer_group_id in this piece of code (starts around line 177):

	  $sql_data_array = array('customers_firstname' => $firstname,
						  'customers_lastname' => $lastname,
						  'customers_email_address' => $email_address,
						  'customers_telephone' => $telephone,
						  'customers_fax' => $fax,
						  'customers_newsletter' => $newsletter,
						  'customers_password' => tep_encrypt_password($password));

  if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
  if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);
// BOF Separate Pricing Per Customer
  // if you would like to have an alert in the admin section when either a company name has been entered in
  // the appropriate field or a tax id number, or both then uncomment the next line and comment the default
  // setting: only alert when a tax_id number has been given
  //	if ( (ACCOUNT_COMPANY == 'true' && tep_not_null($company) ) || (ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id) ) ) {
  if ( ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id)  ) {
  $sql_data_array['customers_group_ra'] = '1';
// entry_company_tax_id moved from table address_book to table customers in version 4.2.0
  $sql_data_array['entry_company_tax_id'] = $company_tax_id; 
}
// EOF Separate Pricing Per Customer

  tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

 

Other thing is i cannot see RETAIL listed when i try to add a product. the retail column is not displayed even tough its added.

The "standard" osC price is the one for retail. That is why "retail" is added as a customer group in the install, with it's hard-coded customer group id of zero.

Share this post


Link to post
Share on other sites

Hi there,

has someone already tried sppc in combination with osc2.2 rc2?

Can I have your admin/products_attributes.php file please because mine is not working correct (seems as if something with the new row is wrong because I can't see the icons and hidden infos).

Share this post


Link to post
Share on other sites
has someone already tried sppc in combination with osc2.2 rc2?

Can I have your admin/products_attributes.php file please because mine is not working correct (seems as if something with the new row is wrong because I can't see the icons and hidden infos).

See attachment to this post (NOTE removed on March 29, 2009)

Edited by Jan Zonjee

Share this post


Link to post
Share on other sites

Hi everyone,

 

I just installed Seperate Pricing Per Customer 4.2.0 , and I'm expriencing problems with some pages.

 

For example, when I go to customers page (customers.php) in the Administrator panel, I get the error "Fatal error: Call to undefined function tep_hide_session_id() in C:\xampp\htdocs\mysite\catalog\admin\customers.php on line 843

".

 

Same thing with categories.php.

 

I looked at all functions files and I couldn't find this function anywhere. I tried with old versions of this extension and couldn't make it run...

 

Any ideas please ?

 

Best regards

Edited by toineblt

Share this post


Link to post
Share on other sites
I looked at all functions files and I couldn't find this function anywhere. I tried with old versions of this extension and couldn't make it run...

Then you haven't looked good enough because it has always been there on the catalog side (html_output.php). Download RC2a, look in the folder extras and open upgrade-22rc1.html. 80% down you will find the necessary changes:

[BUGFIX] Add the Session ID to GET Based Forms

Add the session ID to GET based forms incase the browser has cookies disabled.

Affected Files
catalog/index.php
catalog/admin/includes/classes/split_page_results.php
catalog/admin/includes/functions/html_output.php --> this is the file the function tep_hide_session_id goes into
catalog/admin/banner_statistics.php
catalog/admin/categories.php
catalog/admin/customers.php
catalog/admin/define_language.php
catalog/admin/file_manager.php
catalog/admin/index.php
catalog/admin/orders.php

Share this post


Link to post
Share on other sites

I hope this doesn't seem like a dumb question but...

 

What's the easiest way to associate the customers_group_id with the appropriate customers_group_name? I know that you need to grab the customers_group_id first but I always seem to fall down when it comes to associating the _id with the _name.

 

There are lots of places in both the catalog and admin where I'd like to also include the customer's group name but I can never seem to get past showing the _id.

 

Thanks in advance.

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

×