function appthemes_get_previous_step() { $checkout = appthemes_get_checkout(); if (!$checkout) { return; } $current_step = _appthemes_get_step_from_query(); return $checkout->get_previous_step($current_step); }
/** * Displays Continue button on order summary page. * * @return void */ function cp_payments_display_order_summary_continue_button() { $url = ''; $text = ''; $step = _appthemes_get_step_from_query(); if (!is_singular(APPTHEMES_ORDER_PTYPE) && (!empty($step) && 'order-summary' !== $step)) { return; } $order = get_order(); if ($membership = cp_get_membership_package_from_order($order)) { $package = cp_get_user_membership_package($order->get_author()); if ($package) { $url = CP_ADD_NEW_URL; $text = __('Post a new Ad', APP_TD); } else { $url = CP_DASHBOARD_URL; $text = __('Visit your dashboard', APP_TD); } } else { if ($listing_id = _cp_get_order_ad_id($order)) { $url = get_permalink($listing_id); $text = __('View ad listing', APP_TD); } } echo html('p', html('em', __('Thank you for your purchase!', APP_TD))); if ($url && $text) { if (!in_array($order->get_status(), array(APPTHEMES_ORDER_PENDING, APPTHEMES_ORDER_FAILED))) { echo html('p', html('em', __('Your order has been completed!', APP_TD))); } echo html('button', array('type' => 'submit', 'class' => 'btn_orange', 'onClick' => "location.href='" . $url . "';return false;"), $text); } }
/** * Enqueue the progress tree CSS styles */ function _appthemes_enqueue_form_progress_styles() { if (!current_theme_supports('app-form-progress') || !_appthemes_get_step_from_query()) { return; } wp_enqueue_style('app-form-progress', get_template_directory_uri() . '/includes/checkout/form-progress/styles.css', false, '1.0'); }
function notices() { global $cp_options, $current_user; if ($cp_options->charge_ads && $cp_options->enable_membership_packs) { $membership = cp_get_user_membership_package($current_user->ID); $step = _appthemes_get_step_from_query(); if ($membership && in_array($step, array('listing-details', 'select-category'))) { appthemes_display_notice('success', sprintf(__('You have active membership pack "%s". Membership benefit will apply on the review page before publishing an ad.', APP_TD), $membership->pack_name)); } } parent::notices(); }
/** * Enqueue scripts. * * return void */ public function enqueue_scripts() { global $cp_options; $step = _appthemes_get_step_from_query(); if ($step !== 'listing-details') { return; } if ($cp_options->ad_images && appthemes_plupload_is_enabled()) { $listing = $this->get_listing_obj(); appthemes_plupload_enqueue_scripts($listing->ID); } }