• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wc_get_endpoint_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: add_edit_address_subscription_action

 /**
  * Add a "Change Shipping Address" button to the "My Subscriptions" table for those subscriptions
  * which require shipping.
  *
  * @param array $all_actions The $subscription_key => $actions array with all actions that will be displayed for a subscription on the "My Subscriptions" table
  * @param array $subscriptions All of a given users subscriptions that will be displayed on the "My Subscriptions" table
  * @since 1.3
  */
 public static function add_edit_address_subscription_action($all_actions, $subscriptions)
 {
     foreach ($all_actions as $subscription_key => $actions) {
         $order = new WC_Order($subscriptions[$subscription_key]['order_id']);
         $needs_shipping = false;
         foreach ($order->get_items() as $item) {
             if ($item['product_id'] !== $subscriptions[$subscription_key]['product_id']) {
                 continue;
             }
             $product = $order->get_product_from_item($item);
             if (!is_object($product)) {
                 // In case a product has been deleted
                 continue;
             }
             if ($product->needs_shipping()) {
                 $needs_shipping = true;
             }
         }
         if ($needs_shipping && in_array($subscriptions[$subscription_key]['status'], array('active', 'on-hold'))) {
             // WC 2.1+
             if (function_exists('wc_get_endpoint_url')) {
                 $all_actions[$subscription_key] = array('change_address' => array('url' => add_query_arg(array('subscription' => $subscription_key), wc_get_endpoint_url('edit-address', 'shipping')), 'name' => __('Change Address', 'woocommerce-subscriptions'))) + $all_actions[$subscription_key];
             } else {
                 $all_actions[$subscription_key] = array('change_address' => array('url' => add_query_arg(array('address' => 'shipping', 'subscription' => $subscription_key), get_permalink(woocommerce_get_page_id('edit_address'))), 'name' => __('Change Address', 'woocommerce-subscriptions'))) + $all_actions[$subscription_key];
             }
         }
     }
     return $all_actions;
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:37,代码来源:class-wc-subscriptions-addresses.php


示例2: add_edit_address_subscription_action

 /**
  * Add a "Change Shipping Address" button to the "My Subscriptions" table for those subscriptions
  * which require shipping.
  *
  * @param array $all_actions The $subscription_id => $actions array with all actions that will be displayed for a subscription on the "My Subscriptions" table
  * @param array $subscriptions All of a given users subscriptions that will be displayed on the "My Subscriptions" table
  * @since 1.3
  */
 public static function add_edit_address_subscription_action($actions, $subscription)
 {
     if ($subscription->needs_shipping_address() && $subscription->has_status(array('active', 'on-hold'))) {
         $actions['change_address'] = array('url' => add_query_arg(array('subscription' => $subscription->id), wc_get_endpoint_url('edit-address', 'shipping')), 'name' => __('Change Address', 'woocommerce-subscriptions'));
     }
     return $actions;
 }
开发者ID:ltdat287,项目名称:id.nhomdichvu,代码行数:15,代码来源:class-wc-subscriptions-addresses.php


示例3: get_url

 /**
  * @param $page
  */
 function get_url($page)
 {
     switch ($page) {
         case 'sign_out':
             return wc_get_endpoint_url('customer-logout', '', wc_get_page_permalink('myaccount'));
         case 'edit_account_url':
             return wc_customer_edit_account_url();
     }
 }
开发者ID:hoangsoft90,项目名称:hw-hoangweb-plugin,代码行数:12,代码来源:hw-woo-customer.php


示例4: get_return_url

 /**
  * Get the return url (thank you page)
  *
  * @access public
  * @param string $order (default: '')
  * @return string
  */
 public function get_return_url($order = '')
 {
     if ($order) {
         $return_url = $order->get_checkout_order_received_url();
     } else {
         $return_url = wc_get_endpoint_url('order-received', '', get_permalink(wc_get_page_id('checkout')));
     }
     if (is_ssl() || get_option('woocommerce_force_ssl_checkout') == 'yes') {
         $return_url = str_replace('http:', 'https:', $return_url);
     }
     return apply_filters('woocommerce_get_return_url', $return_url);
 }
开发者ID:phupx,项目名称:genco,代码行数:19,代码来源:abstract-wc-payment-gateway.php


示例5: woocommerce_get_checkout_order_received_url

 function woocommerce_get_checkout_order_received_url($order_received_url, $order_class)
 {
     if (defined('ICL_LANGUAGE_CODE')) {
         $checkout_pid = wc_get_page_id('checkout');
         if (!empty($_REQUEST['lang'])) {
             if (function_exists('icl_object_id')) {
                 $checkout_pid = icl_object_id($checkout_pid, 'page', true, $_REQUEST['lang']);
             }
         }
         $order_received_url = wc_get_endpoint_url('order-received', $order_class->id, get_permalink($checkout_pid));
         if ('yes' == get_option('woocommerce_force_ssl_checkout') || is_ssl()) {
             $order_received_url = str_replace('http:', 'https:', $order_received_url);
         }
         $order_received_url = add_query_arg('key', $order_class->order_key, $order_received_url);
         return $order_received_url;
     } else {
         return $order_received_url;
     }
 }
开发者ID:ksw2342,项目名称:kau_webstudio_12,代码行数:19,代码来源:class-wc-inicis-payment.php


示例6: save_address

 /**
  * Save and and update a billing or shipping address if the
  * form was submitted through the user account page.
  */
 public static function save_address()
 {
     global $wp;
     if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
         return;
     }
     if (empty($_POST['action']) || 'edit_address' !== $_POST['action'] || empty($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'woocommerce-edit_address')) {
         return;
     }
     $user_id = get_current_user_id();
     if ($user_id <= 0) {
         return;
     }
     $load_address = isset($wp->query_vars['edit-address']) ? wc_edit_address_i18n(sanitize_title($wp->query_vars['edit-address']), true) : 'billing';
     $address = WC()->countries->get_address_fields(esc_attr($_POST[$load_address . '_country']), $load_address . '_');
     foreach ($address as $key => $field) {
         if (!isset($field['type'])) {
             $field['type'] = 'text';
         }
         // Get Value.
         switch ($field['type']) {
             case 'checkbox':
                 $_POST[$key] = (int) isset($_POST[$key]);
                 break;
             default:
                 $_POST[$key] = isset($_POST[$key]) ? wc_clean($_POST[$key]) : '';
                 break;
         }
         // Hook to allow modification of value.
         $_POST[$key] = apply_filters('woocommerce_process_myaccount_field_' . $key, $_POST[$key]);
         // Validation: Required fields.
         if (!empty($field['required']) && empty($_POST[$key])) {
             wc_add_notice(sprintf(__('%s is a required field.', 'woocommerce'), $field['label']), 'error');
         }
         if (!empty($_POST[$key])) {
             // Validation rules.
             if (!empty($field['validate']) && is_array($field['validate'])) {
                 foreach ($field['validate'] as $rule) {
                     switch ($rule) {
                         case 'postcode':
                             $_POST[$key] = strtoupper(str_replace(' ', '', $_POST[$key]));
                             if (!WC_Validation::is_postcode($_POST[$key], $_POST[$load_address . '_country'])) {
                                 wc_add_notice(__('Please enter a valid postcode / ZIP.', 'woocommerce'), 'error');
                             } else {
                                 $_POST[$key] = wc_format_postcode($_POST[$key], $_POST[$load_address . '_country']);
                             }
                             break;
                         case 'phone':
                             $_POST[$key] = wc_format_phone_number($_POST[$key]);
                             if (!WC_Validation::is_phone($_POST[$key])) {
                                 wc_add_notice(sprintf(__('%s is not a valid phone number.', 'woocommerce'), '<strong>' . $field['label'] . '</strong>'), 'error');
                             }
                             break;
                         case 'email':
                             $_POST[$key] = strtolower($_POST[$key]);
                             if (!is_email($_POST[$key])) {
                                 wc_add_notice(sprintf(__('%s is not a valid email address.', 'woocommerce'), '<strong>' . $field['label'] . '</strong>'), 'error');
                             }
                             break;
                     }
                 }
             }
         }
     }
     do_action('woocommerce_after_save_address_validation', $user_id, $load_address, $address);
     if (0 === wc_notice_count('error')) {
         foreach ($address as $key => $field) {
             update_user_meta($user_id, $key, $_POST[$key]);
         }
         wc_add_notice(__('Address changed successfully.', 'woocommerce'));
         do_action('woocommerce_customer_save_address', $user_id, $load_address);
         wp_safe_redirect(wc_get_endpoint_url('edit-address', '', wc_get_page_permalink('myaccount')));
         exit;
     }
 }
开发者ID:johnulist,项目名称:woocommerce,代码行数:79,代码来源:class-wc-form-handler.php


示例7: wc_customer_edit_account_url

/**
 * Get the link to the edit account details page.
 *
 * @return string
 */
function wc_customer_edit_account_url()
{
    $edit_account_url = wc_get_endpoint_url('edit-account', '', wc_get_page_permalink('myaccount'));
    return apply_filters('woocommerce_customer_edit_account_url', $edit_account_url);
}
开发者ID:manuhareendran,项目名称:project,代码行数:10,代码来源:wc-page-functions.php


示例8: wc_print_notices

 * @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
}
wc_print_notices();
?>

<p class="myaccount_user">
	<?php 
// print_r($current_user);
printf(__('Hello <strong>%1$s</strong> (not %1$s? <a href="%2$s">Sign out</a>).', 'woocommerce') . ' ', $current_user->user_email, wc_get_endpoint_url('customer-logout', '', wc_get_page_permalink('myaccount')));
printf(__('From your account dashboard you can view your recent orders, manage your shipping and billing addresses and <a href="%s">edit your password and account details</a>.', 'woocommerce'), wc_customer_edit_account_url());
?>
</p>

<?php 
do_action('woocommerce_before_my_account');
?>

<?php 
wc_get_template('myaccount/my-downloads.php');
?>

<?php 
wc_get_template('myaccount/my-orders.php', array('order_count' => $order_count));
?>
开发者ID:willowmagrini,项目名称:dg,代码行数:31,代码来源:OLD-my-account.php


示例9: esc_url

				<a class="woocommerce-Button woocommerce-Button--previous button" href="<?php 
            echo esc_url(wc_get_endpoint_url('orders', $current_page - 1));
            ?>
"><?php 
            _e('Previous', 'woocommerce');
            ?>
</a>
			<?php 
        }
        ?>

			<?php 
        if (intval($customer_orders->max_num_pages) !== $current_page) {
            ?>
				<a class="woocommerce-Button woocommerce-Button--next button" href="<?php 
            echo esc_url(wc_get_endpoint_url('orders', $current_page + 1));
            ?>
"><?php 
            _e('Next', 'woocommerce');
            ?>
</a>
			<?php 
        }
        ?>
		</div>
	<?php 
    }
    ?>

<?php 
} else {
开发者ID:Korkey128k,项目名称:woocommerce,代码行数:31,代码来源:orders.php


示例10: woocommerce_get_endpoint_url

/**
 * @deprecated
 */
function woocommerce_get_endpoint_url($endpoint, $value = '', $permalink = '')
{
    return wc_get_endpoint_url($endpoint, $value, $permalink);
}
开发者ID:nayemDevs,项目名称:woocommerce,代码行数:7,代码来源:wc-deprecated-functions.php


示例11: nav_menu_links

        public function nav_menu_links()
        {
            $exclude = array('view-order', 'add-payment-method', 'order-pay', 'order-received');
            ?>
		<div id="posttype-woocommerce-endpoints" class="posttypediv">
			<div id="tabs-panel-woocommerce-endpoints" class="tabs-panel tabs-panel-active">
				<ul id="woocommerce-endpoints-checklist" class="categorychecklist form-no-clear">
					<?php 
            $i = -1;
            foreach (WC()->query->query_vars as $key => $value) {
                if (in_array($key, $exclude)) {
                    continue;
                }
                ?>
						<li>
							<label class="menu-item-title">
								<input type="checkbox" class="menu-item-checkbox" name="menu-item[<?php 
                echo esc_attr($i);
                ?>
][menu-item-object-id]" value="<?php 
                echo esc_attr($i);
                ?>
" /> <?php 
                echo esc_html($key);
                ?>
							</label>
							<input type="hidden" class="menu-item-type" name="menu-item[<?php 
                echo esc_attr($i);
                ?>
][menu-item-type]" value="custom" />
							<input type="hidden" class="menu-item-title" name="menu-item[<?php 
                echo esc_attr($i);
                ?>
][menu-item-title]" value="<?php 
                echo esc_html($key);
                ?>
" />
							<input type="hidden" class="menu-item-url" name="menu-item[<?php 
                echo esc_attr($i);
                ?>
][menu-item-url]" value="<?php 
                echo esc_url(wc_get_endpoint_url($key, '', wc_get_page_permalink('myaccount')));
                ?>
" />
							<input type="hidden" class="menu-item-classes" name="menu-item[<?php 
                echo esc_attr($i);
                ?>
][menu-item-classes]" />
						</li>
						<?php 
                $i--;
            }
            ?>
				</ul>
			</div>
			<p class="button-controls">
				<span class="list-controls">
					<a href="<?php 
            echo admin_url('nav-menus.php?page-tab=all&selectall=1#posttype-woocommerce-endpoints');
            ?>
" class="select-all"><?php 
            _e('Select All', 'woocommerce');
            ?>
</a>
				</span>
				<span class="add-to-menu">
					<input type="submit" class="button-secondary submit-add-to-menu right" value="<?php 
            esc_attr_e('Add to Menu', 'woocommerce');
            ?>
" name="add-post-type-menu-item" id="submit-posttype-woocommerce-endpoints">
					<span class="spinner"></span>
				</span>
			</p>
		</div>
		<?php 
        }
开发者ID:reprovinci,项目名称:woocommerce,代码行数:76,代码来源:class-wc-admin-menus.php


示例12: str_replace

                $addr_key = str_replace('shipping_', '', $field_name);
                $address[$addr_key] = isset($addr[$field_name]) ? $addr[$field_name] : '';
            }
            if (!empty($address)) {
                $formatted_address = $woocommerce->countries->get_formatted_address($address);
                $json_address = json_encode($address);
            }
            if (!$formatted_address) {
                continue;
            }
            ?>
		                <div class="account-address">
                            <?php 
            if (isset($addr['default_address']) && $addr['default_address']) {
                if (function_exists('wc_get_endpoint_url')) {
                    echo '<a href="' . wc_get_endpoint_url('edit-address', 'shipping', get_permalink(woocommerce_get_page_id('myaccount'))) . '" class="edit">' . __('edit', 'wc_shipping_multiple_address') . '</a>';
                } else {
                    echo '<a href="' . esc_url(add_query_arg('address', 'shipping', get_permalink(woocommerce_get_page_id('edit_address')))) . '" class="edit">' . __('edit', 'wc_shipping_multiple_address') . '</a>';
                }
            } else {
                echo '<a class="edit" href="' . $addresses_url . '#shipping_address_' . $x . '">' . __('edit', 'wc_shipping_multiple_address') . '</a>';
            }
            ?>

		                    <address><?php 
            echo $formatted_address;
            ?>
</address>

		                    <div style="display: none;">
		                    <?php 
开发者ID:avijitdeb,项目名称:flatterbox.com,代码行数:31,代码来源:shipping-address-drop.php


示例13: wc_get_customer_orders


//.........这里部分代码省略.........
							</td>
						<?php 
            }
            ?>
					</tr>
				<?php 
        }
        ?>
			</tbody>
		</table>
<?php 
    } else {
        ?>
		
		<div class="woocommerce-Message woocommerce-Message--info woocommerce-info">
			<a class="woocommerce-Button button" href="<?php 
        echo esc_url(apply_filters('woocommerce_return_to_shop_redirect', wc_get_page_permalink('shop')));
        ?>
">
				<?php 
        _e('Go Shop', 'woocommerce');
        ?>
			</a>
			<?php 
        _e('No order has been made yet.', 'woocommerce');
        ?>
		</div>


<?php 
    }
    ?>

<?php 
    echo '<p><a href="' . esc_url(wc_get_endpoint_url('orders')) . '">Ver Todos</a></p>';
    do_action('woocommerce_after_account_orders', $has_orders);
    $customer_id = get_current_user_id();
    if (!wc_ship_to_billing_address_only() && wc_shipping_enabled()) {
        $get_addresses = apply_filters('woocommerce_my_account_get_addresses', array('billing' => __('Billing Address', 'woocommerce'), 'shipping' => __('Shipping Address', 'woocommerce')), $customer_id);
    } else {
        $get_addresses = apply_filters('woocommerce_my_account_get_addresses', array('billing' => __('Billing Address', 'woocommerce')), $customer_id);
    }
    $oldcol = 1;
    $col = 1;
    ?>

<?php 
    if (!wc_ship_to_billing_address_only() && wc_shipping_enabled()) {
        echo '<div class="u-columns woocommerce-Addresses col2-set addresses">';
    }
    ?>

<?php 
    foreach ($get_addresses as $name => $title) {
        ?>

	<div class="u-column<?php 
        echo ($col = $col * -1) < 0 ? 1 : 2;
        ?>
 col-<?php 
        echo ($oldcol = $oldcol * -1) < 0 ? 1 : 2;
        ?>
 woocommerce-Address">
		<header class="woocommerce-Address-title title">
			<h3>Cadastro</h3>
			<a href="<?php 
        echo esc_url(wc_get_endpoint_url('edit-address', $name));
        ?>
" class="edit"><?php 
        _e('Edit', 'woocommerce');
        ?>
</a>
		</header>
		<address>
			<?php 
        $address = apply_filters('woocommerce_my_account_my_address_formatted_address', array('first_name' => get_user_meta($customer_id, $name . '_first_name', true), 'last_name' => get_user_meta($customer_id, $name . '_last_name', true), 'company' => get_user_meta($customer_id, $name . '_company', true), 'address_1' => get_user_meta($customer_id, $name . '_address_1', true), 'address_2' => get_user_meta($customer_id, $name . '_address_2', true), 'city' => get_user_meta($customer_id, $name . '_city', true), 'state' => get_user_meta($customer_id, $name . '_state', true), 'postcode' => get_user_meta($customer_id, $name . '_postcode', true), 'country' => get_user_meta($customer_id, $name . '_country', true)), $customer_id, $name);
        $formatted_address = WC()->countries->get_formatted_address($address);
        if (!$formatted_address) {
            _e('You have not set up this type of address yet.', 'woocommerce');
        } else {
            echo $formatted_address;
        }
        ?>
		</address>
	</div>

<?php 
    }
    ?>

<?php 
    if (!wc_ship_to_billing_address_only() && wc_shipping_enabled()) {
        echo '</div>';
    }
    ?>


</div><!-- pedidos -->
<?php 
}
开发者ID:willowmagrini,项目名称:dg,代码行数:101,代码来源:functions.php


示例14: apply_filters

?>

<h2><?php echo $page_title; ?></h2>

<p class="myaccount_address">
	<?php echo apply_filters( 'woocommerce_my_account_my_address_description', __( 'The following addresses will be used on the checkout page by default.', 'woocommerce' ) ); ?>
</p>

<?php if ( ! wc_ship_to_billing_address_only() && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) echo '<div class="col2-set addresses">'; ?>

<?php foreach ( $get_addresses as $name => $title ) : ?>

	<div class="col-<?php echo ( ( $col = $col * -1 ) < 0 ) ? 1 : 2; ?> address">
		<header class="title">
			<h3 ><?php echo $title; ?></h3>
			<a href="<?php echo wc_get_endpoint_url( 'edit-address', $name ); ?>/#myaccount" class="edit"><?php _e( 'Edit', 'woocommerce' ); ?></a>
		</header>
		<address>
			<?php
				$address = apply_filters( 'woocommerce_my_account_my_address_formatted_address', array(
					'first_name'  => get_user_meta( $customer_id, $name . '_first_name', true ),
					'last_name'   => get_user_meta( $customer_id, $name . '_last_name', true ),
					'company'     => get_user_meta( $customer_id, $name . '_company', true ),
					'address_1'   => get_user_meta( $customer_id, $name . '_address_1', true ),
					'address_2'   => get_user_meta( $customer_id, $name . '_address_2', true ),
					'city'        => get_user_meta( $customer_id, $name . '_city', true ),
					'state'       => get_user_meta( $customer_id, $name . '_state', true ),
					'postcode'    => get_user_meta( $customer_id, $name . '_postcode', true ),
					'country'     => get_user_meta( $customer_id, $name . '_country', true )
				), $customer_id, $name );
开发者ID:helloworld-digital,项目名称:katemorgan,代码行数:30,代码来源:my-address.php


示例15: echo

    ?>

	<div class="u-column<?php 
    echo ($col = $col * -1) < 0 ? 1 : 2;
    ?>
 col-<?php 
    echo ($oldcol = $oldcol * -1) < 0 ? 1 : 2;
    ?>
 woocommerce-Address">
		<header class="woocommerce-Address-title title">
			<h3><?php 
    echo $title;
    ?>
</h3>
			<a href="<?php 
    echo esc_url(wc_get_endpoint_url('edit-address', $name));
    ?>
" class="edit"><?php 
    _e('Edit', 'woocommerce');
    ?>
</a>
		</header>
		<address>
			<?php 
    $address = apply_filters('woocommerce_my_account_my_address_formatted_address', array('first_name' => get_user_meta($customer_id, $name . '_first_name', true), 'last_name' => get_user_meta($customer_id, $name . '_last_name', true), 'company' => get_user_meta($customer_id, $name . '_company', true), 'address_1' => get_user_meta($customer_id, $name . '_address_1', true), 'address_2' => get_user_meta($customer_id, $name . '_address_2', true), 'city' => get_user_meta($customer_id, $name . '_city', true), 'state' => get_user_meta($customer_id, $name . '_state', true), 'postcode' => get_user_meta($customer_id, $name . '_postcode', true), 'country' => get_user_meta($customer_id, $name . '_country', true)), $customer_id, $name);
    $formatted_address = WC()->countries->get_formatted_address($address);
    if (!$formatted_address) {
        _e('You have not set up this type of address yet.', 'woocommerce');
    } else {
        echo $formatted_address;
    }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:31,代码来源:my-address.php


示例16: foreach

<?php 
foreach ($get_addresses as $name => $title) {
    ?>

	<div class="col-<?php 
    echo ($col = $col * -1) < 0 ? 1 : 2;
    ?>
 address">
		<header class="title">
			<h3><?php 
    echo $title;
    ?>
</h3>
			<a href="<?php 
    echo wc_get_endpoint_url('edit-address', $name);
    ?>
" class="edit"><?php 
    _e('Edit', 'woocommerce');
    ?>
</a>
		</header>
		<address>
			<?php 
    $address = apply_filters('woocommerce_my_account_my_address_formatted_address', array('first_name' => get_user_meta($customer_id, $name . '_first_name', true), 'last_name' => get_user_meta($customer_id, $name . '_last_name', true), 'company' => get_user_meta($customer_id, $name . '_company', true), 'address_1' => get_user_meta($customer_id, $name . '_address_1', true), 'address_2' => get_user_meta($customer_id, $name . '_address_2', true), 'city' => get_user_meta($customer_id, $name . '_city', true), 'state' => get_user_meta($customer_id, $name . '_state', true), 'postcode' => get_user_meta($customer_id, $name . '_postcode', true), 'country' => get_user_meta($customer_id, $name . '_country', true)), $customer_id, $name);
    $formatted_address = WC()->countries->get_formatted_address($address);
    if (!$formatted_address) {
        _e('You have not set up this type of address yet.', 'woocommerce');
    } else {
        echo $formatted_address;
    }
开发者ID:randyriolis,项目名称:woocommerce,代码行数:30,代码来源:my-address.php


示例17: get_table_title_html

 /**
  * Return the table title HTML, text defaults to "My Payment Methods"
  *
  * @since 4.0.0
  * @return string table title HTML
  */
 protected function get_table_title_html()
 {
     $title = apply_filters('wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_title', __('My Payment Methods', $this->get_plugin()->get_text_domain()), $this);
     $html = '<div class="sv-wc-payment-gateway-my-payment-methods-table-title">';
     $html .= sprintf('<h2 id="wc-%s-my-payment-methods">%s</h2>', $this->get_plugin()->get_id_dasherized(), esc_html($title));
     if ($this->supports_add_payment_method()) {
         $html .= sprintf('<a class="button sv-wc-payment-gateway-my-payment-methods-add-payment-method-button dashicons-before dashicons-plus-alt" href="%s">%s</a>', esc_url(wc_get_endpoint_url('add-payment-method')), esc_html_x('Add New Payment Method', 'Supports add new payment method feature', $this->get_plugin()->get_text_domain()));
     }
     $html .= '</div>';
     return apply_filters('wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_title_html', $html, $this);
 }
开发者ID:shredzjc,项目名称:wc-plugin-framework,代码行数:17,代码来源:class-sv-wc-payment-gateway-my-payment-methods.php


示例18: add_payment_method

 /**
  * Entry method for the Add Payment Method feature flow. Note this is *not*
  * stubbed in the WC_Payment_Gateway abstract class, but is called if the
  * gateway declares support for it.
  *
  * @since 4.0.0
  */
 public function add_payment_method()
 {
     assert($this->supports_add_payment_method());
     $order = $this->get_order_for_add_payment_method();
     try {
         $result = $this->do_add_payment_method_transaction($order);
     } catch (SV_WC_Plugin_Exception $e) {
         $result = array('message' => sprintf(esc_html__('Oops, adding your new payment method failed: %s', 'woocommerce-plugin-framework'), $e->getMessage()), 'success' => false);
     }
     SV_WC_Helper::wc_add_notice($result['message'], $result['success'] ? 'success' : 'error');
     // if successful, redirect to the newly added method
     if ($result['success']) {
         // if this is WooCommerce 2.5.5 or older, redirect to the My Account page
         if (SV_WC_Plugin_Compatibility::is_wc_version_lt_2_6()) {
             $redirect_url = wc_get_page_permalink('myaccount');
             // otherwise, redirect to the Payment Methods page (WC 2.6+)
         } else {
             $redirect_url = wc_get_account_endpoint_url('payment-methods');
         }
         // otherwise, back to the Add Payment Method page
     } else {
         $redirect_url = wc_get_endpoint_url('add-payment-method');
     }
     wp_safe_redirect($redirect_url);
     exit;
 }
开发者ID:DustinHartzler,项目名称:TheCLEFT,代码行数:33,代码来源:class-sv-wc-payment-gateway-direct.php


示例19: dokan_header_user_menu

    /**
     * User top navigation menu
     *
     * @return void
     */
    function dokan_header_user_menu()
    {
        ?>
    <ul class="nav navbar-nav navbar-right">
        <li>
            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php 
        printf(__('Cart %s', 'dokan'), '<span class="dokan-cart-amount-top">(' . WC()->cart->get_cart_total() . ')</span>');
        ?>
 <b class="caret"></b></a>

            <ul class="dropdown-menu">
                <li>
                    <div class="widget_shopping_cart_content"></div>
                </li>
            </ul>
        </li>

        <?php 
        if (is_user_logged_in()) {
            ?>

            <?php 
            global $current_user;
            $user_id = $current_user->ID;
            if (dokan_is_user_seller($user_id)) {
                ?>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php 
                _e('Seller Dashboard', 'dokan');
                ?>
 <b class="caret"></b></a>

                    <ul class="dropdown-menu">
                        <li><a href="<?php 
                echo dokan_get_store_url($user_id);
                ?>
" target="_blank"><?php 
                _e('Visit your store', 'dokan');
                ?>
 <i class="fa fa-external-link"></i></a></li>
                        <li class="divider"></li>
                        <?php 
                $nav_urls = dokan_get_dashboard_nav();
                foreach ($nav_urls as $key => $item) {
                    printf('<li><a href="%s">%s &nbsp;%s</a></li>', $item['url'], $item['icon'], $item['title']);
                }
                ?>
                    </ul>
                </li>
            <?php 
            }
            ?>

            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php 
            echo esc_html($current_user->display_name);
            ?>
 <b class="caret"></b></a>
                <ul class="dropdown-menu">
                    <li><a href="<?php 
            echo dokan_get_page_url('my_orders');
            ?>
"><?php 
            _e('My Orders', 'dokan');
            ?>
</a></li>
                    <li><a href="<?php 
            echo dokan_get_page_url('myaccount', 'woocommerce');
            ?>
"><?php 
            _e('My Account', 'dokan');
            ?>
</a></li>
                    <li><a href="<?php 
            echo wc_customer_edit_account_url();
            ?>
"><?php 
            _e('Edit Account', 'dokan');
            ?>
</a></li>
                    <li class="divider"></li>
                    <li><a href="<?php 
            echo wc_get_endpoint_url('edit-address', 'billing', get_permalink(wc_get_page_id('myaccount')));
            ?>
"><?php 
            _e('Billing Address', 'dokan');
            ?>
</a></li>
                    <li><a href="<?php 
            echo wc_get_endpoint_url('edit-address', 'shipping', get_permalink(wc_get_page_id('myaccount')));
            ?>
"><?php 
            _e('Shipping Address', 'dokan');
            ?>
</a></li>
//.........这里部分代码省略.........
开发者ID:abcode619,项目名称:wpstuff,代码行数:101,代码来源:template-tags.php


示例20: sprintf

 */
if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
?>

<p>
	<?php 
echo sprintf(esc_attr__('Hello %s%s%s (not %2$s? %sSign out%s)', 'woocommerce'), '<strong>', esc_html($current_user->display_name), '</strong>', '<a href="' . esc_url(wc_logout_url(wc_get_page_permalink('myaccount'))) . '">', '</a>');
?>
</p>

<p>
	<?php 
echo sprintf(esc_attr__('From your account dashboard you can view your %1$srecent orders%2$s, manage your %3$sshipping and billing addresses%2$s and %4$sedit your password and account details%2$s.', 'woocommerce'), '<a href="' . esc_url(wc_get_endpoint_url('orders')) . '">', '</a>', '<a href="' . esc_url(wc_get_endpoint_url('edit-address')) . '">', '<a href="' . esc_url(wc_get_endpoint_url('edit-account')) . '">');
?>
</p>

<?php 
/**
 * My Account dashboard.
 *
 * @since 2.6.0
 */
do_action('woocommerce_account_dashboard');
/**
 * Deprecated woocommerce_before_my_account action.
 *
 * @deprecated 2.6.0
 */
开发者ID:AndyA,项目名称:River,代码行数:31,代码来源:dashboard.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wc_get_featured_product_ids函数代码示例发布时间:2022-05-23
下一篇:
PHP wc_get_dimension函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap