Closed (fixed)
Project:
Commerce Fees
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Jul 2013 at 17:27 UTC
Updated:
9 Feb 2020 at 08:14 UTC
Jump to comment: Most recent
Comments
Comment #1
facine commentedHi, in the same rule could "Calculate a value" with the desired percentage and then assign the calculate result to the amount of the fee.
Regards
Comment #2
norsoa commentedHi, Thank you. Now its working. Here how I did it.
Regards
{ "rules_add_reservation_fee_to_an_order" : {
"LABEL" : "Add reservation fee to an order",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "commerce_fees" ],
"ON" : [ "commerce_fees_order" ],
"DO" : [
{ "data_calc" : {
"USING" : {
"input_1" : [ "commerce-order:commerce-order-total:amount-decimal" ],
"op" : "*",
"input_2" : "20"
},
"PROVIDE" : { "result" : { "result" : "Calculation result" } }
}
},
{ "commerce_fees_apply" : {
"entity" : [ "commerce-order" ],
"fee" : "reservation_fee",
"amount" : [ "result" ],
"currency_code" : "EUR"
}
}
]
}
}
Comment #3
norsoa commentedComment #4
alamp commented@norsoa, thanks it works like a charm.
Comment #5
svouthi commentedThank you for sharing your rule. Do you know of any way to set the decimal places of the provided result? Since it's more than two decimal places and not rounded, Paypal returns an error message regarding my cart total not matching its calculation (rounded) after applying my percentage fee.
Comment #6
beautifulmind@Norsoa, Thank you for sharing.
I had some hard time importing the rule because I had tax module enabled. But I figured it out. Thanks for sharing
Regards.
Comment #7
leramulina commentedBut the amount field does not allow a value with percent. Only with number. Is this number just a flat sum of money in chosen currency?
Comment #8
leramulina commentedCould you please explain it somehow - how to make a fee let's say 4%?
I did not undestand anything from the explanation of norsoa.
Comment #9
leramulina commentedComment #10
boby_ui commented@leramulina, please check on the frontpage there is a documentation on how to do it with rules and also @norsoa is already doing a good job showing us the rules export.
thank you
Comment #11
nexg commented@norsoa , thank you , with your code I could understand a liitle bit more about rules and commerce fee module
Comment #12
greenrmor commented@nexg , i've tried but failed to import the code given by @norsoa. what did i missed?i solved it! Thanks @norsoa
Comment #13
greenrmor commented