Jump to content

activate promo on viewinvoice.php


Recommended Posts

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 

Link to comment
Share on other sites

@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?? 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated