本文整理汇总了PHP中is_wc_endpoint_url函数的典型用法代码示例。如果您正苦于以下问题:PHP is_wc_endpoint_url函数的具体用法?PHP is_wc_endpoint_url怎么用?PHP is_wc_endpoint_url使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_wc_endpoint_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wc_page_endpoint_title
/**
* Replace a page title with the endpoint title.
* @param string $title
* @return string
*/
function wc_page_endpoint_title($title)
{
global $wp_query;
if (!is_null($wp_query) && !is_admin() && is_main_query() && in_the_loop() && is_page() && is_wc_endpoint_url()) {
$endpoint = WC()->query->get_current_endpoint();
if ($endpoint_title = WC()->query->get_endpoint_title($endpoint)) {
$title = $endpoint_title;
}
remove_filter('the_title', 'wc_page_endpoint_title');
}
return $title;
}
示例2: wc_page_endpoint_title
/**
* Replace a page title with the endpoint title
* @param string $title
* @return string
*/
function wc_page_endpoint_title($title)
{
if (is_main_query() && in_the_loop() && is_page() && is_wc_endpoint_url()) {
$endpoint = WC()->query->get_current_endpoint();
if ($endpoint_title = WC()->query->get_endpoint_title($endpoint)) {
$title = $endpoint_title;
}
}
return $title;
}
示例3: set_order_email_filters
public function set_order_email_filters($product)
{
if (is_wc_endpoint_url()) {
return $product;
}
// Add order item name actions
add_action('woocommerce_order_item_name', 'wc_gzd_cart_product_delivery_time', wc_gzd_get_hook_priority('email_product_delivery_time'), 2);
add_action('woocommerce_order_item_name', 'wc_gzd_cart_product_item_desc', wc_gzd_get_hook_priority('email_product_item_desc'), 2);
add_filter('woocommerce_order_formatted_line_subtotal', 'wc_gzd_cart_product_unit_price', wc_gzd_get_hook_priority('email_product_unit_price'), 2);
return $product;
}
示例4: wc_page_endpoint_title
public function wc_page_endpoint_title($title = '', $id = '')
{
if (is_page($id)) {
global $wp_query;
if (!is_null($wp_query) && !is_admin() && is_main_query() && in_the_loop() && is_page() && is_wc_endpoint_url()) {
$endpoint = WC()->query->get_current_endpoint();
if ('order-received' == $endpoint) {
$order_id = $wp_query->query['order-received'];
if (WC_QD()->db()->_is_donation($order_id)) {
$title = 'Donation Received';
}
}
if ('view-order' == $endpoint) {
$order_id = $wp_query->query['view-order'];
if (WC_QD()->db()->_is_donation($order_id)) {
$title = 'Donation #' . $order_id;
remove_filter('the_title', 'wc_page_endpoint_title');
}
}
}
}
return $title;
}
示例5: avada_woocommerce_before_my_account
function avada_woocommerce_before_my_account($order_count, $edit_address = false)
{
global $woocommerce;
$edit_address = is_wc_endpoint_url('edit-address');
avada_top_user_container();
?>
<ul class="woocommerce-side-nav avada-myaccount-nav">
<?php
if ($downloads = WC()->customer->get_downloadable_products()) {
?>
<li <?php
if (!$edit_address) {
echo 'class="active"';
}
?>
>
<a class="downloads" href="#">
<?php
_e('View Downloads', 'Avada');
?>
</a>
</li>
<?php
}
if (function_exists('wc_get_order_types') && function_exists('wc_get_order_statuses')) {
$customer_orders = get_posts(apply_filters('woocommerce_my_account_my_orders_query', array('numberposts' => $order_count, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => wc_get_order_types('view-orders'), 'post_status' => array_keys(wc_get_order_statuses()))));
} else {
$customer_orders = get_posts(apply_filters('woocommerce_my_account_my_orders_query', array('numberposts' => $order_count, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => 'shop_order', 'post_status' => 'publish')));
}
if ($customer_orders) {
?>
<li <?php
if (!$edit_address && !WC()->customer->get_downloadable_products()) {
echo 'class="active"';
}
?>
>
<a class="orders" href="#">
<?php
_e('View Orders', 'Avada');
?>
</a>
</li>
<?php
}
?>
<li <?php
if ($edit_address || !WC()->customer->get_downloadable_products() && !$customer_orders) {
echo 'class="active"';
}
?>
>
<a class="address" href="#">
<?php
_e('Change Address', 'Avada');
?>
</a>
</li>
<li>
<a class="account" href="#">
<?php
_e('Edit Account', 'Avada');
?>
</a>
</li>
</ul>
<div class="woocommerce-content-box avada-myaccount-data">
<?php
}
示例6: avada_woocommerce_before_my_account
function avada_woocommerce_before_my_account($order_count, $edit_address = false)
{
global $smof_data, $woocommerce, $current_user;
$edit_address = is_wc_endpoint_url('edit-address');
?>
<p class="avada_myaccount_user">
<span class="myaccount_user_container">
<span class="username">
<?php
printf(__('Hello, %s:', 'Avada'), $current_user->display_name);
?>
</span>
<?php
if ($smof_data['woo_acc_msg_1']) {
?>
<span class="msg">
<?php
echo $smof_data['woo_acc_msg_1'];
?>
</span>
<?php
}
?>
<?php
if ($smof_data['woo_acc_msg_2']) {
?>
<span class="msg">
<?php
echo $smof_data['woo_acc_msg_2'];
?>
</span>
<?php
}
?>
<span class="view-cart">
<a href="<?php
echo get_permalink(get_option('woocommerce_cart_page_id'));
?>
"><?php
_e('View Cart', 'Avada');
?>
</a>
</span>
</span>
</p>
<ul class="woocommerce-side-nav avada-myaccount-nav">
<?php
if ($downloads = WC()->customer->get_downloadable_products()) {
?>
<li <?php
if (!$edit_address) {
echo 'class="active"';
}
?>
>
<a class="downloads" href="#">
<?php
_e('View Downloads', 'Avada');
?>
</a>
</li>
<?php
}
if (function_exists('wc_get_order_types') && function_exists('wc_get_order_statuses')) {
$customer_orders = get_posts(apply_filters('woocommerce_my_account_my_orders_query', array('numberposts' => $order_count, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => wc_get_order_types('view-orders'), 'post_status' => array_keys(wc_get_order_statuses()))));
} else {
$customer_orders = get_posts(apply_filters('woocommerce_my_account_my_orders_query', array('numberposts' => $order_count, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => 'shop_order', 'post_status' => 'publish')));
}
if ($customer_orders) {
?>
<li <?php
if (!$edit_address && !WC()->customer->get_downloadable_products()) {
echo 'class="active"';
}
?>
>
<a class="orders" href="#">
<?php
_e('View Orders', 'Avada');
?>
</a>
</li>
<?php
}
?>
<li <?php
if ($edit_address || !WC()->customer->get_downloadable_products() && !$customer_orders) {
echo 'class="active"';
}
?>
>
<a class="address" href="#">
<?php
_e('Change Address', 'Avada');
?>
</a>
</li>
<li>
<a class="account" href="#">
//.........这里部分代码省略.........
示例7: endpoint_trail
/**
* Endpoints
*/
private function endpoint_trail()
{
// Is an endpoint showing?
if (is_wc_endpoint_url() && ($endpoint = WC()->query->get_current_endpoint()) && ($endpoint_title = WC()->query->get_endpoint_title($endpoint))) {
$this->add_crumb($endpoint_title);
}
}
示例8: load_scripts
public function load_scripts()
{
if (is_cart() || is_checkout() || is_wc_endpoint_url('edit-address')) {
$city_select_path = $this->get_plugin_url() . 'assets/js/city-select.js';
wp_enqueue_script('wc-city-select', $city_select_path, array('jquery', 'woocommerce'), self::VERSION, true);
$cities = json_encode($this->get_cities());
wp_localize_script('wc-city-select', 'wc_city_select_params', array('cities' => $cities, 'i18n_select_city_text' => esc_attr__('Select an option…', 'woocommerce')));
}
}
示例9:
<?php
}
// end of the loop.
?>
</div><!-- end #content large-12 -->
</div><!-- end row -->
</div><!-- end page-right-sidebar container -->
<?php
if (is_wc_endpoint_url('order-received')) {
?>
<!-- Thank you page scripts -->
<?php
if (isset($flatsome_opt['html_thank_you'])) {
echo do_shortcode($flatsome_opt['html_thank_you']);
}
?>
<?php
}
?>
<?php
get_footer();
示例10: load_scripts
/**
* Load JS & CSS FrontEnd
*
* @access public
* @return void
* @since 8.0.0
*/
public function load_scripts()
{
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
$assets_path = str_replace(array('http:', 'https:'), '', WC()->plugin_url()) . '/assets/';
// select2
$select2_js_path = $assets_path . 'js/select2/select2' . $suffix . '.js';
$select2_css_path = $assets_path . 'css/select2.css';
if (!wp_script_is('select2', 'registered')) {
wp_register_script('select2', $select2_js_path, array('jquery'), '3.5.2');
}
if (!wp_style_is('select2', 'registered')) {
wp_register_style('select2', $select2_css_path);
}
// chosen
$chosen_js_path = $assets_path . 'js/chosen/chosen.jquery' . $suffix . '.js';
$chosen_css_path = $assets_path . 'css/chosen.css';
if (!wp_script_is('chosen', 'registered')) {
wp_register_script('chosen', $chosen_js_path, array('jquery'), '1.0.0', true);
}
if (!wp_style_is('chosen', 'registered')) {
wp_enqueue_style('woocommerce_chosen_styles', $chosen_css_path);
}
wp_register_script('woocommerce-jne-shipping', $this->plugin_url() . '/assets/js/shipping' . $suffix . '.js', array('jquery'), '1.0.12', true);
wp_register_script('woocommerce-jne-cekongkir', $this->plugin_url() . '/assets/js/cekongkir' . $suffix . '.js', array('jquery'), '1.0.12', true);
wp_register_style('woocommerce-jne-cekongkir', $this->plugin_url() . '/assets/css/cekongkir.css');
wp_register_style('woocommerce-jne-tracking-widget', $this->plugin_url() . '/assets/css/tracking.widget.css');
// shipping
if ($this->shipping->is_enable()) {
if (is_checkout() || is_cart() || is_wc_endpoint_url('edit-address')) {
wp_enqueue_script('woocommerce-jne-shipping');
wp_localize_script('woocommerce-jne-shipping', 'agenwebsite_woocommerce_jne_params', $this->localize_script('shipping'));
}
}
// cek ongkir
if (is_product() && $this->shipping->cek_ongkir->tab_is_enable() || is_active_widget(false, false, 'jne_cekongkir_widget', true) || $this->is_active_shortcode('jne_cek_ongkir')) {
wp_enqueue_style('woocommerce-jne-cekongkir');
wp_enqueue_script('woocommerce-jne-cekongkir');
wp_localize_script('woocommerce-jne-cekongkir', 'agenwebsite_woocommerce_jne_cekongkir_params', $this->localize_script('cekongkir'));
}
// load selec2 or chosen
if ($this->shipping->is_enable() && is_cart() || is_product() && $this->shipping->cek_ongkir->tab_is_enable() || is_active_widget(false, false, 'jne_cekongkir_widget', true) || $this->is_active_shortcode('jne_cek_ongkir')) {
if (!wp_script_is('select2')) {
wp_enqueue_script('select2');
}
if (!wp_style_is('select2')) {
wp_enqueue_style('select2');
}
if (!wp_script_is('chosen')) {
wp_enqueue_script('chosen');
}
if (!wp_style_is('chosen')) {
wp_enqueue_style('chosen');
}
}
}
示例11: do_action
* @hooked storefront_display_comments - 10
*/
do_action('storefront_page_after');
?>
<?php
}
// end of the loop.
?>
</div>
<!-- Content column end -->
<!-- Sidebar column start -->
<?php
if (function_exists('is_cart') && is_cart() || function_exists('is_checkout') && is_checkout() || function_exists('is_wc_endpoint_url') && is_wc_endpoint_url('lost-password') || function_exists('is_account_page') && is_account_page()) {
?>
<?php
} else {
?>
<div class="col-sm-4 col-md-3 col-md-offset-1 sidebar">
<?php
do_action('shop_isle_sidebar');
?>
</div>
<?php
}
?>
示例12: is_wc_endpoint_url
public static function is_wc_endpoint_url($endpoint = false)
{
return self::exists() && is_wc_endpoint_url($endpoint);
}
示例13: load_scripts
/**
* Load JS & CSS FrontEnd
*
* @access public
* @return void
* @since 8.0.0
*/
public function load_scripts()
{
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
$assets_path = str_replace(array('http:', 'https:'), '', WC()->plugin_url()) . '/assets/';
// select2
$select2_js_path = $assets_path . 'js/select2/select2' . $suffix . '.js';
$select2_css_path = $assets_path . 'css/select2.css';
if (!wp_script_is('select2', 'registered')) {
wp_register_script('select2', $select2_js_path, array('jquery'), '3.5.2');
}
if (!wp_style_is('select2', 'registered')) {
wp_register_style('select2', $select2_css_path);
}
// chosen
$chosen_js_path = $assets_path . 'js/chosen/chosen.jquery' . $suffix . '.js';
$chosen_css_path = $assets_path . 'css/chosen.css';
if (!wp_script_is('chosen', 'registered')) {
wp_register_script('chosen', $chosen_js_path, array('jquery'), '1.0.0', true);
}
if (!wp_style_is('chosen', 'registered')) {
wp_enqueue_style('woocommerce_chosen_styles', $chosen_css_path);
}
wp_register_script('woocommerce-jne-shipping', $this->plugin_url() . '/assets/js/shipping' . $suffix . '.js', array('jquery'), '1.0.12', true);
// shipping
if ($this->shipping->is_enable()) {
if (is_checkout() || is_wc_endpoint_url('edit-address')) {
wp_enqueue_script('woocommerce-jne-shipping');
wp_localize_script('woocommerce-jne-shipping', 'agenwebsite_woocommerce_jne_params', $this->localize_script('shipping'));
}
}
}
示例14:
<?php
if (function_exists('is_woocommerce') && (is_account_page() || is_shop() || is_product_taxonomy() || is_product() || is_cart() || is_checkout() || is_checkout_pay_page() || is_order_received_page() || is_wc_endpoint_url('order-pay') || is_wc_endpoint_url('order-received') || is_wc_endpoint_url('view-order') || is_wc_endpoint_url('edit-account') || is_wc_endpoint_url('edit-address') || is_wc_endpoint_url('lost-password') || is_wc_endpoint_url('customer-logout') || is_wc_endpoint_url('add-payment-method'))) {
get_template_part('template/template-nowrap');
} else {
get_template_part('template/template-page-normal');
}
示例15: woocommerce_new_customer_change_title
/**
* Add new Title to Lost Password page for customers who have been created through Add Customer on Order
*/
public function woocommerce_new_customer_change_title($page_title)
{
global $woocommerce;
$is_lost_pass_page = false;
// Check if is lost pass page
if (function_exists('wc_get_endpoint_url')) {
// Above WC 2.1
if (is_wc_endpoint_url('lost-password')) {
$is_lost_pass_page = true;
}
} else {
if (is_page(woocommerce_get_page_id('lost_password'))) {
$is_lost_pass_page = true;
}
}
// Only do this is is lost pass page, and that we have a login to check against
if ($is_lost_pass_page && isset($_GET['login'])) {
$email_address = esc_attr($_GET['login']);
$user = get_user_by("login", $email_address);
$password_not_changed = get_user_meta($user->ID, "create_customer_on_order_password", true);
if ($password_not_changed) {
$page_title = __('Create your Password', 'create-customer-order');
}
}
return $page_title;
}