Commission based on customer payment method

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
8 years 1 month ago #230723

-- 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: 8 years 1 month ago by trevsmiff.

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
8 years 1 month ago #230740

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
8 years 1 month ago #230758

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.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
8 years 1 month ago #230767

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: trevsmiff

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

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
8 years 1 month ago #230778

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.

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
8 years 1 month ago #231062

I managed to get it working and have attached a copy if anyone wants to use it.

File Attachment:

File Name: plg_commis...just.zip
File Size:2 KB


regards
Trevor

Attachments:
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.057 seconds
Powered by Kunena Forum