I want to add a script to an order on checkout completion or even better with the rule 'when an order is first paid in full'. But I don't know how or where exactly.
Why I need it: we want to use an external affiliate partner programme for PPS (pay per sale). So when a customer is coming from site A to our shop and orders somthing, the owner of site A gets a certain percentage of the sale. In order for that to work, I need to add a script to the checkout. Or better add the script when the order is paid in full. I use tokens for the UID, order number and total amount in the script I got from the external affiliate partner.
The script looks like this:
I tried adding it by a rule "add a variable" (on checkout completion) but that doesn't do anything. When I add the script to the order as a text field in the checkout, I can't use the tokens (they aren't recognized) and the script is run every time I do something to that order so it appears more than once in the affiliate overview.
Does someone know how I can make this script work ?
(I hope my question is clear. If not, just ask.)
- Drupal Commerce Kickstart 7.x-2.25
- Drupal 7.38
I don't need to activate the script on checkout completion, but 30 days after the order is paid in full. So after the 30 days the customer legally has to return goods. And that's not so easily done as adding the script on checkout completion.
Does anyone has an idea on how to make a rule for it ?