function appthemes_checkout_dev_info($wp_admin_bar) { $checkout = APP_Current_Checkout::get_checkout(); if (!$checkout) { return; } if (isset($_GET['step'])) { $current_step = $_GET['step']; } else { $current_step = $checkout->get_next_step(); } $wp_admin_bar->add_node(array('id' => 'checkout', 'parent' => false, 'title' => sprintf('Current Step: %s', $current_step), 'href' => '#', 'meta' => array('class' => 'opposite'))); $checkout_type = $checkout->get_checkout_type(); $wp_admin_bar->add_node(array('id' => 'checkout-type', 'parent' => 'checkout', 'title' => sprintf('Checkout Type: %s', $checkout_type), 'meta' => array('class' => 'opposite'))); $num = 1; $all_steps = $checkout->get_steps(); $first_step = false; foreach ($all_steps as $step => $callbacks) { if ($first_step == false) { $first_step = $step; } $current = ''; if ($step == $current_step) { $current = ' (current) '; } $wp_admin_bar->add_node(array('id' => 'checkout-' . $step, 'parent' => 'checkout', 'title' => sprintf('Step %s: %s', $num, $step) . $current, 'href' => appthemes_get_step_url($step))); $num++; } $wp_admin_bar->add_node(array('id' => 'checkout-reset', 'parent' => 'checkout', 'title' => 'Start Over', 'href' => add_query_arg('hash', '', appthemes_get_step_url($first_step)))); $wp_admin_bar->add_node(array('id' => 'steps-reset-main', 'parent' => false, 'title' => 'Start Over', 'href' => add_query_arg('hash', '', appthemes_get_step_url($first_step)))); }
_e('Order Total:', APP_TD); ?> </strong> <?php echo appthemes_get_price($order->get_total(), $order->get_currency()); ?> </p> <p><?php _e('For questions or problems, please contact us directly at', APP_TD); ?> <?php echo get_option('admin_email'); ?> </p> <p><?php printf(__('To cancel this request and use a regular gateway instead, <a href="%s">click here</a>.', APP_TD), get_the_order_cancel_url()); ?> </p> </div> </fieldset> <fieldset> <input type="submit" class="button" value="<?php _e('Continue ››', APP_TD); ?> " onClick="location.href='<?php echo esc_attr(add_query_arg(array('bt_end' => 1), appthemes_get_step_url('order-summary'))); ?> ';return false;"> </fieldset> </form> <div class="clr"></div>
protected function call_step($id, $type = 'display') { $id = apply_filters('appthemes_checkout_call_step', $id); $this->current_step = $id; if ($this->steps->is_empty()) { return false; } if (!$this->steps->contains($id)) { return false; } $callbacks = $this->steps->get($this->current_step); $callback = $callbacks['payload'][$type == 'display' ? 1 : 0]; $order_id = $this->get_data('order_id'); if (!$order_id) { $order = new APP_Draft_Order(); } else { $order = appthemes_get_order($order_id); } if (is_callable($callback)) { call_user_func($callback, $order, $this); } else { if (is_string($callback)) { locate_template($callback, true); } else { return false; } } if ($order instanceof APP_Draft_Order && $order->is_modified()) { $new_order = APP_Order_Factory::duplicate($order); if (!$new_order) { return false; } $this->add_data('order_id', $new_order->get_id()); // save checkout type & hash in order update_post_meta($new_order->get_id(), 'checkout_type', $this->checkout_type); update_post_meta($new_order->get_id(), 'checkout_hash', $this->hash); // save complete and cancel urls in order if ($complete_url = $this->get_data('complete_url')) { update_post_meta($new_order->get_id(), 'complete_url', $complete_url); } if ($cancel_url = $this->get_data('cancel_url')) { update_post_meta($new_order->get_id(), 'cancel_url', $cancel_url); } } if ($this->step_cancelled) { $this->redirect(appthemes_get_step_url($this->get_previous_step($id))); exit; } if ($this->step_finished) { $this->redirect(appthemes_get_step_url($this->get_next_step($id))); exit; } $this->current_step = false; return true; }
<div id="step1"> <h2 class="dotted"><?php _e('Submit Your Listing', APP_TD); ?> </h2> <?php do_action('appthemes_notices'); ?> <p class="dotted"> </p> <form name="mainform" id="mainform" class="form_step" action="<?php echo appthemes_get_step_url(); ?> " method="post"> <?php wp_nonce_field($action); ?> <ol class="form-fields cat-select"> <li> <div class="labelwrapper"><label><?php _e('Cost Per Listing', APP_TD); ?> </label></div> <div class="ad-static-field"><?php cp_cost_per_listing();
/** * Processing form. * * @param object $order * @param object $checkout * * return void */ public function process($order, $checkout) { if (!$this->can_access_step($order, $checkout)) { return; } // update order complete and cancel urls update_post_meta($order->get_id(), 'complete_url', appthemes_get_step_url('order-summary')); update_post_meta($order->get_id(), 'cancel_url', appthemes_get_step_url('gateway-select')); wp_redirect($order->get_return_url()); exit; }
?> <br /> <?php _e('Your IP address has been logged for security purposes:', APP_TD); ?> <?php echo appthemes_get_ip(); ?> </p> <p class="btn2"> <input type="button" name="goback" class="btn_orange" value="<?php _e('Go back', APP_TD); ?> " onClick="location.href='<?php echo appthemes_get_step_url(appthemes_get_previous_step()); ?> ';return false;" /> <input type="submit" name="step2" id="step2" class="btn_orange" value="<?php echo esc_attr_e('Continue ››', APP_TD); ?> " /> </p> <input type="hidden" name="action" value="<?php echo esc_attr($action); ?> " /> </form> <div class="clr"></div>