我希望客户只要购物时返回商店页面就可以从购物中购买一种产品,他们将被重定向到我的帐户页面。如何限制客户使用woocommerce购买一种产品
<?php
/**
* Loop Add to Cart
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.0
*/
if (! defined('ABSPATH')) exit; // Exit if accessed directly
global $product;
$current_user = wp_get_current_user();
if (wc_customer_bought_product($current_user->user_email, $current_user->ID, $product->id)) {
$redirect = $myaccount;
}
我使用下面的代码放置在循环文件夹中,但它不工作。
我想,用户可以在一生 说明一旦购买的产品 - 它不是在同一时间 它就像如果有人购买了该产品,那么他/她永远能购买任何其他产品购买一个产品。
选中此[插件](https://wordpress.org/plugins/woocommerce-max-quantity/) – Gunaseelan