Here's a modification I had to make for a customer recently, that I thought others might find useful. Basically they needed to not only set different pricing for wholesale customers, they wanted to require them to purchase in bulk as well. But they also serviced normal retail customers as well, and wanted to not require any minimum purchase from them. CFWebstore has a function to require a minimum purchase amount as well as multiples of that amount (so you can force amounts like 6, 12, 18, etc.) but typically it applies to everyone. It's not hard however, to modify the store to make it apply to wholesalers only...you just have to know how! CFWebstore saves a setting to session memory for whether a user is a wholesaler or not, so you can easily use this variable in changing the code. Here's what you need to do:
First, go to the product/listings/put_orderbox.cfm file. This is where you will find the javascript validation routines that will warn the user about the quantity they are trying to buy. First, around line 152 find the line that determines and sets the minimum quantity that is required for this product. Change this line to read:
Now, open up shopping/basket/act_recalc.cfm. This file is where the shopping cart calculations are done and it will make sure that if the user has javascript turned off, or tries to manually edit the quantity, it will get rounded back to the necessary amounts. First change line 37 in the cfscript, which checks that the cart meets the minimum amount. The new line should read:
And then change line 41 which checks for multiples of the minimum to read:
These changes will now ensure that wholesalers only need to buy in minimum amounts, but you may also want to tweak your product admin form where these amounts are entered (product/admin/products/dsp_price_form.cfm ) so that the merchant understands how they are being used.