Jump to content

Add product after customer pays for another product


Recommended Posts

Hello,

 

I would like to automatically add a product into a customer account when he make a payment for a specific product.

 

I will explain it better,

 

- I have a product that the customer always sign up using a specific promotion code, which will give him the first month as free.

- On the second month, the billing will generate an invoice for him. After he pays for it, I would like to add into his account a second product using a specific promotion code.

 

The first product is a cPanel account, and the second product is a SSL product. So I would like to give customer a free SSL after he pays for that first product on the second month.

 

This can be achieved with the following steps (answer from WHMCS support, so I am looking for a developer that can do this for me).

 

You would need to use a hook to do something like this.

 

http://docs.whmcs.com/Hooks:Invoicing#InvoicePaid

http://docs.whmcs.com/API:Internal_API

http://docs.whmcs.com/API:Add_Order

 

You could use the InvoicePaid hook to check the invoice being paid and query the database (tblinvoiceitems) to see if this is the second invoice for the hosting product. You would then use the API to add an order to the clients account with a specific product and promotion code.

 

The above pages will assist you in doing that.

 

Thanks.

 

Guilherme

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