Waqas Saeed Posted June 20, 2021 Share Posted June 20, 2021 Hey Guys. Loved this community. What if I am looking for a script idea + hooks + API that can help to activate the promo code based on the specific gateway or if I am selecting some Gateway between 2 option. For instance; if incase am offering customers to pay with Paypal. and they get immediately 20% in total invoice. (specified by promo code) I prefer if I can get an idea with some sample code.. API 0 Quote Link to comment Share on other sites More sharing options...
Waqas Saeed Posted June 20, 2021 Author Share Posted June 20, 2021 @sentq use this ActionHook:InvoiceGatewayChange to check the current gateway selected by user, then apply/remove your discount to his invoice using API:UpdateInvoice along with DB query, it might be tricky but it could be done. I read your feedback in different topic/post about it, Could you help me with some API that can activate specific promo code on Action Hook : InvoiceGatewayChange and Update the invoice?? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 20, 2021 Share Posted June 20, 2021 2 hours ago, Waqas Saeed said: What if I am looking for a script idea + hooks + API that can help to activate the promo code based on the specific gateway or if I am selecting some Gateway between 2 option. so the reverse of a Gateway Fees addon module, because what you want to do is effectively negative gateway fees... MG's Payment Gateway Charges addon can give discounts based on the chosen gateway, so that might be a solution ready to go. adding promo codes into the equation would be an unnecessary complicating step in my eyes. 2 hours ago, Waqas Saeed said: I prefer if I can get an idea with some sample code.. API good luck expecting someone to write that for you (even in a generic way).... I think those days are over in this place - certainly on the scale in which it once occurred. if you fancy a challenge, then there is a Gateway Fees addon module on GitHub - looks like the SQL queries will need to be updated, but the rest of the code looks fine to me... if that can handle negative fees, then it could be a starting point. 0 Quote Link to comment Share on other sites More sharing options...
Waqas Saeed Posted June 21, 2021 Author Share Posted June 21, 2021 @Brains You're good always. let me find out if that can be done via the GitHub module. 0 Quote Link to comment Share on other sites More sharing options...
Waqas Saeed Posted June 21, 2021 Author Share Posted June 21, 2021 I'm able to find out some details about that. and also installed that too. What about the reverse fee. Should I make necessary code to amend the code to work as gateway_reverse module ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 21, 2021 Share Posted June 21, 2021 40 minutes ago, Waqas Saeed said: I'm able to find out some details about that. and also installed that too. What about the reverse fee. Should I make necessary code to amend the code to work as gateway_reverse module ? I wouldn't bother renaming it - though you might need to adjust the code as it might prevent negative fees from being used (re the code the checks if the values are less than zero). 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.