当前位置: 首页>>代码示例>>PHP>>正文


PHP edd_is_checkout函数代码示例

本文整理汇总了PHP中edd_is_checkout函数的典型用法代码示例。如果您正苦于以下问题:PHP edd_is_checkout函数的具体用法?PHP edd_is_checkout怎么用?PHP edd_is_checkout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了edd_is_checkout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edd_load_scripts

/**
 * Load Scripts
 *
 * Enqueues the required scripts.
 *
 * @access      private
 * @since       1.0
 * @return      void
*/
function edd_load_scripts()
{
    global $edd_options, $post;
    wp_enqueue_script('jquery');
    // Get position in cart of current download
    if (isset($post->ID)) {
        $position = edd_get_item_position_in_cart($post->ID);
    }
    // Load AJAX scripts, if enabled
    if (edd_is_ajax_enabled()) {
        wp_enqueue_script('edd-ajax', EDD_PLUGIN_URL . 'assets/js/edd-ajax.js', array('jquery'), EDD_VERSION);
        wp_localize_script('edd-ajax', 'edd_scripts', array('ajaxurl' => edd_get_ajax_url(), 'ajax_nonce' => wp_create_nonce('edd_ajax_nonce'), 'no_discount' => __('Please enter a discount code', 'edd'), 'discount_applied' => __('Discount Applied', 'edd'), 'no_email' => __('Please enter an email address before applying a discount code', 'edd'), 'no_username' => __('Please enter a username before applying a discount code', 'edd'), 'position_in_cart' => isset($position) ? $position : -1, 'already_in_cart_message' => __('You have already added this item to your cart', 'edd'), 'empty_cart_message' => __('Your cart is empty', 'edd'), 'loading' => __('Loading', 'edd'), 'ajax_loader' => EDD_PLUGIN_URL . 'assets/images/loading.gif', 'checkout_page' => edd_get_checkout_uri(), 'permalinks' => get_option('permalink_structure') ? '1' : '0'));
    }
    // Load jQuery validation
    if (isset($edd_options['jquery_validation']) && edd_is_checkout()) {
        wp_enqueue_script('jquery-validation', EDD_PLUGIN_URL . 'assets/js/jquery.validate.min.js');
        wp_enqueue_script('edd-validation', EDD_PLUGIN_URL . 'assets/js/form-validation.js', array('jquery', 'jquery-validation'), EDD_VERSION);
        $required = array('firstname' => true, 'lastname' => true);
        wp_localize_script('edd-validation', 'edd_scripts_validation', apply_filters('edd_scripts_validation', $required));
    }
    if (edd_is_checkout()) {
        if (edd_is_cc_verify_enabled()) {
            wp_enqueue_script('creditCardValidator', EDD_PLUGIN_URL . 'assets/js/jquery.creditCardValidator.js', array('jquery'), EDD_VERSION);
        }
        wp_enqueue_script('edd-checkout-global', EDD_PLUGIN_URL . 'assets/js/edd-checkout-global.js', array('jquery'), EDD_VERSION);
        wp_localize_script('edd-checkout-global', 'edd_global_vars', array('currency_sign' => edd_currency_filter(''), 'currency_pos' => isset($edd_options['currency_position']) ? $edd_options['currency_position'] : 'before', 'no_gateway' => __('Please select a payment method', 'edd')));
    }
}
开发者ID:vheidari,项目名称:Easy-Digital-Downloads,代码行数:37,代码来源:scripts.php

示例2: cross_selling_html

 /**
  * Changes the cross selling HTML to be more in line what we want
  *
  * @param string $html The current HTML, we discard this completely.
  * @param array  $downloads The downloads to cross/up sell.
  *
  * @return string The new HTML.
  */
 public function cross_selling_html($html, $downloads)
 {
     if (edd_is_checkout()) {
         $html = get_template_part('html_includes/shop/checkout-cross-sell', array('return' => true, 'downloads' => $downloads));
     }
     return $html;
 }
开发者ID:apsolut,项目名称:Yoast-theme-public,代码行数:15,代码来源:class-checkout-html.php

示例3: edd_sl_checkout_js

/**
 * Output the SL JavaScript for the checkout page
 *
 * @since  3.2
 * @return void
 */
function edd_sl_checkout_js()
{
    if (!function_exists('edd_is_checkout')) {
        return;
    }
    if (!edd_is_checkout()) {
        return;
    }
    ?>
	<script>
	jQuery(document).ready(function($) {
		$('#edd_sl_show_renewal_form, #edd-cancel-license-renewal').click(function(e) {
			e.preventDefault();
			$('#edd-license-key-container-wrap,#edd_sl_show_renewal_form,.edd-sl-renewal-actions').toggle();
			$('#edd-license-key').focus();
		});

		$('#edd-license-key').keyup(function(e) {
			var input  = $('#edd-license-key');
			var button = $('#edd-add-license-renewal');

			if ( input.val() != '' ) {
				button.prop("disabled", false);
			} else {
				button.prop("disabled", true);
			}
		});
	});
	</script>
<?php 
}
开发者ID:SelaInc,项目名称:eassignment,代码行数:37,代码来源:scripts.php

示例4: edd_process_add_to_cart

/**
 * Process the Add to Cart request
 *
 * @since 1.0
 *
 * @param $data
 */
function edd_process_add_to_cart($data)
{
    $download_id = absint($data['download_id']);
    $options = isset($data['edd_options']) ? $data['edd_options'] : array();
    if (!empty($data['edd_download_quantity'])) {
        $options['quantity'] = absint($data['edd_download_quantity']);
    }
    if (isset($options['price_id']) && is_array($options['price_id'])) {
        foreach ($options['price_id'] as $key => $price_id) {
            $options['quantity'][$key] = isset($data['edd_download_quantity_' . $price_id]) ? absint($data['edd_download_quantity_' . $price_id]) : 1;
        }
    }
    $cart = edd_add_to_cart($download_id, $options);
    if (edd_straight_to_checkout() && !edd_is_checkout()) {
        $query_args = remove_query_arg(array('edd_action', 'download_id', 'edd_options'));
        $query_part = strpos($query_args, "?");
        $url_parameters = '';
        if (false !== $query_part) {
            $url_parameters = substr($query_args, $query_part);
        }
        wp_redirect(edd_get_checkout_uri() . $url_parameters, 303);
        edd_die();
    } else {
        wp_redirect(remove_query_arg(array('edd_action', 'download_id', 'edd_options')));
        edd_die();
    }
}
开发者ID:pderksen,项目名称:Easy-Digital-Downloads,代码行数:34,代码来源:actions.php

示例5: checkout_no_sidebars

 function checkout_no_sidebars()
 {
     if (edd_is_checkout()) {
         // TODO: force fluid layout
         add_filter('maera/sidebar/primary', '__return_false');
         add_filter('maera/sidebar/secondary', '__return_false');
     }
 }
开发者ID:wpmu,项目名称:maera,代码行数:8,代码来源:class-maera-edd-mods.php

示例6: edd_rp_display_checkout

function edd_rp_display_checkout()
{
    if (edd_is_checkout()) {
        // GitHub Issue: https://github.com/pippinsplugins/Easy-Digital-Downloads/issues/1059
        add_filter('edd_straight_to_checkout', '__return_true');
    }
    edd_rp_get_template_part('checkout_recommendations');
}
开发者ID:nguyenthai2010,项目名称:ngocshop,代码行数:8,代码来源:template-functions.php

示例7: edd_process_add_to_cart

/**
 * Process the Add to Cart request
 *
 * @since 1.0
 * @return void
 */
function edd_process_add_to_cart($data)
{
    $download_id = $data['download_id'];
    $options = isset($data['edd_options']) ? $data['edd_options'] : array();
    $cart = edd_add_to_cart($download_id, $options);
    if (edd_straight_to_checkout() && !edd_is_checkout()) {
        wp_redirect(edd_get_checkout_uri(), 303);
        edd_die();
    }
}
开发者ID:bangtienmanh,项目名称:Easy-Digital-Downloads,代码行数:16,代码来源:actions.php

示例8: edd_rp_display_checkout

function edd_rp_display_checkout()
{
    global $post;
    if (edd_is_checkout()) {
        // GitHub Issue: https://github.com/pippinsplugins/Easy-Digital-Downloads/issues/1059
        add_filter('edd_straight_to_checkout', '__return_true');
    }
    EDD()->session->set('edd_has_recommendations', $post->ID);
    edd_rp_get_template_part('checkout_recommendations');
}
开发者ID:SelaInc,项目名称:eassignment,代码行数:10,代码来源:template-functions.php

示例9: pw_edd_disable_gateway_on_checkout

function pw_edd_disable_gateway_on_checkout($gateways)
{
    if (edd_is_checkout()) {
        // Disable Stripe if the download with an ID of 10 is in the cart
        if (edd_item_in_cart(10)) {
            unset($gateways['stripe']);
        }
    }
    return $gateways;
}
开发者ID:mintplugins,项目名称:library,代码行数:10,代码来源:disable-gateway-per-product.php

示例10: edd_process_add_to_cart

/**
 * Process the Add to Cart request
 *
 * @since 1.0
 *
 * @param $data
 */
function edd_process_add_to_cart( $data ) {
	$download_id = absint( $data['download_id'] );
	$options     = isset( $data['edd_options'] ) ? $data['edd_options'] : array();
	$cart        = edd_add_to_cart( $download_id, $options );

	if ( edd_straight_to_checkout() && ! edd_is_checkout() ) {
		wp_redirect( edd_get_checkout_uri(), 303 );
		edd_die();
	} else {
		wp_redirect( remove_query_arg( array( 'edd_action', 'download_id', 'edd_options' ) ) ); edd_die();
	}
}
开发者ID:harish94,项目名称:Easy-Digital-Downloads,代码行数:19,代码来源:actions.php

示例11: reach_hide_post_meta

/**
 * A helper function to determine whether the current post should have the meta displayed.
 *
 * @param   WP_Post $post Optional. If a post is not passed, the current $post object will be used.
 * @return  boolean
 * @since   1.0.0
 */
function reach_hide_post_meta($post = '')
{
    if (!strlen($post)) {
        global $post;
    }
    if (reach_has_edd() && edd_is_checkout()) {
        return true;
    }
    if (function_exists('hide_meta_start')) {
        return get_post_meta($post->ID, '_hide_meta', true);
    } else {
        return get_post_meta($post->ID, '_reach_hide_post_meta', true);
    }
}
开发者ID:Charitable,项目名称:Reach,代码行数:21,代码来源:helper-functions.php

示例12: pp_load_navigation_extras

/**
 * Navigation extras
 *
 * @since 1.0
*/
function pp_load_navigation_extras()
{
    // don't load on checkout
    if (function_exists('edd_is_checkout') && edd_is_checkout()) {
        return;
    }
    if (function_exists('pp_share_icon')) {
        pp_share_icon();
    }
    if (function_exists('pp_show_cart_quantity_icon')) {
        pp_show_cart_quantity_icon();
    }
    get_search_form();
}
开发者ID:apsolut,项目名称:theme,代码行数:19,代码来源:navigation.php

示例13: widget

 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     if (!empty($instance['hide_on_checkout']) && edd_is_checkout()) {
         return;
     }
     $args['id'] = isset($args['id']) ? $args['id'] : 'edd_cart_widget';
     $instance['title'] = isset($instance['title']) ? $instance['title'] : '';
     $title = apply_filters('widget_title', $instance['title'], $instance, $args['id']);
     echo $args['before_widget'];
     if ($title) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     do_action('edd_before_cart_widget');
     edd_shopping_cart(true);
     do_action('edd_after_cart_widget');
     echo $args['after_widget'];
 }
开发者ID:pderksen,项目名称:Easy-Digital-Downloads,代码行数:18,代码来源:widgets.php

示例14: widget

 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     if (isset($instance['hide_on_checkout']) && edd_is_checkout()) {
         return;
     }
     if (!isset($args['id'])) {
         $args['id'] = 'edd_cart_widget';
     }
     $title = apply_filters('widget_title', $instance['title'], $instance, $args['id']);
     global $post, $edd_options;
     echo $args['before_widget'];
     if ($title) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     do_action('edd_before_cart_widget');
     edd_shopping_cart(true);
     do_action('edd_after_cart_widget');
     echo $args['after_widget'];
 }
开发者ID:Bragi26,项目名称:Easy-Digital-Downloads,代码行数:20,代码来源:widgets.php

示例15: edd_process_add_to_cart

/**
 * Process the Add to Cart request
 *
 * @since 1.0
 *
 * @param $data
 */
function edd_process_add_to_cart($data)
{
    $download_id = absint($data['download_id']);
    $options = isset($data['edd_options']) ? $data['edd_options'] : array();
    if (!empty($data['edd_download_quantity'])) {
        $options['quantity'] = absint($data['edd_download_quantity']);
    }
    if (is_array($options['price_id'])) {
        foreach ($options['price_id'] as $key => $price_id) {
            $options['quantity'][$key] = absint($data['edd_download_quantity_' . $price_id]);
        }
    }
    $cart = edd_add_to_cart($download_id, $options);
    if (edd_straight_to_checkout() && !edd_is_checkout()) {
        wp_redirect(edd_get_checkout_uri(), 303);
        edd_die();
    } else {
        wp_redirect(remove_query_arg(array('edd_action', 'download_id', 'edd_options')));
        edd_die();
    }
}
开发者ID:jplhomer,项目名称:Easy-Digital-Downloads,代码行数:28,代码来源:actions.php


注:本文中的edd_is_checkout函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。