Jump to content
  • 0

How to integrate Affiliatly into Blesta


ThatOneGuy

Question

Hey everyone!

First let me start by saying that I am really loving my new Blesta store.

I do need some help though. I am trying to integrate Affiliatly (a really nice affiliate software) into blesta, and I contacted their support. They told me to ask in here for help. Here is what they need:

 

Quote

Ask these questions:
- if this code can be added in the footer of your site/store

<script type="text/javascript" src="https://www.affiliatly.com/easy_affiliate.js"></script>
<script type="text/javascript">startTracking('AF-10XXX');</script>

- and if this code can be added on the page where the purchase is made and your client has paid for it (i.e. 'Thank You' page)
<script type="text/javascript" src="https://www.affiliatly.com/easy_affiliate.js"></script>
<script type="text/javascript">markPurchase('AF-10XXX', order, price, coupon_code);</script>

where 'order' and 'price' must be replaced with the order's data i.e.
- 'order' - the unique ID of the order, we are using it to prevent fake earnings for affiliates
- 'price' - the price of the order, we are using it calculate the earnings for affiliates, must be without the currency sign
- coupon_code' - the used coupon code in the order, if any
 

so I am pretty sure that the first one can be done - adding the code to the footer. I do not know how yet, but I will dig into it and figure it out. Any pointers on how to do that would be highly appreciated.
Does Blesta have a thank you page? I have yet to find that. If it does - can I put the code there?
How do I push the data over to them? What are the codes for the order, price and coupon_code in Blesta?

Thank you much for all your help!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

Take a look at using the Order plugin's Embed Code field to add HTML to the footer. You can specify your JS there (i.e. Packages > Order Forms > Settings tab) and add a conditional to display content only when on the checkout/complete page. There are fields for order number and total price that you can use too, but there is no coupon code field. You could try to parse the coupon code field from the {{invoice.line_items}} if you really needed it, via other custom JS.

e.g.

{% if order_page == 'checkout/complete' %}
<p>Total: {{order.total}}</p>
<p>Order #: {{order.order_number}}</p>
<p>Currency: {{order.currency}}</p>
{% endif %}

 

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
Answer this question...

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

Loading...
×
×
  • Create New...