发表时间:2022-05-18 02:16:33

只不过作为一个企业来说,怎么把这些东西复制出来,让更多人知道。  当然,人幸福感不足的原因,还在于拥有越多,越怕失去,经济条件好了,最怕的是未来会失去,赚的钱越多担的责任越重大,再加上近些年经济形势不好,生意不好做,心理压力大,身体疲劳,健康堪忧,更是让人想幸福都幸福不起来。  父亲是当地小学的校长,一辈子勤勤恳恳。于是,王功权决定给企业写纸条“发挥自己宏观判断的优势”。

The first step on our process here is to create and install a child theme. If you are using one of our themes you can easily grab its child theme from our downloads section. If not, you can read our beginner’s guide on child themes to create your own. This step is essential in order to preserve our changes throughout theme updates.

All code below will be placed in our child theme’s functions.php file. If the file is empty the code will go just below the opening <?php tag, otherwise, if it has contents, the code should be placed at the end of the file, before the closing ?> PHP tag if it exists.

To add our check for pending payments we will use the woocommerce_checkout_process hook and use it to look for pending payment orders on the customer’s history.

add_action( 'woocommerce_checkout_process', 'cssigniter_prevent_checkout_if_pending_payments' );
function cssigniter_prevent_checkout_if_pending_payments() {
	$customer = wp_get_current_user();

	if ( ! empty( $customer ) ) {
		$args = array(
			'customer_id' => $customer->ID,
			'status'      => array( 'wc-pending' ),

		$pending_orders = wc_get_orders( $args );

		if ( count( $pending_orders ) > 0 ) {
			$payment_links = array();

			foreach ( $pending_orders as $pending_order ) {
				array_push( $payment_links, '<a href="' . $pending_order->get_checkout_payment_url() . '" target="_blank">#' . $pending_order->get_order_number() . '</a>' );

			$payment_links = implode( ', ', $payment_links );
			$message       = sprintf(
				// Translators: 1$%s is the my account page URL, 2$%s are the individual pending order payment links.
				__( 'Please take care of any outstanding payments from your <a href="%1$s" target="_blank">account page</a>, or the following links %2$s, before proceeding with new orders. Thank you.', 'your-text-domain' ),
				wc_get_page_permalink( 'myaccount' ),

			wc_add_notice( $message, 'error' );

Let’s break things down a bit. We start by getting the current user to find out which customer is making the order. If the current user exists, i.e. it is a returning customer we get all their pending orders using wc_get_orders and if we find any we create a WooCommerce notice which informs the customer that they have pending payments under their user account, the notice prompts the customer to take care of these pending payments and provides them with links to both their my account page and to each order’s payment URL directly. This way they can sort the payments out and be able to place new ones on the store.


document.writeln('关注创业、电商、站长,扫描A5创业网微信二维码,定期抽大奖。人们纷纷预测微软+诺基亚的战略,能够在iOS和Android之外开辟出手机市场的第三块版图,重现诺记当年荣光。  现在回过头看,他觉得第一次创业的5个合伙人才是最靠谱的。


张智成 Required fields are marked 安康