/** * Insert the ExpessCheckout Shortcut Button * * @return void */ public function add_ecs_button($cart_table, $context) { if (!wpsc_uses_shipping() && wpsc_is_gateway_active('paypal-digital-goods') || !wpsc_is_gateway_active('paypal-express-checkout')) { return; } if ('bottom' == $context) { return; } if (_wpsc_get_current_controller_name() === 'cart') { $url = $this->get_shortcut_url(); echo '<a class="express-checkout-button" href="' . esc_url($url) . '"><img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-large.png" alt="' . __('Check out with PayPal', 'wp-e-commerce') . '" /></a>'; } }
function _wpsc_filter_body_class($classes) { if (!wpsc_is_controller()) { return $classes; } $classes[] = 'wpsc-controller'; $classes[] = 'wpsc-' . _wpsc_get_current_controller_name(); $classes[] = 'wpsc-controller-' . _wpsc_get_current_controller_slug(); return $classes; }
/** * Add scripts */ public function scripts() { if (!wpsc_is_cart() && !wpsc_is_checkout()) { return; } wp_enqueue_style('amazon_payments_advanced', WPSC_MERCHANT_V3_SDKS_URL . '/amazon-payments/assets/css/style.css'); wp_enqueue_script('amazon_payments_advanced_widgets', WPSC_AMAZON_PA_WIDGETS_URL, '', WPSC_VERSION); wp_enqueue_script('amazon_payments_advanced', WPSC_MERCHANT_V3_SDKS_URL . '/amazon-payments/assets/js/amazon-checkout.js', array('amazon_payments_advanced_widgets'), '1.0', true); $is_pay_page = _wpsc_get_current_controller_name() == 'checkout' || _wpsc_get_current_controller_name() == 'cart'; $redirect_page = $is_pay_page ? add_query_arg('amazon_payments_advanced', 'true', wpsc_get_checkout_url('shipping-and-billing')) : esc_url_raw(add_query_arg('amazon_payments_advanced', 'true')); wp_localize_script('amazon_payments_advanced', 'amazon_payments_advanced_params', apply_filters('wpsc_amazon_payments_advanced_params', array('seller_id' => $this->setting->get('seller_id'), 'reference_id' => $this->reference_id, 'redirect' => $redirect_page, 'pwa_type' => 'PwA', 'pwa_color' => 'Gold', 'pwa_size' => 'small'))); }
function wpsc_get_customer_orders_pagination_links($args = array()) { global $wp_rewrite; if (_wpsc_get_current_controller_name() != 'customer-account' || _wpsc_get_current_controller_slug() != 'orders') { return ''; } $controller = _wpsc_get_current_controller(); $base = $controller->get_current_pagination_base(); if ($wp_rewrite->using_permalinks()) { $format = 'page/%#%'; } else { $format = '&page=%#%'; } $defaults = array('base' => trailingslashit($base) . '%_%', 'format' => $format, 'total' => $controller->total_pages, 'current' => $controller->current_page, 'prev_text' => is_rtl() ? __('→', 'wp-e-commerce') : __('←', 'wp-e-commerce'), 'next_text' => is_rtl() ? __('←', 'wp-e-commerce') : __('→', 'wp-e-commerce'), 'end_size' => 3, 'mid_size' => 2); $defaults = apply_filters('wpsc_get_customer_orders_pagination_links', $defaults); $r = wp_parse_args($args, $defaults); return apply_filters('wpsc_get_product_pagination_links', paginate_links($r)); }
function _wpsc_filter_body_class($classes) { if (!wpsc_is_controller()) { return $classes; } $classes[] = 'wpsc-controller'; $classes[] = 'wpsc-' . _wpsc_get_current_controller_name(); $classes[] = 'wpsc-controller-' . _wpsc_get_current_controller_slug(); if (wpsc_is_store() || wpsc_is_store_front_page() || wpsc_is_product_category() || wpsc_is_product_tag()) { $classes[] = 'wpsc-' . wpsc_get_option('layout'); } return $classes; }
public function get_replaced_content() { global $wp_query; $current_controller = _wpsc_get_current_controller_name(); $before = apply_filters('wpsc_replace_the_content_before', '<div class="%s">', $current_controller); $after = apply_filters('wpsc_replace_the_content_after', '</div>', $current_controller); $before = sprintf($before, 'wpsc-page wpsc-page-' . $current_controller); ob_start(); wpsc_get_template_part($this->view); $content = ob_get_clean(); return $before . $content . $after; }