WordPress.org

Plugin Directory

Changeset 635337


Ignore:
Timestamp:
12/07/12 12:24:00 (17 months ago)
Author:
kovshenin
Message:

Don't go past the ticketing form if no payment methods have been enabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • camptix/trunk/camptix.php

    r634117 r635337  
    36743674        $via_reservation = false; 
    36753675 
     3676        if ( count( $this->get_enabled_payment_methods() ) < 1 ) 
     3677            $this->error_flags['no_payment_methods'] = true; 
     3678 
    36763679        // Find the coupon. 
    36773680        if ( isset( $_REQUEST['tix_coupon'] ) && ! empty( $_REQUEST['tix_coupon'] ) ) { 
     
    38413844        $this->did_template_redirect = true; 
    38423845 
     3846        // Don't go past the start form if no payment methods are enabled. 
     3847        if ( isset( $this->error_flags['no_payment_methods'] ) ) 
     3848            return $this->shortcode_contents = $this->form_start(); 
     3849 
    38433850        if ( 'attendee_info' == get_query_var( 'tix_action' ) && isset( $_POST['tix_coupon_submit'], $_POST['tix_coupon'] ) && ! empty( $_POST['tix_coupon'] ) ) 
    38443851            return $this->shortcode_contents = $this->form_start(); 
     
    39093916        if ( 'checkout' == get_query_var( 'tix_action' ) && isset( $this->error_flags['no_tickets_selected'] ) ) 
    39103917            $this->error( __( 'It looks like somebody took that last ticket before you, sorry! You try a different ticket.', 'camptix' ) ); 
     3918 
     3919        if ( isset( $this->error_flags['no_payment_methods'] ) ) { 
     3920            $this->notice( __( 'Payment methods have not been configured yet. Please try again later.', 'camptix' ) ); 
     3921            $available_tickets = 0; // Don't bother to show the ticketing form. 
     3922        } 
    39113923 
    39123924        $redirected_error_flags = isset( $_REQUEST['tix_errors'] ) ? array_flip( (array) $_REQUEST['tix_errors'] ) : array(); 
Note: See TracChangeset for help on using the changeset viewer.