Using Bulk Requirements for Wholesalers Only
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.








I'm trying to implement these changes for wholesalers on our website and am getting an error on the put_orderbox.cfm page.
This is the error message:
Missing argument name. When using named parameters to a function, every parameter must have a name.<p>The CFML compiler was processing:<ul><li>An expression beginning with iif, on line 154, column 24.This message is usually caused by a problem in the expressions structure.<li>A cfset tag beginning on line 154, column 7.<li>A cfset tag beginning on line 154, column 7.</ul> <br>The error occurred on line 142.
Did I mess something up or miss something?
Thanks for your help!
Julie