Follow

Passing custom variables through the checkout experience

If you are using the default success URL option, or the "custom" setting if your product has an upsell flow attached to it, ThriveCart will return information about the order to that page via query-string variables.

Details on this can be found here.

In addition to this, you can also pass through your own custom variables to the success page of your order. You do this by attaching variables to the 'passthrough' query string parameter when customers start your checkout process.

In this example, your checkout URL is: http://webactix.thrivecart.com/example-product/ You would replace this with the real URL to your product.

Note that this functionality is not supported by popup templates.

Step 1: Specifying the variables

You can simply create a standard link containing the variables you need:

http://webactix.thrivecart.com/example-product/?passthrough[example_key]=example_value

Alternatively, you can use a form to send variables. This is useful if you want to allow your users to enter information into an input. For example, you could ask them for their favourite colour, and then use that information on your success page! In the example below, we will use a hidden input, but this could easily be any standard HTML input.

<form action="http://webactix.thrivecart.com/example-product/" method="get">
<input type="hidden" name="passthrough[example_key]" value="example_value" />
<input type="submit" value="Go to my checkout" />
</form>

Step 2: Checkout process

Now your customer will go through the cart process as normal. Once they have entered their details and card info, they will be taken to our confirmation page and presented with the links to access their new purchase.

Step 3: Your success page

On your success page, you will receive your key and value pairings as query-string variables. In the above examples, you could access them as follows using PHP:

<?php
$example_key = $_GET['example_key']; // In the example, this will be set to 'example_value'
?>

Note, any custom passthrough information is not included in the hash used to validate the order.

You may be interested in how to pre-fill the checkout fields by providing these values with particular keys. See this article for more details and examples.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk