Skip to main content

Commission based on customer payment method

More
10 years 7 months ago - 10 years 7 months ago #230723 by trevsmiff
-- HikaShop version -- : 2.6.1
-- HikaMarket version -- : 1.6.7
-- Joomla version -- : 3.4.8

I have been asked to build a multi-vendor site with the following requirements:
  • The customer can pay using any method set up ( PayPal, Stripe, Cheque, BACS etc)
  • The main vendor receives the payment
  • Main-vendor then pays sub-vendors after deducing commission and fees from payment provider (ie PayPal)
If there was a method of basing the commission on the payment method that the customer used I think this would could be achieved. For example if the customer paid by PayPal who charged 3.5% and the vendors commission was 10% then deducting 13.5% from the sub-vendors payment would work. If the customer paid by BACS then just 10% would be deducted.
To do this I guess would require a filter in the commission area that selects the commission rate based on the method of payment used.

Would this work?
Can it be done?

Thanks
Trevor
Last edit: 10 years 7 months ago by trevsmiff.

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #230740 by Jerome
Hi,

There is no such built-in option in HikaMarket to do so, specially because commission rules can be set on products.
But it is possible to implement it using a small custom plugin.
With the two trigger "onBeforeMarketCalculateVendorPrice" "onAfterMarketCalculateVendorPrice", you can change dynamically the content or completely override how the commission is processed.
www.hikashop.com/support/documentation/1...CalculateVendorPrice

Depending your current commission rules ; you can simply use the "onAfterMarketCalculateVendorPrice" trigger and subtract the 3.5% payment charge of the $ret variable (which contains the final vendor price).

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #230758 by trevsmiff
Thanks Jerome, that looks promising.

As the commission adjustment will vary according to the method of payment that the customer used is there a way of retrieving the payment method within the trigger functions?

regards
Trevor

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #230767 by Jerome
Hi,

In the trigger, you have access to the Vendor order object, which contains the order payment method (and order payment id).

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: trevsmiff

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #230778 by trevsmiff
Thanks again Jerome.

Time to roll up my sleeves and get my hands dirty!

regards
Trevor

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #231062 by trevsmiff
I managed to get it working and have attached a copy if anyone wants to use it.

This attachment is hidden for guests.
Please log in or register to see it.


regards
Trevor
The following user(s) said Thank You: Jerome

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.192 seconds
Powered by Kunena Forum