Set purchase order as default payment method

Hi there! What's the best way to go about setting Purchase Order as the default selected option vs credit card?
(when the page loads, I need PO to be selected first, not credit card)
Comments
  • fc_romanfc_roman Member, FoxyCart Team
    Hi @saint_malo,

    With Purchase Order enabled in your payment settings, you could try the following:
    1. Go to TEMPLATES » checkout
    2. With "Custom Template" input checked, find the lines
          {% embed 'checkout.inc.twig' %}
      {% endembed %}
    3. Replace these 2 lines with the entire content of the default checkout template
    4. In {% block payment_method %}, move the elements around to make the purchase order appear as Number 1
    5. Save and test
    Let us know if you need further help.
  • fc_adamfc_adam FoxyCart Team
    @saint_malo,

    Actually - a quick followup with a simpler approach here:

    For what you're needing, you should be able to accomplish this with just a couple lines to your checkout template.

    1) On the "checkout" template page in your store's FoxyCart administration, set it to "Custom Template"
    2) Add the following right before the closing </head> tag:
    {% set payment_method_type = "purchase_order" %}
    <script>FC.json.payment_method_type = "purchase_order";</script>
    On save, if you load the checkout - the purchase order option should then be selected by default.
  • Thanks for your help @fc_roman and @fc_adam. Adding the following to the head was the easiest solution to implement. Works like a charm. Thanks once again.

    {% set payment_method_type = "purchase_order" %}
    <script>FC.json.payment_method_type = "purchase_order";</script>
  • fc_adamfc_adam FoxyCart Team
    @saint_malo,

    Awesome - I'm glad that worked for you!
Sign In or Register to comment.