/** * Set a purchase action since it's a bit convoluted. * @param integer $invoice_id * @return string */ public static function show_payment_options($invoice_id = 0, $payment_string = '') { if (!$invoice_id) { $invoice_id = get_the_id(); } if ('' === $payment_string) { $payment_string = si_has_invoice_deposit($invoice_id) ? __('Pay Deposit', 'sprout-invoices') : __('Pay Invoice', 'sprout-invoices'); } self::load_view('templates/invoice/payment-options', array('id' => $invoice_id, 'payment_options' => si_payment_options(), 'payment_string' => $payment_string), false); }
<?php } ?> </ol> <footer id="line_items_footer" class="si_clearfix"> <section id="doc_payment_wrap" class="si_clearfix"> <?php if (si_get_invoice_balance() && si_get_invoice_status() != 'write-off') { ?> <?php $payment_options = si_payment_options(); $payment_string = si_has_invoice_deposit() ? __('Pay Deposit', 'sprout-invoices') : __('Pay Invoice', 'sprout-invoices'); ?> <?php if (count($payment_options) === 0) { ?> <!-- no payment options --> <?php } elseif (count($payment_options) === 1) { ?> <?php foreach ($payment_options as $slug => $options) { ?> <?php if (isset($options['purchase_button_callback'])) { ?>