예제 #1
0
            _e('View your new ad listing.', 'appthemes');
            ?>
</a>

        <?php 
        }
        ?>


    </div> <!-- /thankyou -->

    <?php 
    }
    // send new ad notification email to admin
    if (get_option('cp_new_ad_email') == 'yes' || $advals['cp_payment_method'] == 'banktransfer') {
        cp_new_ad_email($post_id);
    }
    // remove the temp session option from the database
    delete_option('cp_' . $_POST['oid']);
} else {
    ?>

    <h2 class="dotted"><?php 
    _e('An Error Has Occurred', 'appthemes');
    ?>
</h2>

    <div class="thankyou">
        <p><?php 
    _e('Your session has expired or you are trying to submit a duplicate ad. Please start over.', 'appthemes');
    ?>
예제 #2
0
 /**
  * Processing form.
  *
  * @param object $order
  * @param object $checkout
  *
  * return void
  */
 public function process($order, $checkout)
 {
     global $cp_options;
     // if no listing internal ID move step backward
     $posted_fields = $checkout->get_data('posted_fields');
     if (!$posted_fields['cp_sys_ad_conf_id']) {
         $checkout->cancel_step();
         return;
     }
     if (!isset($_POST['action']) || !in_array($_POST['action'], array('create-listing', 'renew-listing'))) {
         return;
     }
     check_admin_referer($checkout->get_checkout_type());
     $this->posted_fields = $checkout->get_data('posted_fields');
     if (cp_payments_is_enabled()) {
         $this->errors = apply_filters('appthemes_validate_purchase_fields', $this->errors);
     }
     if ($this->errors->get_error_codes()) {
         return false;
     }
     $listing = $this->get_listing_obj();
     $this->update_listing($order, $checkout);
     if (cp_payments_is_enabled()) {
         $plan_id = isset($this->posted_fields['ad_pack_id']) ? $this->posted_fields['ad_pack_id'] : 0;
         $membership_id = isset($this->posted_fields['membership_pack']) ? $this->posted_fields['membership_pack'] : 0;
         $this->add_plan_to_order($order, $checkout, $plan_id, $membership_id, $listing->ID);
         $this->add_addons_to_order($order, $listing->ID, $membership_id);
         $this->set_order_description($order, $checkout, $listing->ID);
         do_action('appthemes_create_order', $order, APP_POST_TYPE);
     } else {
         if ('pending' == get_post_status($listing->ID)) {
             // send ad owner an email
             cp_owner_new_ad_email($listing->ID);
         }
     }
     // send new ad notification email to admin
     if ($cp_options->new_ad_email) {
         cp_new_ad_email($listing->ID);
     }
     $this->finish_step();
 }