The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

How to print custom values on Checkout Page, Receipt Page, and Receipt Emails

randy_burgessrandy_burgess Member
in Help edited September 2013
I use FoxyCart by building a cart on my site and pushing the user straight to the FoxyCart Checkout Page. I add a few custom session variables that I then access through the datafeed to complete the order on my app. This works well.

What I can't seem to figure out is how to also print/render these custom variables on my Checkout Page, Receipt Page, and Receipt Email so that the customer can use this information for future reference.

For instance, I have this field imbedded in my form that points to an order on my app:
<input name="h:order_id" type="hidden" value="19">

How can I add this same custom data to my Checkout Page, Receipt Page, and Receipt Email templates so the user can see something like
ORDER ID: #19
which I'd guess would be placed in the template like
ORDER ID: #^^order_id^^

Is this even possible?
Comments
  • fc_adamfc_adam FoxyCart Team
    @randy_burgess,

    Is your store on 1.0 or newer? If so, you'd access the custom session variables using Twig. For example, this is how we display the custom checkout variables on the receipt:
    {% block custom_fields %}
    {% if has_visible_custom_fields %}
    <div id="fc_receipt_custom_container" class="fc_fieldset_container ">
        <h2>{{ lang.checkout_additional_information|raw }}</h2>
        <fieldset id="fc_receipt_custom">
            <legend>{{ lang.checkout_additional_information|raw }}</legend>
            <div class="fc_inner">
                <ol id="fc_receipt_custom_list">
            {% for custom_field in custom_fields %}
                {% if not custom_field.is_hidden %}
                    <li class="fc_row fc_shipto_{{ multiship.number }}_custom_field">
                        <span class="fc_pre">{{ custom_field.name }}<span class="fc_colon">:</span></span>
                        <span class="fc_text">{{ custom_field.value }}</span>
                    </li>
                {% endif %}
            {% endfor %}
    
                </ol>
                <span class="fc_clear">&nbsp;</span>
            </div><!-- .fc_inner -->
        </fieldset><!-- #fc_receipt_custom -->
        <span class="fc_clear">&nbsp;</span>
    </div><!-- #fc_receipt_custom_container -->
    {% endif %}{# has_visible_custom_fields #}
    {% endblock custom_fields %}
    
  • We're on 1.1, but I've been using the more basic template system thus far. I'll switch to Twig tomorrow.

    Appreciate the reply!

    rb
  • Until I deleted this logic, nothing showed up.
    {% if not custom_field.is_hidden %}

    Where does a person determine which custom fields are hidden vs rendered?
  • fc_adamfc_adam FoxyCart Team
    @randy_burgess - if you prefix with "h:" then it's added as a hidden custom attribute. If you had an input on your checkout that didn't have that prefix, that's when it would be shown with the logic you've removed.
Sign In or Register to comment.