<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[7469] sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks: Updated UI for payment checkout option to make Stripe more prominent as compared to other gateways.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/7469">7469</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/7469","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>vedjain</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2018-07-16 21:31:14 +0000 (Mon, 16 Jul 2018)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Updated UI for payment checkout option to make Stripe more prominent as compared to other gateways.

More info: https://make.wordpress.org/community/2018/07/16/stripe-will-become-preferred-payment-gateway-for-wordcamps/
Also, currently this feature is disabled on all WordCamp site, and will be enabled one by one, via the feature flag `camptix_payment_options`. All code for this feature is in form of an addon defined by 1class-payment-options.php`. </pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginscamptixtweakscamptixtweaksphp">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/camptix-tweaks.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginscamptixtweaksaddonsclasspaymentoptionsphp">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/class-payment-options.php</a></li>
<li>sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/css/</li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginscamptixtweaksaddonscsspaymentoptionscss">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/css/payment-options.css</a></li>
<li>sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/js/</li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginscamptixtweaksaddonsjspaymentoptionsjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/js/payment-options.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginscamptixtweaksaddonsclasspaymentoptionsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/class-payment-options.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/class-payment-options.php                                (rev 0)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/class-payment-options.php  2018-07-16 21:31:14 UTC (rev 7469)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,240 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Renders a different payment options layout, which shows Stripe as the preferred option
+ */
+
+namespace WordCamp\CampTix_Tweaks;
+
+defined( 'WPINC' ) or die();
+
+use CampTix_Addon;
+
+/**
+ * Class Payment_Options
+ *
+ * Renders payment options with a preference for Stripe
+ *
+ * @package WordCamp\CampTix_Tweaks
+ */
+class Payment_Options extends CampTix_Addon {
+
+       /**
+        * Initialize Payment_Options class
+        */
+       function camptix_init() {
+               add_filter( 'tix_render_payment_options', array( $this, 'generate_payment_options'), 15, 4 );
+               $this->enqueue_scripts_and_styles();
+       }
+
+       /**
+        * Enqueue styles and scripts needed for the addon to work
+        */
+       function enqueue_scripts_and_styles() {
+               wp_register_script(
+                       'payment_options',
+                       plugins_url( 'js/payment-options.js', __FILE__ ),
+                       array( 'stripe-checkout', 'camptix' ),
+                       filemtime( __DIR__ . '/js/payment-options.js' )
+               );
+
+               wp_register_style(
+                       'payment_options',
+                       plugins_url( 'css/payment-options.css', __FILE__ ),
+                       array(),
+                       filemtime( __DIR__ . '/css/payment-options.css' )
+               );
+
+               wp_enqueue_script( 'payment_options' );
+               wp_enqueue_style( 'payment_options' );
+       }
+
+       /**
+        * We have stripe selected when there is no selected payment method, or when stripe is already selected
+        *
+        * @param array $payment_methods
+        * @param string $selected_payment_method
+        *
+        * @return bool
+        */
+       private function has_stripe_selected( $payment_methods, $selected_payment_method ){
+               return array_key_exists( 'stripe', $payment_methods ) && ( ! isset( $selected_payment_method ) || $selected_payment_method === 'stripe' );
+       }
+
+       /**
+        * Filter implementation for new payment layout.
+        *
+        * @param array  $payment_output Not needed since we are generating a new layout.
+        * @param float  $total Total amount.
+        * @param array  $payment_methods List of payment methods.
+        * @param string $selected_payment_method Already selected payment method.
+        */
+       function generate_payment_options( $payment_output, $total, $payment_methods, $selected_payment_method ) {
+               ?>
+               <div class="tix-submit">
+                       <?php if ( $total > 0 ) : ?>
+                               <div class="tix-payment-method" role="tabs">
+                                       <?php $this->render_tab_bar( $payment_methods, $selected_payment_method ); ?>
+                               </div>
+                               <div class="tix-payment-method-container
+                               <?php
+                                       if (
+                                                       $this->only_one_payment_method( $payment_methods ) ||
+                                                       $this->has_stripe_selected( $payment_methods, $selected_payment_method ) ) {
+                                               echo 'tix-hidden ';
+                                       }
+                                       echo ! $this->is_stripe_available( $payment_methods ) ? 'tix-wide-tab' : '';
+                               ?>">
+                                       <?php $this->render_alternate_payment_options( $payment_methods, $selected_payment_method ); ?>
+                               </div>
+                               <input class="tix-checkout-button" type="submit" value="<?php esc_attr_e( 'Checkout &rarr;', 'wordcamporg' ); ?>" />
+                       <?php else : ?>
+                               <input class="tix-checkout-button" type="submit" value="<?php esc_attr_e( 'Claim Tickets &rarr;', 'wordcamporg' ); ?>" />
+                       <?php endif; ?>
+                       <br class="tix-clear" />
+               </div>
+               <?php
+       }
+
+       /**
+        * Render a payment option as a separate tab. Used for rendering stripe tab, or a payment method tab incase only 1
+        * is available.
+        *
+        * @param array  $payment_methods
+        * @param string $key
+        * @param bool   $selected Whether this option is pre selected
+        */
+       private function render_payment_option_as_tab( $payment_methods, $key, $selected ) {
+               $is_only_payment_option = $this->only_one_payment_method( $payment_methods );
+               ?>
+               <input type="radio" role="tab" name="tix_payment_method" id="tix-preferred-payment-option"
+                          value="<?php echo esc_html( $key ); ?>"
+                          autocomplete="off"
+                               <?php echo $selected || $is_only_payment_option ? 'checked' : ''; ?>
+               >
+               <label for="tix-preferred-payment-option"
+                          class="tix-payment-tab
+                          <?php
+                                  echo $is_only_payment_option ? 'tix-wide-tab' : ' ';
+                                  echo $selected || $is_only_payment_option ? ' tix-tab-selected' : '';
+                          ?>
+                       ">
+                       <?php
+                               //translators: %s: Name of the available payment method
+                               printf( esc_html__( 'Pay with %s', 'wordcamporg' ), esc_html( $payment_methods[ $key ]['name'] ) );
+                       ?>
+               </label>
+               <?php
+       }
+
+       /**
+        * Renders tab of the payment options layout. Stripe is rendered as a different tab and is actually a label of an
+        * input
+        *
+        * @param array  $payment_methods
+        * @param string $selected_payment_method Pre selected payment method
+        */
+       function render_tab_bar( $payment_methods, $selected_payment_method ) {
+
+               if ( $this->only_one_payment_method( $payment_methods ) ) {
+                       // render payment option as a tab and bail.
+                       $payment_method_key = array_keys( $payment_methods )[0];
+                       $this->render_payment_option_as_tab( $payment_methods, $payment_method_key, true );
+                       return;
+               }
+
+               // Stripe is the preferred payment method when it is available.
+               $has_stripe_payments_tab = false;
+
+               if ( $this->is_stripe_available( $payment_methods ) ) {
+                       $has_stripe_payments_tab = true;
+                       $this->render_payment_option_as_tab(
+                                       $payment_methods,
+                                       'stripe',
+                                       $this->has_stripe_selected( $payment_methods, $selected_payment_method )
+                       );
+               }
+               ?>
+               <button
+                               role="tab"
+                               class="tix_other_payment_options tix-payment-tab
+                                       <?php
+                                               echo ! $this->has_stripe_selected( $payment_methods, $selected_payment_method ) ? 'tix-tab-selected ' : '';
+                                               echo ! $this->is_stripe_available( $payment_methods ) ? 'tix-wide-tab ' : '';
+                                       ?>"
+                               type="button">
+                       <?php
+                               if ( $has_stripe_payments_tab ) {
+                                       esc_html_e( 'Other payment methods', 'wordcamporg' );
+                               } else {
+                                       esc_html_e( 'Payment methods', 'wordcamporg' );
+                               }
+                       ?>
+               </button>
+               <?php
+       }
+
+       /**
+        * Utility method to check if stripe payment gateway is enabled
+        *
+        * @param array $payment_methods
+        *
+        * @return bool
+        */
+       private function is_stripe_available( $payment_methods ) {
+               return array_key_exists( 'stripe', $payment_methods );
+       }
+
+       /**
+        * Utility function to check if only payment method is available
+        *
+        * @param array $payment_methods
+        *
+        * @return bool
+        */
+       private function only_one_payment_method( $payment_methods ) {
+               return count( $payment_methods ) === 1;
+       }
+
+       /**
+        * Renders all other payment methods except stripe
+        *
+        * @param array  $payment_methods
+        * @param string $selected_payment_method Pre selected payment method
+        */
+       function render_alternate_payment_options( $payment_methods, $selected_payment_method ) {
+               if ( $this->only_one_payment_method( $payment_methods ) ) {
+                       // bail if only one payment option is available.
+                       return;
+               }
+
+               // Pre-select first payment method if stripe is not available
+               if ( ! $this->is_stripe_available( $payment_methods ) && ! isset( $selected_payment_method ) ) {
+                       $selected_payment_method = array_keys( $payment_methods )[0];
+               }
+
+               foreach ( $payment_methods as $payment_method_key => $payment_method ) {
+                       if ( 'stripe' === $payment_method_key ) {
+                               continue;
+                       }
+                       ?>
+
+                       <div class="tix-alternate-payment-option">
+                               <input type="radio" name="tix_payment_method"
+                                               id="tix-payment-method_<?php echo esc_attr( $payment_method_key ); ?>"
+                                               value="<?php echo esc_attr( $payment_method_key ); ?>"
+                                               autocomplete="off"
+                                               required
+                                               <?php echo $selected_payment_method === $payment_method_key ? 'checked' : ''; ?>
+                               >
+
+                               <label for="tix-payment-method_<?php echo esc_attr( $payment_method_key ); ?>">
+                                       <?php echo esc_html( $payment_method['name'] ); ?>
+                               </label>
+                       </div>
+
+                       <?php
+               }
+       }
+}
+
+camptix_register_addon( __NAMESPACE__ . '\Payment_Options' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/class-payment-options.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginscamptixtweaksaddonscsspaymentoptionscss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/css/payment-options.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/css/payment-options.css                          (rev 0)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/css/payment-options.css    2018-07-16 21:31:14 UTC (rev 7469)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,77 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+#tix-preferred-payment-option {
+    display: none;
+}
+
+.tix-submit {
+    display: block;
+    float: right;
+}
+
+.tix-payment-method .tix-payment-tab {
+    display: block;
+    float: left;
+    border: none;
+    color: #0a0a0a;
+    background: none;
+    font-size: 16px;
+    line-height: 24px;
+    border-bottom: 2px solid #0a0a0a;
+    border-radius: 0;
+    cursor: pointer;
+    padding: 10px;
+}
+
+.tix-payment-method .tix-payment-tab.tix-tab-selected {
+    border-bottom: 5px solid;
+    padding-bottom: 7px;
+}
+
+.tix-payment-tab {
+    letter-spacing: 0px;
+    font-weight: bold;
+    text-transform: none;
+}
+
+.tix-payment-method-container {
+    display: block;
+    float: right;
+    padding-top: 20px;
+    clear: both;
+    width: 100%;
+}
+
+#tix .tix-submit .tix-checkout-button {
+    text-transform: uppercase;
+    letter-spacing: 1px;
+    border: 0px none;
+    border-radius: 2px;
+    padding-top: 7px;
+    padding-bottom: 7px;
+    clear: both;
+    display: block;
+    float: right;
+    margin-top: 20px;
+}
+
+.tix-alternate-payment-option {
+    float: left;
+    clear: both;
+    padding-left: 15px;
+    padding-top: 15px;
+}
+
+#tix .tix-submit .tix-alternate-payment-option label {
+    color: #191e23;
+    font-size: 16px;
+    padding-left: 15px;
+}
+
+#tix input[name=tix_payment_method]:required {
+    box-shadow: none;
+}
+
+#tix .tix-wide-tab {
+    width: 150%;
+    text-align: left;
+    float: right;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/css/payment-options.css
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginscamptixtweaksaddonsjspaymentoptionsjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/js/payment-options.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/js/payment-options.js                            (rev 0)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/addons/js/payment-options.js      2018-07-16 21:31:14 UTC (rev 7469)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,23 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+jQuery( document ).ready( function initPaymentOptions( $ ) {
+
+       /**
+        * Implements tab functionality in payment option selection
+        */
+       $( '.tix-payment-tab' ).click( function( event ) {
+               $( '.tix-payment-tab' ).removeClass( 'tix-tab-selected' );
+               $( event.target ).addClass( 'tix-tab-selected' );
+
+               if( $( event.target ).is( 'label[for=tix-preferred-payment-option]' ) ) {
+                       $( '.tix-payment-method-container' ).addClass( 'tix-hidden' );
+               } else {
+                       $( '.tix-payment-method-container' ).removeClass( 'tix-hidden' );
+                       $( 'input#tix-preferred-payment-option' ).prop( 'checked', false );
+               }
+       });
+
+       // Need to overwrite exiting function because it assumes `select` instead of `radio`
+       window.CampTixUtilities.getSelectedPaymentOption = function() {
+               return jQuery( '#tix [name="tix_payment_method"]:checked' ).val();
+       };
+
+});
</ins></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginscamptixtweakscamptixtweaksphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/camptix-tweaks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/camptix-tweaks.php      2018-07-16 13:39:30 UTC (rev 7468)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/camptix-tweaks.php        2018-07-16 21:31:14 UTC (rev 7469)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -457,8 +457,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        } else {
</span><span class="cx" style="display: block; padding: 0 10px">                $current_city = wcorg_get_url_part( site_url(), 'city' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( array_key_exists( $current_city, $alternate_orders ) ) {
-                       // todo PHP Warning:  array_key_exists(): The first argument should be either a string or an integer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( $current_city !== false && array_key_exists( $current_city, $alternate_orders ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $order = $alternate_orders[ $current_city ];
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -566,6 +565,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">        require_once( __DIR__ . '/addons/code-of-conduct.php' );
</span><span class="cx" style="display: block; padding: 0 10px">        // Privacy field
</span><span class="cx" style="display: block; padding: 0 10px">        require_once( __DIR__ . '/addons/privacy.php' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       // Payment options
+       if ( in_array( filter_input( INPUT_GET, 'tix_action' ), array( 'attendee_info', 'checkout' ), true )
+            && ! wcorg_skip_feature( 'camptix_payment_options' )
+       ) {
+               require_once( __DIR__ . '/addons/class-payment-options.php' );
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre>
</div>
</div>

</body>
</html>