Dynamic pricing: If statement with 2 rules
-
Hi,
I’m setting up this plugin for use as a quotation form on a proofreading website, and am really happy with the functionality and versatility. One difficulty I am having though is with setting dynamic pricing using nested IFs with 2 rules.
The two values I want to create rules for are wordcount (1-100,000) and completion times (10 days, 7 days, 4 days, 2 days, 1 day, 12 hours), because as the wordcount increases, the relationship between it and standard/express delivery changes e.g. standard completion for up to 5000 words would be 2 days, but for 25000 words would be 4 days, etc.
I have given values to the completion times as follows:
10 days = 0.991
7 days = 0.992
4 days = 0.993
2 days = 1
1 day = 1.5
12 hours = 2The current output code is:
(type_of_proofreading * formatting * wordcount * completion_times * discounts)
This is the formula with the 2 rules for each line I would like to incorporate into IF statements (note that the higher wordcount values*0 = not possible in this short completion time):
if wordcount<5000 AND completion_times 0.991 THEN wordcount*0.85
if wordcount<5000 AND completion_times 0.992 THEN wordcount*0.9
if wordcount<5000 AND completion_times 0.993 THEN wordcount*0.95
if wordcount<5000 AND completion_times 1 THEN wordcount*1
if wordcount<5000 AND completion_times 1.5 THEN wordcount*1.5
if wordcount<5000 AND completion_times 2 THEN wordcount*2if wordcount>5001 BUT <10000 AND completion_times 0.991 THEN wordcount*0.85
if wordcount>5001 BUT <10000 AND completion_times 0.992 THEN wordcount*0.9
if wordcount>5001 BUT <10000 AND completion_times 0.993 THEN wordcount*1
if wordcount>5001 BUT <10000 AND completion_times 1 THEN wordcount*1.5
if wordcount>5001 BUT <10000 AND completion_times 1.5 THEN wordcount*2
if wordcount>5001 BUT <10000 AND completion_times 2 THEN wordcount*0if wordcount>10001 BUT <25000 AND completion_times 0.991 THEN wordcount*0.85
if wordcount>10001 BUT <25000 AND completion_times 0.992 THEN wordcount*0.9
if wordcount>10001 BUT <25000 AND completion_times 0.993 THEN wordcount*1
if wordcount>10001 BUT <25000 AND completion_times 1 THEN wordcount*1.5
if wordcount>10001 BUT <25000 AND completion_times 1.5 THEN wordcount*0
if wordcount>10001 BUT <25000 AND completion_times 2 THEN wordcount*0if wordcount>25001 AND completion_times 0.991 THEN wordcount*0.85
if wordcount>25001 AND completion_times 0.992 THEN wordcount*1
if wordcount>25001 AND completion_times 0.993 THEN wordcount*1.5
if wordcount>25001 AND completion_times 1 THEN wordcount*0
if wordcount>25001 AND completion_times 1.5 THEN wordcount*0
if wordcount>25001 AND completion_times 2 THEN wordcount*0I’ve been racking my brains to think of another way to resolve this by using the existing features of the plugin, but keep drawing a blank. Could this type of dynamic pricing be achieved without modifying the plugin?
Thanks,
Barnez
- The topic ‘Dynamic pricing: If statement with 2 rules’ is closed to new replies.