Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

Prices are changed for customer group prices in several places. product_info.php is only of them. You have to be more specific on what page that happens and then likely it is only a problem for that one page.

You have to check correct prices all the way from the listing on index.php, in boxes, on product_info.php and then adding to the cart, shopping_cart.php, box shopping_cart.php, etcetera.

 

Hi Jan

 

The only pages showing the correct discounted price is the product page (when you click on a product and it brings up the page with only that product) it also adds the correct price to the shopping cart but the rest all show undiscounted prices.

 

Oh and dont forget I'm a total novice so I whouldn't know it if the problem was right in front of me. I'm armed with good logic but zero PHP, please bare with my ignorance. I searched these pages for 3 days, tried to google it and came to the conclusion that I could not find a needle in a haystack if I dont know what a needle is.

 

Now this is a rather troublesome issue as the wholesale customer will only see retail price unless he clicks on the product. This will probably result in "GEEEZ these guys are crazy I can get the same thing nextdoor for 25% less" and off he goes.

 

Thanks in advance

Edited by Brollox

Share this post


Link to post
Share on other sites

To be more specific

 

product_info.php shows the discounted price

index.php does not show the discounted price

 

That what you're looking for?

Share this post


Link to post
Share on other sites

Ok I'm getting no joy here and have virtually no hair left to pull out.

 

So I'm taking a flyer by guessing that the problem of index.php not fetching the discounted prices for discounted customer groups would problably lie in this code.

 

// BOF Separate Pricing Per Customer
if ($status_product_prices_table == true) { // ok in mysql 5
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd , " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";		
} else { // either retail or no need to get correct special prices -- changed for mysql 5
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) { // ok in mysql 5
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";	
} else { // either retail or no need to get correct special prices -- changed for mysql 5
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  }
} else {
// show the products in a given categorie
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory;  
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) { // ok for mysql 5
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";	
	} else { // either retail or no need to get correct special prices -- ok in mysql 5
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer --last query changed for mysql 5 compatibility
	if ($status_product_prices_table == true) {
// original, no need to change for mysql 5
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} else { // either retail or no need to get correct special prices -- changed for mysql 5
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; 
  } // end else { // either retail...
// EOF Separate Pricing per Customer

 

Anybody?

Edited by Brollox

Share this post


Link to post
Share on other sites
Anybody?

 

 

B,

I am a novice myself...

 

If that posted is /catalog/index you would be missing some edits I think.

 

I would also add (or repeat Jan's point) that there are numerous edits in numorous (many) files. 6 total in catalog/index alone... I see 4 in your code. Look above that which you posted for starters.

 

 

Hope that points you in the right direction-

Greg

Share this post


Link to post
Share on other sites
To be more specific

 

product_info.php shows the discounted price

index.php does not show the discounted price

As Greg correctly points out there a few more pieces of code that establish $status_product_prices_table depending on the customer group id. Although the group prices on index.php are actually added in includes/modules/product_listing.php so that is where I would look first when the prices in the product listing (I assume you have a problem with that) is retail when browsing as a group member.

Share this post


Link to post
Share on other sites

I am looking at adding the same ability to the index page that Brollox is trying to do. I want my distributor and retail store groups to see their discount pricing on the index page. I am not really sure where to look to add this ability, since I have only been using oscommerce with SPPC, Quantity price breaks, and hide product / groups on a development site for a few months. I will keep an eye on this thread to see if it gets figured out.

Share this post


Link to post
Share on other sites
I am looking at adding the same ability to the index page that Brollox is trying to do. I want my distributor and retail store groups to see their discount pricing on the index page. I am not really sure where to look to add this ability, since I have only been using oscommerce with SPPC, Quantity price breaks, and hide product / groups on a development site for a few months. I will keep an eye on this thread to see if it gets figured out.

 

Brollox appears to be trying to get up and running period. Not sure his issue is just the 'index page' or any other form of selective price reflection...

 

I am also not sure why you would want to reflect group prices in one place and not in another, but if you have basic, core functionality then selecting where to show pricing is simply a matter of enabling such in the appropriate files. Again though, are you certain that is what you are really trying to accomplish? What about specials. new products, product listing, etc?

 

I am simply curriuos... I have added things that required me to 1) initially disable showing prices. Or 2) coded for SPPC appropriately. Not sure there other choices when all is said and done.

 

The PHP Noob,

Greg

Share this post


Link to post
Share on other sites

Can anybody help me on how to change order email confirmation to include fields from separate price per customer??

 

 

I have installed the contribution Separate price per customer as i am selling to direct customers and to stores.

 

How can I show the unit price a store has paid for in the confirmation order email?

 

something like:

 

Units --Unit price-- description of product-- total amount

 

Thanks in advance

Share this post


Link to post
Share on other sites
Brollox appears to be trying to get up and running period. Not sure his issue is just the 'index page' or any other form of selective price reflection...

 

I am also not sure why you would want to reflect group prices in one place and not in another, but if you have basic, core functionality then selecting where to show pricing is simply a matter of enabling such in the appropriate files. Again though, are you certain that is what you are really trying to accomplish? What about specials. new products, product listing, etc?

 

I am simply curriuos... I have added things that required me to 1) initially disable showing prices. Or 2) coded for SPPC appropriately. Not sure there other choices when all is said and done.

 

The PHP Noob,

Greg

 

I guess I misunderstood his issues, I was not sure how far back to read in the posts. I do have the addon working correctly. The issue I saw was when I go into viewing a category with products that have different pricing for three different groups. The page the lists all of the products would still show the non-discounted price. But once I added one to my shipping cart and went back to the listing of all of the products that have discounts. I would see the group price for the product in the shopping cart, while the other products still show the retail price. I am not sure which page contains the code for the listing of products when you view products in a category. If I can get this page to show the group price what a user from the group is logged in, that would solve my issue.

 

mark

Share this post


Link to post
Share on other sites
I guess I misunderstood his issues, I was not sure how far back to read in the posts. I do have the addon working correctly. The issue I saw was when I go into viewing a category with products that have different pricing for three different groups. The page the lists all of the products would still show the non-discounted price. But once I added one to my shipping cart and went back to the listing of all of the products that have discounts. I would see the group price for the product in the shopping cart, while the other products still show the retail price. I am not sure which page contains the code for the listing of products when you view products in a category. If I can get this page to show the group price what a user from the group is logged in, that would solve my issue.

 

mark

 

You may wish to use something like WinMerge (http://sourceforge.net/project/showfiles.php?group_id=13216) to compare what is on your site and what was initially distributed in the package. Sounds like you may have missed or otherwise botched an edit. The posts on the previous page address this. Try starting with ../catalog/index.php. Beyond that. look to the core file mods...

 

Greg

Share this post


Link to post
Share on other sites
You may wish to use something like WinMerge (http://sourceforge.net/project/showfiles.php?group_id=13216) to compare what is on your site and what was initially distributed in the package. Sounds like you may have missed or otherwise botched an edit. The posts on the previous page address this. Try starting with ../catalog/index.php. Beyond that. look to the core file mods...

 

Greg

 

 

Thanks,

 

I plan on taking a look at the code add from the mods today and tomorrow. I will check out that WinMerge from you link.

 

Mark

Share this post


Link to post
Share on other sites

I just noticed that when I add a new product or update an old one that it does not insert or update the product name in the database table. Today was the first time I have add or edited a product since adding two products on april 11th. I am assuming that my error is in the admin/categories.php file, which I just redid for the Hide product / categories addon (SPPC and Quantity Price break SPPC changes were already on the file). The addons I have are SPPC, Quantity Price break for SPPC and Hide products and categories for SPPC, these were added before April 11th. Since April 11th I added two payment modules to use during testing and PDF Invoice ( store owner to see) and PDF Customer invoice addons.

Share this post


Link to post
Share on other sites
I just noticed that when I add a new product or update an old one that it does not insert or update the product name in the database table. Today was the first time I have add or edited a product since adding two products on april 11th. I am assuming that my error is in the admin/categories.php file, which I just redid for the Hide product / categories addon (SPPC and Quantity Price break SPPC changes were already on the file). The addons I have are SPPC, Quantity Price break for SPPC and Hide products and categories for SPPC, these were added before April 11th. Since April 11th I added two payment modules to use during testing and PDF Invoice ( store owner to see) and PDF Customer invoice addons.

 

Never mind, I realized my mistake later in the day and fixed the issue. I though I messed up something in the code but I did not. I did not realize I had to enter the product name in both places. So now everything work good.

Share this post


Link to post
Share on other sites

Hi Again

 

I Apologize for not updating here I was away for a while. Quite interesting to read discussions on my issue though LOL Guess I'll have to explain the problem again.

 

 

Retail price is displayed on index.php doesn't matter what customer group the customer belongs to. THen he browses through the catalog's differnt catagorys. Still he only sees Retail price. Only when he actually clicks on a product, and this will be in product_info.php if I'm not mistaken does he see the discounted price relevant to his specific customer group.

 

I'm surely going to loose Wholesale customers this way. What I want is for the customer to see the discounted price relevant to his customer group no matter what page he's looking at.

 

Thanks again in advance

Share this post


Link to post
Share on other sites
I am also not sure why you would want to reflect group prices in one place and not in another, but if you have basic,

 

core functionality then selecting where to show pricing is simply a matter of enabling such in the appropriate files. Again though, are you certain that is what you are really trying to accomplish? What about specials. new products, product listing, etc?

 

I am simply curriuos... I have added things that required me to 1) initially disable showing prices. Or 2) coded for SPPC appropriately. Not sure there other choices when all is said and done.

 

The PHP Noob,

Greg

 

Hi Greg

 

This is not what I want.......This is what I'm trying to get rid of.

The prices in what's new and specials and product listing is showing correctly but on the index page and when browsing the catalog it shows undiscounted price no matter what customer group the client belongs to. What it should do is show the right price to the rite customer doesn't matter what page he's looking at.....this is beyond me.....and it really doesn't take much as far as OSC goes to be beyond me.

 

So what I really need is somebody willing to revert to the most basic laymans terms and walk through this with me.

Share this post


Link to post
Share on other sites
What I want is for the customer to see the discounted price relevant to his customer group no matter what page he's looking at.

That is what the addon does. We don't know how you added the contribution on other pages (code wise) so we can't know what goes wrong.

Share this post


Link to post
Share on other sites

Are you running any other contributions that affect the pricing (such as Master Products) ?

 

Hi Again

 

I Apologize for not updating here I was away for a while. Quite interesting to read discussions on my issue though LOL Guess I'll have to explain the problem again.

 

 

Retail price is displayed on index.php doesn't matter what customer group the customer belongs to. THen he browses through the catalog's differnt catagorys. Still he only sees Retail price. Only when he actually clicks on a product, and this will be in product_info.php if I'm not mistaken does he see the discounted price relevant to his specific customer group.

 

I'm surely going to loose Wholesale customers this way. What I want is for the customer to see the discounted price relevant to his customer group no matter what page he's looking at.

 

Thanks again in advance


~Tracy
 

Share this post


Link to post
Share on other sites

This Package (http://addons.oscommerce.com/info/3039) doesn't include any (altered) index.php although some changes are made in QPBPP 1.3.5.(http://addons.oscommerce.com/info/1242). Anyway, doing the changes for index.php as said in the instructions of the latter, that does not help and other customer groups that do NOT have any quantity pricebreak are shown "wrong" prices (in index.php, but NOT in productinfo.php)

Edited by Max Paint

Share this post


Link to post
Share on other sites
Are you running any other contributions that affect the pricing (such as Master Products) ?

 

Hi Tracy

 

No all I could find to that effect is specials.php but I dont think that is relevant. Maybe you could tell me what to look for other than Master Products?

I really appreciate any help I could find here.

Share this post


Link to post
Share on other sites
I am looking at adding the same ability to the index page that Brollox is trying to do. I want my distributor and retail store groups to see their discount pricing on the index page. I am not really sure where to look to add this ability, since I have only been using oscommerce with SPPC, Quantity price breaks, and hide product / groups on a development site for a few months. I will keep an eye on this thread to see if it gets figured out.

 

Yes Mark this is exactly what i'm trying to do, or should I say "FIX" because as far as Jan goes SPPC is supposed to do this and this one isn't.

Share this post


Link to post
Share on other sites
Yes Mark this is exactly what i'm trying to do, or should I say "FIX" because as far as Jan goes SPPC is supposed to do this and this one isn't.

 

 

(speck2900 @ Apr 22 2009, 10:31 AM)

I guess I misunderstood his issues, I was not sure how far back to read in the posts. I do have the addon working correctly. The issue I saw was when I go into viewing a category with products that have different pricing for three different groups. The page the lists all of the products would still show the non-discounted price. But once I added one to my shipping cart and went back to the listing of all of the products that have discounts. I would see the group price for the product in the shopping cart, while the other products still show the retail price. I am not sure which page contains the code for the listing of products when you view products in a category. If I can get this page to show the group price what a user from the group is logged in, that would solve my issue.

 

mark

 

 

You may wish to use something like WinMerge (http://sourceforge.net/project/showfiles.php?group_id=13216) to compare what is on your site and what was initially distributed in the package. Sounds like you may have missed or otherwise botched an edit. The posts on the previous page address this. Try starting with ../catalog/index.php. Beyond that. look to the core file mods...

 

Greg

 

Hi,

I am guessing that the only change has been in your agitation level. Unfortunately that which can be offered on the MB has not changed I don't think.

 

Did you compare the files on the site with those in the original package? At least some of the suspect files?

 

The fact that it works for you in one or more places but not in others could indicate isolated edit issues. The add-on does work perfectly from the get go if installed properly...

 

Is the store 1) Live. 2) modded beyond rolling back to an initial state (if your store is not heavily modded it might be better for you to copy over for SPPC)? I also noticed an installer posted today. IT IS NOT FOR MODDED STORES THOUGH...

 

Greg

Share this post


Link to post
Share on other sites

I would run a file comparison with the downloaded SPPC files and your catalog/index.php , catalog/product_info.php , catalog/includes/modules/product_listing.php and any others that have to do with products and pricing. These three are just the one's I can think of off the top of my head. If you use a comparison tool like WinMerge you can check all of your site's files against those in the contribution - this is how I've found the majority of my errors :)

 

Hi Tracy

 

No all I could find to that effect is specials.php but I dont think that is relevant. Maybe you could tell me what to look for other than Master Products?

I really appreciate any help I could find here.


~Tracy
 

Share this post


Link to post
Share on other sites

Hi,

I would love to be able to combine it with the printable catalog, which now shows only retail prices, no matter which customer group is logged in.

What can I do to help? Testing installing?

 

Do you know of any other catalog printer to do the trick.

 

Great contribution! It took me a while to install, mainly because I messed it up a few times, installing the wrong version.

yours,

Eyal


Eyal

How About an Open Source Car?

Share this post


Link to post
Share on other sites

Hi Guys

 

First of all I just want to say what a brilliant contribution and thank everyone on here who has posted solutions.

 

I have a couple of issues that I have not been able to find a solution for in this forum.

 

1) The prices displayed in the general category listings are always the standard retail price. However, when I select a product (signed in as a test customer) I see the actual price assigned to the group.

 

2) Since I have installed this contribution any test orders I place don't appear in the 'Order History' section of 'My Account'.

 

Any help on either of these issues would be hugely appreciated.

 

Many Thanks

 

Tim

Share this post


Link to post
Share on other sites
Hi,

I am guessing that the only change has been in your agitation level. Unfortunately that which can be offered on the MB has not changed I don't think.

 

Did you compare the files on the site with those in the original package? At least some of the suspect files?

 

The fact that it works for you in one or more places but not in others could indicate isolated edit issues. The add-on does work perfectly from the get go if installed properly...

 

Is the store 1) Live. 2) modded beyond rolling back to an initial state (if your store is not heavily modded it might be better for you to copy over for SPPC)? I also noticed an installer posted today. IT IS NOT FOR MODDED STORES THOUGH...

 

Greg

 

 

Hi Greg

 

You hit the mark with the agitation level thing :blush: Feels like I opened a tin of flipping worms here. anyway thanks for the patiens.

 

Unfortunately our site is modified a great deal so my attempts to compare with the original files didn't amount to much.

 

Looking back at the code I posted and the comments made on that I did find that there are indeed six sections of code regarding SPPC added to index.php which is completely absent in 2.2rc2a's index.php which i downloaded so what do I compare to?

Jan Mentioned somewhere that there is a B2B version with sppc already built in maybe I should get hold of that. Anybody knows where?

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

×