This is an old revision of the document!


Change Verbiage on Web Receipt "Continue To" Button Based on Category of Item(s)

If you'd like to change the verbiage on the web receipt “Continue To” button, you can use this snippet to look through the items in the cart for any items with a specified category. If that category is found in the cart, you can display the desired text on your button.

You'll need to have created your desired category in the Categories section of the admin, and linked the categories to your product. Go here for more details.

Step 1: Apply the snippet to your configuration

You can apply the snippet below within the “receipt” section of your store's FoxyCart administration - you'll need to select the “if you like, choose a default template:” option to enable the custom receipt template field and look for this line: {% embed 'receipt.inc.twig' %}. Before this line, you'll paste the following twig code:

{% set has_category_item = false %}
{% for item in items %}
	{% if item.category == "your_category_here" %}
		{% set has_category_item = true %}
	{% endif %}
{% endfor %}
{% if has_category_item %}
	{% set custom_lang = config.lang|merge({"checkout_continue_to": "Your custom text here "}) %}
	{% set config = config|merge({"lang": custom_lang}) %}
{% endif %}

Step 2: Customise conditions

You'll need to update the text “your_category_here” to what ever the category is that you assigned to the product. You'll also need to change “Your custom text here ” to your desired text to display on the button.

Site Tools