Tuesday’s Tip: Pre-select a payment plan in your Infusionsoft shopping cart or order form

Allowing your customers to pay over time for high cost items can dramatically increase your conversion rate. Infusionsoft has this capability built-in, but they require the customer to choose whether to pay in full or pay over time when they reach the shopping cart or order form page.

One of our subscribers, Sarit Neundorf, asked if it was possible to allow the customer to select the payment plan from the sales page. In this scenario, the customer would be presented with two links: one to make a single payment, and one to make multiple payments over time. When the customer clicks a link to make their selection, they are taken to the shopping cart or order form and the appropriate payment plan is selected automatically.

This code will allow you to select the appropriate payment plan for your customer so it will already be selected when they reach the cart or order form. The code is slightly different depending on whether you are using a shopping cart or an order form.

In either case, you’ll need to know your payment plan ID. This can be found by going to E-Commerce → Payment Plans, then clicking Edit for your payment plan. The ID will show up in the URL for that page. For example, the URL might be /PayPlanCartItem/managePayPlanCartItem.jsp?view=edit&ID=5, so the ID is 5. You’ll always use an ID of 0 for the single payment option.

 

To use with a shopping cart:

To make it possible to pre-select a payment plan with your Infusionsoft shopping cart, go to E-Commerce → E-Commerce Setup → Shopping Cart Themes → Edit → HTML Areas. Copy and paste the below code to the Custom Header section and click Save.

<script type="text/javascript">// <![CDATA[
jQuery(document).ready(function(){
    if(
        jQuery('#PAYMENT_PLANS').length &&
        Infusion.Url.parseQueryString(document.URL).payPlanId !== 'undefined' &&
        parseInt(Infusion.Url.parseQueryString(document.URL).payPlanId) != jQuery('.choosePlan:input:radio:checked').val() &&
        jQuery(".choosePlan:radio[value=" + parseInt(Infusion.Url.parseQueryString(document.URL).payPlanId) + "]").length
    ) {
        jQuery(".choosePlan:radio[value=" + parseInt(Infusion.Url.parseQueryString(document.URL).payPlanId) + "]").prop("checked", true);
        Infusion.ManageCart.ajaxSubmitForm(jQuery('.payPlan').closest('form').attr('id'), false, 0, 0,['BRIEF_PRODUCT_SUMMARY', 'BILLING_ENTRY', 'SHIPPING_ENTRY', 'PAYMENT_SELECTION', 'CHECKOUT_LINKS_TOP', 'CHECKOUT_LINKS']);
    }
});
// ]]></script>

When linking to your shopping cart, add &payPlanId=0 to the end of the URL, replacing 0 with the payment plan ID you would like to use. Use 0 to select the single payment option. For example, your URL might look like this: https://demo.infusionsoft.com/app/manageCart/addProduct?productId=16&payPlanId=5

 

To use with an order form:

To make it possible to pre-select a payment plan with your Infusionsoft order forms, go to E-Commerce → E-Commerce Setup → Order Form Themes → Edit → HTML Areas. Copy and paste the below code to the Custom Header section and click Save.

<script type="text/javascript">// <![CDATA[
jQuery(document).ready(function(){
    if(
        jQuery('#PAYMENT_PLANS').length &&
        Infusion.Url.parseQueryString(document.URL).payPlanId !== 'undefined' &&
        parseInt(Infusion.Url.parseQueryString(document.URL).payPlanId) != jQuery('.choosePlan:input:radio:checked').val() &&
        jQuery(".choosePlan:radio[value=" + parseInt(Infusion.Url.parseQueryString(document.URL).payPlanId) + "]").length
    ) {
        jQuery(".choosePlan:radio[value=" + parseInt(Infusion.Url.parseQueryString(document.URL).payPlanId) + "]").prop("checked", true);
        Infusion.Ecomm.OrderForms.ajaxSubmitForm('orderForm', false, 0, 0, jQuery('#identifier').val(), 'RENDER_ORDER_FORM', ['ORDER_FORM_PRODUCT_LIST', 'ORDER_FORM_SUMMARY', 'PAYMENT_PLANS', 'PAYMENT_SELECTION', 'CHECKOUT_LINKS']);
    }
});
// ]]></script>

When linking to your order form, add ?payPlanId=0 to the end of the URL, replacing 0 with the payment plan ID you would like to use. Use 0 to select the single payment option. For example, your URL might look like this: https://demo.infusionsoft.com/app/orderForms/8ee29879-0215-4fb7-abea-0c0c0bf55082?payPlanId=5

 

This code will only run if a payment plan is available and if you pass in a URL parameter with a payment plan ID. If there are no payment plans for the selected item or the URL parameter is missing, then the shopping cart or order form will behave as it normally does. It is also smart enough to ignore the URL parameter if you pass in an invalid payment plan ID (or if a sneaky customer tries to change it).

Do you have an idea for a tip? Let us know!

2 Comments

  1. This is awesome, Jacob! I’ve needed this so many times and never found out how to do it. Can’t wait to try it out soon. Thank you!

    Reply
    • You’re welcome!

      Reply

Leave a Reply