General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Coldfusion CFIF help
Here is the scale:
1 - 99 pieces = 5%, 100 - 249 = 7%, 250 - 499 = 8%, 500 - 999 = 9%
The code is working and giving the overall of 5%; however, for those products I've specified in the discount.cfm file, it does not give the discount. If I change insert_part.cfm file from LT to GT, they get discount, but the other products don't receive overall discount. 2 files are not working together.
INSERT_PART.CFM (NOTE: part file)
<CFINCLUDE TEMPLATE="multiplier.cfm">
<CFINCLUDE TEMPLATE="discount.cfm">
<CFSET #overall_discount# = #ccost# * #universal_discount#>
<CFIF (#overall_discount# LT (#userdiscount#) ) OR (#userdiscount# IS 0)>
<cfset #userdiscount# = #overall_discount#>
</cfif>
<CFSET #list_price# = #ccost#>
<CFIF ( ((#multiplier# * #ccost#) LT (#userdiscount#)) )
<CFSET #ccost# = #multiplier# * #ccost#>
<cfelseif #userdiscount# IS NOT 0>
<CFSET #ccost# = #userdiscount#>
</CFIF>
<!---
<CFIF #userdiscount# IS NOT 0>
<CFSET #ccost# = #userdiscount#>
</CFIF>
--->
DISCOUNT.CFM
<CFSET universal_discount = 0.95>
<!-- pogo pin ---->
<CFELSEIF #priceID# is "9552">
<CFIF #qquantity# LT 100>
<CFSET #userdiscount# = 9.50>
<CFELSE>
<CFSET #userdiscount# = 9.10>
</CFIF>
MULTIPLIER.CFM
<!--- If 6 <= quantity <= 9, set discount multiplier to 0.9 --->
<cfif (#qquantity# GTE 6) AND (#qquantity# LTE 9)>
<CFSET #multiplier# = 0.9>
<!--- If 10 <= quantity <= 24, set discount multiplier to 0.85 --->
<cfelseif (#qquantity# GTE 10) AND (#qquantity# LTE 24)>
<CFSET #multiplier# = 0.85>
<!--- If 25 <= quantity, set discount multiplier to 0.80 --->
<cfelseif (#qquantity# GTE 25)>
<CFSET #multiplier# = 0.80>
<cfelseif (#qquantity# LTE 5)>
<CFSET #multiplier# = 1>
</cfif>