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

PHP wc_clear_notices函数代码示例

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

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



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

示例1: wpuw_redirect_to_checkout

function wpuw_redirect_to_checkout()
{
    if (isset($_POST['wpuw_add_product'])) {
        $product_id = (int) apply_filters('woocommerce_add_to_cart_product_id', $_POST['add-to-cart']);
        if (has_term('credit', 'product_cat', $product_id)) {
            global $woocommerce;
            wc_clear_notices();
            return $woocommerce->cart->get_checkout_url();
        }
    }
}
开发者ID:justingreerbbi,项目名称:user-waller-credit-system,代码行数:11,代码来源:filters.php


示例2: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $meta['el_class'];
     global $woocommerce, $product;
     if (!is_object($woocommerce) || !is_object($woocommerce->query) || empty($product)) {
         return;
     }
     // $product = wc_get_product();
     $output .= "<div class='av-woo-purchase-button " . $meta['el_class'] . "'>";
     ob_start();
     wc_clear_notices();
     woocommerce_template_single_add_to_cart();
     $output .= ob_get_clean();
     $output .= "</div>";
     return $output;
 }
开发者ID:erikdukker,项目名称:medisom,代码行数:25,代码来源:product_snippet_button.php


示例3: maybe_apply_subscriber_discount

 public function maybe_apply_subscriber_discount()
 {
     $user_id = get_current_user_id();
     if ($user_id) {
         $discount_coupon_code = MP_Integration::$discount_coupon_code;
         if (!empty($discount_coupon_code)) {
             $sub_id = get_user_meta($user_id, 'mp_subscription_id', true);
             if ($sub_id) {
                 if (!WC()->cart->has_discount($discount_coupon_code)) {
                     WC()->cart->add_discount($discount_coupon_code);
                 }
                 wc_clear_notices();
             } else {
                 WC()->cart->remove_coupon($discount_coupon_code);
             }
         }
     }
 }
开发者ID:hwillson,项目名称:woocommerce-moreplease,代码行数:18,代码来源:class-mp-discount.php


示例4: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $meta['el_class'];
     global $woocommerce, $product;
     if (!is_object($woocommerce) || !is_object($woocommerce->query) || empty($product)) {
         return;
     }
     $temp = $product->post->post_content;
     $product->post->post_content = "";
     // $product = wc_get_product();
     $output .= "<div class='av-woo-product-review av-woo-product-tabs product " . $meta['el_class'] . "'>";
     ob_start();
     wc_clear_notices();
     woocommerce_output_product_data_tabs();
     // comments_template('reviews');
     $output .= ob_get_clean();
     $output .= "</div>";
     $product->post->post_content = $temp;
     return $output;
 }
开发者ID:erikdukker,项目名称:medisom,代码行数:29,代码来源:product_snippet_tabs.php


示例5: wc_print_notices

/**
 * Prints messages and errors which are stored in the session, then clears them.
 *
 * @since 2.1
 */
function wc_print_notices()
{
    $all_notices = WC()->session->get('wc_notices', array());
    $notice_types = apply_filters('woocommerce_notice_types', array('error', 'success', 'notice'));
    foreach ($notice_types as $notice_type) {
        if (wc_notice_count($notice_type) > 0) {
            wc_get_template("notices/{$notice_type}.php", array('messages' => $all_notices[$notice_type]));
        }
    }
    wc_clear_notices();
}
开发者ID:chhavinav,项目名称:fr.ilovejuice,代码行数:16,代码来源:wc-notice-functions.php


示例6: cart_view

 public function cart_view()
 {
     if ($this->isSilenced()) {
         $this->getApplicationContext()->getComponent('\\FS\\Components\\Options')->log($this->notifications);
     } else {
         \wc_clear_notices();
         foreach ($this->notifications as $type => $notifications) {
             if (!$notifications) {
                 continue;
             }
             $html = implode('<br/>', $notifications);
             \wc_add_notice($html, $type);
         }
     }
     if ($this->prev) {
         return $this->restore();
     }
     $this->scope();
     return $this->cleanup();
 }
开发者ID:flagshipcompany,项目名称:flagship-for-woocommerce,代码行数:20,代码来源:Notifier.php


示例7: paypal_express_checkout


//.........这里部分代码省略.........
                 $this->add_log(__('Error Severity Code: ', 'paypal-for-woocommerce') . $ErrorSeverityCode);
                 // Notice admin if has any issue from PayPal
                 $message = '';
                 if ($this->error_email_notify) {
                     $admin_email = get_option("admin_email");
                     $message .= __("SetExpressCheckout API call failed.", "paypal-for-woocommerce") . "\n\n";
                     $message .= __('Error Code: ', 'paypal-for-woocommerce') . $ErrorCode . "\n";
                     $message .= __('Error Severity Code: ', 'paypal-for-woocommerce') . $ErrorSeverityCode . "\n";
                     $message .= __('Short Error Message: ', 'paypal-for-woocommerce') . $ErrorShortMsg . "\n";
                     $message .= __('Detailed Error Message: ', 'paypal-for-woocommerce') . $ErrorLongMsg . "\n";
                     $error_email_notify_mes = apply_filters('angelleye_ec_error_email_notify_message', $message, $ErrorCode, $ErrorSeverityCode, $ErrorShortMsg, $ErrorLongMsg);
                     $subject = "PayPal Express Checkout Error Notification";
                     $error_email_notify_subject = apply_filters('angelleye_ec_error_email_notify_subject', $subject);
                     wp_mail($admin_email, $error_email_notify_subject, $error_email_notify_mes);
                 }
                 // Generate error message based on Error Display Type setting
                 if ($this->error_display_type == 'detailed') {
                     $sec_error_notice = $ErrorCode . ' - ' . $ErrorLongMsg;
                     $error_display_type_message = sprintf(__($sec_error_notice, 'paypal-for-woocommerce'));
                 } else {
                     $error_display_type_message = sprintf(__('There was a problem paying with PayPal.  Please try another method.', 'paypal-for-woocommerce'));
                 }
                 $error_display_type_message = apply_filters('angelleye_ec_display_type_message', $error_display_type_message, $ErrorCode, $ErrorLongMsg);
                 wc_add_notice($error_display_type_message, 'error');
                 if (!is_ajax()) {
                     wp_redirect(get_permalink(wc_get_page_id('cart')));
                     exit;
                 } else {
                     return;
                 }
             }
         }
     } elseif (isset($_GET['pp_action']) && $_GET['pp_action'] == 'revieworder') {
         wc_clear_notices();
         // The customer has logged into PayPal and approved order.
         // Retrieve the shipping details and present the order for completion.
         if (!defined('WOOCOMMERCE_CHECKOUT')) {
             define('WOOCOMMERCE_CHECKOUT', true);
         }
         $this->add_log('Start Review Order');
         if (isset($_GET['token'])) {
             $token = $_GET['token'];
             $this->set_session('TOKEN', $token);
         }
         if (isset($_GET['PayerID'])) {
             $payerID = $_GET['PayerID'];
             $this->set_session('PayerID', $payerID);
         }
         $this->add_log("...Token:" . $this->get_session('TOKEN'));
         $this->add_log("...PayerID: " . $this->get_session('PayerID'));
         $result = $this->CallGetShippingDetails($this->get_session('TOKEN'));
         if (!empty($result)) {
             $this->set_session('RESULT', serialize($result));
             if (isset($result['SHIPTOCOUNTRYCODE'])) {
                 /**
                  * Check if shiptocountry is in the allowed countries list
                  */
                 if (!array_key_exists($result['SHIPTOCOUNTRYCODE'], WC()->countries->get_allowed_countries())) {
                     wc_add_notice(sprintf(__('We do not sell in your country, please try again with another address.', 'paypal-for-woocommerce')), 'error');
                     wp_redirect(get_permalink(wc_get_page_id('cart')));
                     exit;
                 }
                 WC()->customer->set_shipping_country($result['SHIPTOCOUNTRYCODE']);
             }
             if (isset($result['SHIPTONAME'])) {
                 WC()->customer->shiptoname = $result['SHIPTONAME'];
开发者ID:ujam-dev,项目名称:paypal-woocommerce,代码行数:67,代码来源:wc-gateway-paypal-express-angelleye.php


示例8: save_pending

 /**
  *
  *
  * @param unknown $user_id
  */
 public function save_pending($user_id)
 {
     if (isset($_POST['apply_for_vendor'])) {
         wc_clear_notices();
         if (user_can($user_id, 'manage_options')) {
             wc_add_notice(apply_filters('wcvendors_application_denied_msg', __('Application denied. You are an administrator.', 'wcvendors')), 'error');
         } else {
             wc_add_notice(apply_filters('wcvendors_application_submitted_msg', __('Your application has been submitted.', 'wcvendors')), 'notice');
             $manual = WC_Vendors::$pv_options->get_option('manual_vendor_registration');
             $role = apply_filters('wcvendors_pending_role', $manual ? 'pending_vendor' : 'vendor');
             $wp_user_object = new WP_User($user_id);
             $wp_user_object->set_role($role);
             do_action('wcvendors_application_submited', $user_id);
             add_filter('woocommerce_registration_redirect', array($this, 'redirect_to_vendor_dash'));
         }
     }
 }
开发者ID:stodorovic,项目名称:wcvendors,代码行数:22,代码来源:class-vendor-signup.php


示例9: apply_membership_benifits

function apply_membership_benifits()
{
    global $woocommerce;
    $level = get_user_info('loyalty_status');
    $total = floatval(preg_replace('#[^\\d.]#', '', $woocommerce->cart->get_cart_total()));
    if ($level == 'Green' || $woocommerce->cart->has_discount($level)) {
        return;
    } elseif ($total < 3660) {
        /* echo'<div class="woocommerce-error">The minimum spend for membership discounts is $60.00.</div>'; */
    } else {
        $woocommerce->cart->add_discount($level);
        echo '<div class="woocommerce-message">Membership discount applied successfully.</div>';
        wc_clear_notices();
    }
}
开发者ID:keyshames,项目名称:tcm2016,代码行数:15,代码来源:functions.php


示例10: redirect_to_checkout

function redirect_to_checkout()
{
    wc_clear_notices();
    return WC()->cart->get_checkout_url();
}
开发者ID:pcuervo,项目名称:wp-yolcan,代码行数:5,代码来源:functions.php


示例11: process_payment

 /**
  * Process payment
  * @param $order_id
  * @param $data
  */
 public function process_payment($order_id, $data)
 {
     if (!isset($data['payment_details'])) {
         return;
     }
     // some gateways check if a user is signed in, so let's switch to customer
     $logged_in_user = get_current_user_id();
     $customer_id = isset($data['customer_id']) ? $data['customer_id'] : 0;
     wp_set_current_user($customer_id);
     // load the gateways & process payment
     $gateway_id = $data['payment_details']['method_id'];
     add_filter('option_woocommerce_' . $gateway_id . '_settings', array($this, 'force_enable_gateway'));
     $settings = WC_POS_Admin_Settings_Checkout::get_instance();
     $gateways = $settings->load_enabled_gateways();
     $response = $gateways[$gateway_id]->process_payment($order_id);
     if (isset($response['result']) && $response['result'] == 'success') {
         $this->payment_success($gateway_id, $order_id, $response);
     } else {
         $this->payment_failure($gateway_id, $order_id, $response);
     }
     // switch back to logged in user
     wp_set_current_user($logged_in_user);
     // clear any payment gateway messages
     wc_clear_notices();
 }
开发者ID:rpidanny,项目名称:WooCommerce-POS,代码行数:30,代码来源:class-wc-pos-orders.php


示例12: Frontpage

<?php

include_once 'front_template.php';
$obj = new Frontpage();
$obj->checkLogin();
wc_clear_notices();
if (isset($_GET['key']) && $_GET['key'] != '') {
    $_SESSION['checkout'] = 'Done';
    if (get_option('_skip_ga_ecommerce') == 1) {
        $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
        $template_name = strpos($url, '/order-received/') === false ? '/view-order/' : '/order-received/';
        if (strpos($url, $template_name) !== false) {
            $start = strpos($url, $template_name);
            $first_part = substr($url, $start + strlen($template_name));
            $order_id = substr($first_part, 0, strpos($first_part, '/'));
            //yes, I can retrieve the order via the order id
            $order = new WC_Order($order_id);
            $items_details = $order->get_items();
            $items = array();
            $i = 0;
            foreach ($items_details as $item) {
                //print_r($item);
                $product = $order->get_product_from_item($item);
                $product_id = $item['product_id'];
                $term_list = wp_get_post_terms($product_id, 'product_cat', array('fields' => 'ids'));
                $cat_id = (int) $term_list[0];
                $category = get_term($cat_id, 'product_cat');
                $items[$i]['name'] = $item['name'];
                $items[$i]['quantity'] = $item['qty'];
                $items[$i]['sku'] = $product->get_sku();
                $items[$i]['price'] = $product->get_price();
开发者ID:WP-Panda,项目名称:allergenics,代码行数:31,代码来源:step4.php


示例13: apply_form

 /**
  *
  *
  * @return unknown
  */
 public function apply_form()
 {
     global $woocommerce;
     if (!isset($_POST['apply_for_vendor'])) {
         return false;
     }
     if ($this->terms_page && !isset($_POST['agree_to_terms'])) {
         wc_clear_notices();
         wc_add_notice(__('You must accept the terms and conditions to become a vendor.', 'wcvendors'), 'error');
     } else {
         if (isset($_POST['apply_for_vendor_submit'])) {
             self::save_pending(get_current_user_id());
         }
     }
 }
开发者ID:soydiegomen,项目名称:plazajilo,代码行数:20,代码来源:class-vendor-signup.php


示例14: add_to_cart_redirect

 /**
  * For a smoother sign up process, tell WooCommerce to redirect the shopper immediately to
  * the checkout page after she clicks the "Sign Up Now" button
  *
  * Only enabled if multiple checkout is not enabled.
  *
  * @param string $url The cart redirect $url WooCommerce determined.
  * @since 1.0
  */
 public static function add_to_cart_redirect($url)
 {
     // If product is of the subscription type
     if (is_numeric($_REQUEST['add-to-cart']) && WC_Subscriptions_Product::is_subscription((int) $_REQUEST['add-to-cart']) && 'yes' != get_option(WC_Subscriptions_Admin::$option_prefix . '_multiple_purchase', 'no')) {
         wc_clear_notices();
         // Redirect to checkout
         $url = WC()->cart->get_checkout_url();
     }
     return $url;
 }
开发者ID:keshvenderg,项目名称:cloudshop,代码行数:19,代码来源:woocommerce-subscriptions.php


示例15: add_to_cart_redirect

 /**
  * For a smoother sign up process, tell WooCommerce to redirect the shopper immediately to
  * the checkout page after she clicks the "Sign Up Now" button
  *
  * Only enabled if multiple checkout is not enabled.
  *
  * @param string $url The cart redirect $url WooCommerce determined.
  * @since 1.0
  */
 public static function add_to_cart_redirect($url)
 {
     // If product is of the subscription type
     if (isset($_REQUEST['add-to-cart']) && is_numeric($_REQUEST['add-to-cart']) && WC_Subscriptions_Product::is_subscription((int) $_REQUEST['add-to-cart'])) {
         // Redirect to checkout if mixed checkout is disabled
         if ('yes' != get_option(WC_Subscriptions_Admin::$option_prefix . '_multiple_purchase', 'no')) {
             wc_clear_notices();
             $url = WC()->cart->get_checkout_url();
             // Redirect to the same page (if the customer wouldn't be redirected to the cart) to ensure the cart widget loads correctly
         } elseif ('yes' != get_option('woocommerce_cart_redirect_after_add')) {
             $url = remove_query_arg('add-to-cart');
         }
     }
     return $url;
 }
开发者ID:slavic18,项目名称:cats,代码行数:24,代码来源:woocommerce-subscriptions.php


示例16: get_notices

function get_notices()
{
    if (!did_action('woocommerce_init')) {
        _doing_it_wrong(__FUNCTION__, __('This function should not be called before woocommerce_init.', 'woocommerce'), '2.3');
        return;
    }
    $all_notices = WC()->session->get('wc_notices', array());
    $notice_types = apply_filters('woocommerce_notice_types', array('error', 'success', 'notice'));
    $notice_arr = array();
    foreach ($notice_types as $notice_type) {
        if (wc_notice_count($notice_type) > 0) {
            $notice_arr[$notice_type] = $all_notices[$notice_type];
        }
    }
    wc_clear_notices();
    return json_encode($notice_arr);
}
开发者ID:javolero,项目名称:dabba,代码行数:17,代码来源:functions.php


示例17: action_on_accept_offer


//.........这里部分代码省略.........
                             $cart_contains = array_unique(array_merge($cart_contains, $cart[$cart_key]['smart_offers']['cart_contains_ids']));
                         }
                         if (isset($cart[$cart_key]['smart_offers']['parent_offer_id']) && !empty($cart[$cart_key]['smart_offers']['parent_offer_id'])) {
                             if (is_array($cart[$cart_key]['smart_offers']['parent_offer_id'])) {
                                 $parent_offer_id = array_unique(array_merge($parent_offer_ids, $cart[$cart_key]['smart_offers']['parent_offer_id']));
                             } else {
                                 array_push($parent_offer_ids, $cart[$cart_key]['smart_offers']['parent_offer_id']);
                             }
                         }
                     }
                     unset($sa_smart_offers->global_wc()->cart->cart_contents[$cart_key]);
                 }
                 if (is_array($parent_offer_ids) && count($parent_offer_ids) > 0) {
                     $parent_offer_id = $parent_offer_ids;
                 }
             }
             if (!empty($cart_contains) && is_array($cart_contains) && !empty($cart_contains_item_key)) {
                 $args['smart_offers'] = array('accept_offer' => true, 'offer_id' => $post_id, 'accepted_from' => $page, 'cart_contains_keys' => $cart_contains_item_key, 'cart_contains_ids' => $cart_contains);
             } else {
                 $args['smart_offers'] = array('accept_offer' => true, 'offer_id' => $post_id, 'accepted_from' => $page);
             }
         } else {
             $args['smart_offers'] = array('accept_offer' => true, 'offer_id' => $post_id, 'accepted_from' => $page);
         }
         if (is_array($parent_offer_id) && count($parent_offer_id) > 0) {
             $args['smart_offers']['parent_offer_id'] = $parent_offer_id;
         } elseif (!is_array($parent_offer_id) && $parent_offer_id != '') {
             $args['smart_offers']['parent_offer_id'] = $parent_offer_id;
         }
         if (!empty($action_on_accept['add_to_cart']) && $action_on_accept['add_to_cart'] == 'yes') {
             $sa_smart_offers->global_wc()->cart->add_to_cart($parent_id, $quantity, $variation_id, $variation, $args);
         }
         $action_on_accept = get_post_meta($post_id, 'so_actions_on_accept', true);
         if (isset($action_on_accept['sa_apply_coupon']) && !empty($action_on_accept['sa_apply_coupon'])) {
             $coupons = explode(",", $action_on_accept['sa_apply_coupon']);
             if (is_array($coupons) && count($coupons) > 0) {
                 foreach ($coupons as $coupon_title) {
                     $sa_smart_offers->global_wc()->cart->add_discount($coupon_title);
                 }
             }
         }
         if (isset($action_on_accept['sa_redirect_to_url']) && !empty($action_on_accept['sa_redirect_to_url'])) {
             $url = $action_on_accept['sa_redirect_to_url'];
         } elseif (isset($action_on_accept['accepted_offer_ids']) && !empty($action_on_accept['accepted_offer_ids'])) {
             $redirecting_option = explode(",", $action_on_accept['accepted_offer_ids']);
             if (is_array($redirecting_option) && count($redirecting_option) > 0) {
                 foreach ($redirecting_option as $id) {
                     $redirect_to = $id;
                 }
             }
             ob_start();
             if ($redirect_to != "") {
                 $this->force_show_smart_offers($redirect_to);
             }
         } elseif (isset($action_on_accept['buy_now']) && $action_on_accept['buy_now'] == true && class_exists('WC_Buy_Now')) {
             $buy_now = new WC_Buy_Now();
             $buy_now->checkout_redirect();
         } else {
             if ($page == "cart_page") {
                 $url = $sa_smart_offers->global_wc()->cart->get_cart_url();
             } elseif (!empty($source)) {
                 if ($page == "checkout_page" && $source == 'so_post_checkout') {
                     $form_values = SO_Session_Handler::check_session_set_or_not('so_checkout_form_data');
                     if ($form_values) {
                         $sa_so_form_checkout = SO_Session_Handler::so_get_session_value('so_checkout_form_data');
                     } else {
                         $sa_so_form_checkout = null;
                     }
                     if (!empty($sa_so_form_checkout)) {
                         $_POST = $sa_so_form_checkout;
                     }
                     if (wc_get_page_id('terms') > 0) {
                         $_POST['terms'] = 'yes';
                     }
                     if ($sa_smart_offers->is_wc_gte_21()) {
                         wc_clear_notices();
                     } else {
                         $sa_smart_offers->global_wc()->clear_messages();
                     }
                     $woocommerce_checkout = $sa_smart_offers->global_wc()->checkout();
                     $woocommerce_checkout->process_checkout();
                 } else {
                     if ($page == "checkout_page" && $source == 'so_pre_checkout') {
                         $url = $sa_smart_offers->global_wc()->cart->get_checkout_url();
                     }
                 }
             } else {
                 $url = $sa_smart_offers->global_wc()->cart->get_checkout_url();
             }
         }
         if (empty($url)) {
             $url = wp_get_referer() ? wp_get_referer() : $sa_smart_offers->global_wc()->cart->get_cart_url();
         }
         if (filter_var($url, FILTER_VALIDATE_URL) !== FALSE) {
             ob_clean();
             wp_redirect($url);
             exit;
         }
     }
 }
开发者ID:WP-Panda,项目名称:allergenics,代码行数:101,代码来源:class-so-offer.php


示例18: test_cart_fee

 /**
  * Test cart fee
  *
  * @since 2.3
  */
 public function test_cart_fee()
 {
     // Create product
     $product = \WC_Helper_Product::create_simple_product();
     update_post_meta($product->id, '_price', '10');
     update_post_meta($product->id, '_regular_price', '10');
     // We need this to have the calculate_totals() method calculate totals
     if (!defined('WOOCOMMERCE_CHECKOUT')) {
         define('WOOCOMMERCE_CHECKOUT', true);
     }
     // Add fee
     \WC_Helper_Fee::add_cart_fee();
     // Add product to cart
     WC()->cart->add_to_cart($product->id, 1);
     // Test if the cart total amount is equal 20
     $this->assertEquals(20, WC()->cart->total);
     // Clearing WC notices
     wc_clear_notices();
     // Clean up the cart
     WC()->cart->empty_cart();
     // Remove fee
     \WC_Helper_Fee::remove_cart_fee();
     // Delete product
     \WC_Helper_Product::delete_product($product->id);
 }
开发者ID:noahjohn9259,项目名称:woocommerce,代码行数:30,代码来源:cart.php


示例19: add_to_cart_redirect

 /**
  * Redirect to PayPal from the product page EC button
  * @param $url
  * @return string
  */
 function add_to_cart_redirect($url)
 {
     if (isset($_REQUEST['express_checkout']) || isset($_REQUEST['express_checkout_x'])) {
         wc_clear_notices();
         $url = esc_url_raw(add_query_arg('pp_action', 'expresscheckout', add_query_arg('wc-api', 'WC_Gateway_PayPal_Express_AngellEYE', home_url('/'))));
     }
     return $url;
 }
开发者ID:610152753,项目名称:paypal-woocommerce,代码行数:13,代码来源:paypal-for-woocommerce.php


示例20: filterProduct

 /**
  * Filters cart product
  *
  * @access public
  * @param int $ID
  * @param array $data
  * @return bool
  */
 public static function filterProduct($ID, $data)
 {
     wc_clear_notices();
     $product = $data['product_id'];
     if (!empty($data['variation_id'])) {
         $product = $data['variation_id'];
     }
     $object = wc_get_product($product);
     $cart = self::getCart();
     $quantity = 0;
     foreach ($cart as $products) {
         foreach ($products as $key => $product) {
             if ($key == $ID) {
                 $quantity = $product['quantity'];
                 break;
             }
         }
     }
     if ($object->is_sold_individually() && $quantity > 0) {
         return false;
     }
     if ($object->managing_stock() && !$object->has_enough_stock($quantity + $data['quantity'])) {
         return false;
     }
     return true;
 }
开发者ID:qhuit,项目名称:UrbanPekor,代码行数:34,代码来源:themex.woo.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP wc_coupons_enabled函数代码示例发布时间:2022-05-23
下一篇:
PHP wc_clean函数代码示例发布时间: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