Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
we have two payment methods available in our site: 'credit card' and 'pay on delivery'.
The matter is that we would like to charge an extra for 'pay on delivery', so we have to increase the order total after choosing the payment method.
At this point, I've tried myself, searched for examples but I'm not able to configure it in the propper way.
Anyone can help me on this? Any help would be appreciated.
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedThere's nothing to support this natively right now. Payment method selection is purely stored in the $order->data array, which is inaccessible to Rules. You'll need a custom Rules condition to access it for now, though we should try to get something like that in core. Additionally, there is no way to just increase the total of an order. It must be done via a custom line item or a percentage fee added to the order on a per-line item basis. For example, if you have the condition I mention, you could create a product pricing rule that adds a 5% fee to the price of everything if that condition detects the "Pay on delivery" payment method.
Hope this helps! I'd leave this issue open, but I think we have another one to address getting the condition in for payment method selection.
Comment #3
dianikol CreditAttribution: dianikol commentedStill no solution for this one?
Comment #4
silkogelman CreditAttribution: silkogelman commentedThere is a suggestion that is Tax Rule based at #5:
#1347160: How do I set a rule for adding the fee for a payment method?
And have a look at the Rule suggestion at #4:
#1352524: COD Payment dependent extra shipping fee
it seems to be payment method based
(I haven't tested these)
Comment #5
FiNeX CreditAttribution: FiNeX commented@s1l: both doesn't work if you need a fixed fee after selecting the payment.