本文整理汇总了PHP中woocommerce_login_form函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_login_form函数的具体用法?PHP woocommerce_login_form怎么用?PHP woocommerce_login_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了woocommerce_login_form函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wcj_shortcode
/**
* wcj_shortcode.
*
* @version 2.5.7
*/
function wcj_shortcode($atts, $content, $shortcode)
{
// Init
if (empty($atts)) {
$atts = array();
}
// Add child class specific atts
$atts = $this->add_extra_atts($atts);
// Merge atts with global defaults
$global_defaults = array('before' => '', 'after' => '', 'visibility' => '', 'site_visibility' => '', 'location' => '', 'not_location' => '', 'wpml_language' => '', 'wpml_not_language' => '', 'billing_country' => '', 'not_billing_country' => '', 'module' => '', 'find' => '', 'replace' => '');
$atts = array_merge($global_defaults, $atts);
// Check for required atts
if (false === ($atts = $this->init_atts($atts))) {
return '';
}
// Check for module enabled
if ('' != $atts['module'] && !wcj_is_module_enabled($atts['module'])) {
return '<p>' . sprintf(__('%s module not enabled!', 'woocommerce-jetpack'), $atts['module_name']) . '</p>';
}
// Check if privileges are ok
if ('' != $atts['visibility']) {
$visibilities = str_replace(' ', '', $atts['visibility']);
$visibilities = explode(',', $visibilities);
$is_iser_visibility_ok = false;
foreach ($visibilities as $visibility) {
if ('admin' === $visibility) {
$visibility = 'administrator';
}
if (wcj_is_user_role($visibility)) {
$is_iser_visibility_ok = true;
break;
}
}
if (!$is_iser_visibility_ok) {
// return '<p><a href="' . wp_login_url( get_permalink() ) . '" title="' . $atts['login_text'] . '">' . $atts['login_text'] . '</a></p>';
if (!is_user_logged_in()) {
ob_start();
woocommerce_login_form();
return ob_get_clean();
} else {
return '<p>' . __('Wrong user role!', 'woocommerce-jetpack') . '</p>';
}
}
}
// Check if site visibility is ok
if ('' != $atts['site_visibility']) {
if ('single' === $atts['site_visibility'] && !is_single() || 'page' === $atts['site_visibility'] && !is_page() || 'archive' === $atts['site_visibility'] && !is_archive()) {
return '';
}
}
// Check if location is ok
if ('' != $atts['location'] && 'all' != $atts['location'] && $atts['location'] != $this->wcj_get_user_location()) {
return '';
}
if ('' != $atts['not_location'] && $atts['not_location'] === $this->wcj_get_user_location()) {
return '';
}
// Check if language is ok
if ('wcj_wpml' === $shortcode || 'wcj_wpml_translate' === $shortcode) {
$atts['wpml_language'] = isset($atts['lang']) ? $atts['lang'] : '';
}
if ('wcj_wpml' === $shortcode || 'wcj_wpml_translate' === $shortcode) {
$atts['wpml_not_language'] = isset($atts['not_lang']) ? $atts['not_lang'] : '';
}
if ('' != $atts['wpml_language']) {
if (!defined('ICL_LANGUAGE_CODE')) {
return '';
}
if (!in_array(ICL_LANGUAGE_CODE, $this->custom_explode($atts['wpml_language']))) {
return '';
}
}
// Check if language is ok (not in...)
if ('' != $atts['wpml_not_language']) {
if (defined('ICL_LANGUAGE_CODE')) {
if (in_array(ICL_LANGUAGE_CODE, $this->custom_explode($atts['wpml_not_language']))) {
return '';
}
}
}
// Check if billing country by arg is ok
if ('' != $atts['billing_country']) {
if (!isset($_GET['billing_country'])) {
return '';
}
if (!in_array($_GET['billing_country'], $this->custom_explode($atts['billing_country']))) {
return '';
}
}
// Check if billing country by arg is ok (not in...)
if ('' != $atts['not_billing_country']) {
if (isset($_GET['billing_country'])) {
if (in_array($_GET['billing_country'], $this->custom_explode($atts['not_billing_country']))) {
return '';
}
//.........这里部分代码省略.........
开发者ID:algoritmika,项目名称:woocommerce-jetpack,代码行数:101,代码来源:class-wcj-shortcodes.php
示例2: esc_html
} else {
?>
<p class="woocommerce-info"><?php
echo esc_html($info_message);
?>
<a href="#" class="showlogin"><?php
_e('Click here to login', 'woocommerce');
?>
</a></p>
<?php
}
?>
<?php
woocommerce_login_form(array('message' => __('If you have shopped with us before, please enter your details in the boxes below. If you are a new customer please proceed to the Billing & Shipping section.', 'woocommerce'), 'redirect' => get_permalink(woocommerce_get_page_id('checkout')), 'hidden' => true));
}
?>
</div><!-- .large-12 -->
</div>
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php
echo esc_url($get_checkout_url);
?>
" enctype="multipart/form-data">
<div id="customer_details">
<div class="row">
开发者ID:radscheit,项目名称:unicorn,代码行数:31,代码来源:form-checkout.php
示例3: do_action
do_action('woocommerce_before_checkout_form', $checkout);
?>
<div id="checkout-wrapper" class="timeline-<?php
echo $display;
?>
">
<div id="checkout_coupon" class="woocommerce_checkout_coupon">
<?php
do_action('yith_woocommerce_checkout_coupon', $checkout);
?>
</div>
<div id="checkout_login" class="woocommerce_checkout_login">
<?php
woocommerce_login_form(array('message' => __('<h2>LOG IN</h2>', 'woocommerce'), 'redirect' => wc_get_page_permalink('checkout'), 'hidden' => false));
?>
</div>
<?php
// If checkout registration is disabled and not logged in, the user cannot checkout
if (!$checkout->enable_signup && !$checkout->enable_guest_checkout && !is_user_logged_in()) {
echo apply_filters('woocommerce_checkout_must_be_logged_in_message', __('You must be logged in to checkout.', 'woocommerce'));
return;
}
// filter hook for include new pages inside the payment method
$get_checkout_url = apply_filters('woocommerce_get_checkout_url', WC()->cart->get_checkout_url());
?>
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php
echo esc_url($get_checkout_url);
开发者ID:olechka1505,项目名称:hungrylemur,代码行数:31,代码来源:form-checkout.php
示例4: curPageURL
<?php
function curPageURL()
{
$pageURL = 'http';
if (@$_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
}
return $pageURL;
}
woocommerce_login_form(array('message' => 'Please login or create an account to complete your order.', 'redirect' => curPageURL(), 'hidden' => true));
$result = unserialize(WC()->session->RESULT);
$email = !empty($_POST['email']) ? $_POST['email'] : $result['EMAIL'];
?>
</form>
<div class="title">
<h2><?php
_e('Create A New Account', 'woocommerce');
?>
</h2>
</div>
<form action="" method="post">
<p class="form-row form-row-first">
<label for="paypalexpress_order_review_username">Username:<span class="required">*</span></label>
<input style="width: 100%;" type="text" name="username" id="paypalexpress_order_review_username" value="" />
</p>
开发者ID:sergioblanco86,项目名称:git-gitlab.com-kinivo-kinivo.com,代码行数:31,代码来源:paypal-review-order.php
示例5: apply_filters
<?php
/**
* Checkout login form
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
if (is_user_logged_in() || !$checkout->enable_signup) {
return;
}
$info_message = apply_filters('woocommerce_checkout_login_message', __('Existing customer.', 'thefoxwp'));
?>
<div id="rd_login_form">
<h2><?php
echo esc_html($info_message);
?>
</h2>
<?php
woocommerce_login_form(array('message' => '', 'redirect' => get_permalink(woocommerce_get_page_id('checkout')), 'hidden' => true));
?>
</div>
开发者ID:anbuf,项目名称:lesecuriesdelizerne,代码行数:28,代码来源:form-login.php
示例6: apply_filters
/**
* Checkout login form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-login.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
*
* @see http://docs.woothemes.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
if (!defined('ABSPATH')) {
exit;
// Exit if accessed directly
}
if (is_user_logged_in() || 'no' === get_option('woocommerce_enable_checkout_login_reminder')) {
return;
}
$info_message = apply_filters('woocommerce_checkout_login_message', __('Returning customer?', 'woocommerce'));
$info_message .= ' <a href="#" class="showlogin">' . __('Click here to login', 'woocommerce') . '</a>';
wc_print_notice($info_message, 'notice');
?>
<?php
woocommerce_login_form(array('message' => __('Si vous avez acheté des produits avec nous avant, s\'il vous plaît entrer vos coordonnées dans les champs ci-dessous. Si vous êtes un nouveau client, s\'il vous plaît passez à la section de facturation et de livraison.', 'woocommerce'), 'redirect' => wc_get_page_permalink('checkout'), 'hidden' => true));
开发者ID:Darkers54,项目名称:eLEGO,代码行数:29,代码来源:form-login.php
示例7: apply_filters
<div class="col-top">
<?php
global $woocommerce;
$cart_url = $woocommerce->cart->get_cart_url();
echo '<a href="' . $cart_url . '" class="gotocart">Back to Shopping Cart</a>';
?>
<?php
if (!is_user_logged_in()) {
$info_message = apply_filters('woocommerce_checkout_login_message', '<a href="#" class="showlogin">' . __('Returning Customer? Login Here', 'woocommerce') . '</a>');
echo $info_message;
}
?>
<div class="clear"></div>
<?php
woocommerce_login_form(array('redirect' => wc_get_page_permalink('checkout'), 'hidden' => true));
?>
</div>
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php
echo esc_url($get_checkout_url);
?>
" enctype="multipart/form-data">
<?php
if (sizeof($checkout->checkout_fields) > 0) {
?>
<div class="col2-set" id="customer_details">
开发者ID:romapad,项目名称:sound-themplate,代码行数:30,代码来源:form-checkout.php
示例8: apply_filters
}
$info_message = apply_filters('woocommerce_checkout_login_message', __('Returning customer?', 'vibe'));
$info_message .= ' <a href="#" class="showlogin">' . __('Click here to login', 'vibe') . '</a>';
wc_print_notice($info_message, 'notice');
?>
<div class="step step1">
<div class="one_half">
<div class="column_content first">
<h3 class="heading">
<?php
_e('Returning Customer', 'vibe');
?>
</h3>
<?php
woocommerce_login_form(array('message' => __('If you have shopped with us before, please enter your details in the boxes below.', 'vibe'), 'redirect' => get_permalink(wc_get_page_id('checkout')), 'hidden' => true));
?>
</div>
</div>
<?php
if (!is_user_logged_in()) {
$get_checkout_url = apply_filters('woocommerce_get_checkout_url', WC()->cart->get_checkout_url());
?>
<form name="checkout" method="post" class="checkout" action="<?php
echo esc_url($get_checkout_url);
?>
">
<div class="one_half">
<div class="column_content">
<h3 class="heading"><?php
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:31,代码来源:form-login.php
示例9: apply_filters
<?php
/**
* Checkout Login Form
*/
if (is_user_logged_in()) {
return;
}
if (get_option('woocommerce_enable_signup_and_login_from_checkout') == "no") {
return;
}
$info_message = apply_filters('woocommerce_checkout_login_message', __('Already registered?', 'woothemes'));
?>
<p class="info"><?php
echo $info_message;
?>
<a href="#" class="showlogin"><?php
_e('Click here to login', 'woothemes');
?>
</a></p>
<?php
woocommerce_login_form(__('If you have shopped with us before, please enter your username and password in the boxes below. If you are a new customer please proceed to the Billing & Shipping section.', 'woothemes'));
开发者ID:randyhoyt,项目名称:woocommerce,代码行数:24,代码来源:login-form.php
示例10: apply_filters
/**
* Checkout login form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-login.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
*
* @see http://docs.woothemes.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
if (!defined('ABSPATH')) {
exit;
// Exit if accessed directly
}
if (is_user_logged_in() || 'no' === get_option('woocommerce_enable_checkout_login_reminder')) {
return;
}
$info_message = apply_filters('woocommerce_checkout_login_message', __('Returning customer?', 'woocommerce'));
$info_message .= ' <a href="#" class="showlogin">' . __('Click here to login', 'woocommerce') . '</a>';
wc_print_notice($info_message, 'notice');
?>
<?php
woocommerce_login_form(array('message' => __('If you have shopped with us before, please enter your details in the boxes below. If you are a new customer, please proceed to the Billing Details below. Thank you!', 'woocommerce'), 'redirect' => wc_get_page_permalink('checkout'), 'hidden' => true));
开发者ID:dylanjharris,项目名称:loa,代码行数:29,代码来源:form-login.php
示例11: hwoo_login_form
/**
* @param string $message
* @param string $redirect
* @param array $data
*/
function hwoo_login_form($message = '', $redirect = '', $data = array())
{
$args = func_get_args();
$data = end($args);
if ($message) {
$data['message'] = $message;
}
if ($redirect) {
$data['redirect'] = $redirect ? true : false;
}
if (!isset($data['hidden'])) {
$data['hidden'] = true;
}
woocommerce_login_form($data);
}
开发者ID:hoangsoft90,项目名称:hw-hoangweb-plugin,代码行数:20,代码来源:template-functions.php
示例12: do_action
<?php
/**
* Checkout login form
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
if (!defined('ABSPATH')) {
exit;
// Exit if accessed directly
}
do_action('woocommerce_after_checkout_form', $checkout);
if (is_user_logged_in() || 'no' === get_option('woocommerce_enable_checkout_login_reminder')) {
return;
}
$info_message = '<a href="#" class="ui right floated button showlogin">' . __('Click here to login', 'woocommerce') . '</a>';
$info_message .= '<p>' . apply_filters('woocommerce_checkout_login_message', __('Returning customer? Please login before placing your order.', 'woocommerce')) . '</p>';
wc_print_notice($info_message, 'notice');
woocommerce_login_form(['message' => __('If you have shopped with us before please login below. If you are a new customer please proceed to place your order and an account will be created for you.', 'woocommerce'), 'redirect' => wc_get_page_permalink('checkout'), 'hidden' => true]);
开发者ID:lauralapadat,项目名称:testgit,代码行数:21,代码来源:form-login.php
示例13: _e
<div class="clear"></div>
</div>
<div class="span5 offset2">
<h5><?php
_e('Returning Customers', ETHEME_DOMAIN);
?>
</h5>
<p><?php
_e('If you have shopped with us before, please enter your details in the boxes below. If you are a new customer please proceed to the Billing & Shipping section.', ETHEME_DOMAIN);
?>
</p>
<?php
if (!is_user_logged_in() || $checkout->enable_signup) {
woocommerce_login_form(array('redirect' => get_permalink(woocommerce_get_page_id('checkout')), 'hidden' => false));
}
?>
<?php
remove_action('woocommerce_before_checkout_form', 'woocommerce_checkout_login_form', 10);
// remove login form before checkout
?>
<?php
do_action('woocommerce_before_checkout_form', $checkout);
// COUPON FORM
?>
</div>
</div>
开发者ID:MrMuzik,项目名称:ar4tupgrade,代码行数:30,代码来源:form-checkout.php
示例14: get_permalink
<?php
/**
* Checkout login form
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
if (is_user_logged_in() || !$checkout->enable_signup) {
return;
}
$checkout_page = "";
if (version_compare(WOOCOMMERCE_VERSION, "2.1.0") >= 0) {
$checkout_page = get_permalink(wc_get_page_id('checkout'));
} else {
$checkout_page = get_permalink(woocommerce_get_page_id('checkout'));
}
$info_message = apply_filters('woocommerce_checkout_login_message', __('Returning customer?', 'woocommerce'));
?>
<?php
woocommerce_login_form(array('message' => '', 'redirect' => $checkout_page, 'hidden' => false));
开发者ID:roycocup,项目名称:enclothed,代码行数:27,代码来源:form-login.php
注:本文中的woocommerce_login_form函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论