وردپرس
Membership product cannot be purchased. Please remove it from your cart.
https://wordpress.org/support/topic/golden-membership-cannot-be-purchased-please-remove-it-from-your-cart/
I found a piece of code which return true always irrespective of whether there is membership product in the cart. Thats why we are unable to purchase membership products.
pmpro-woocommerce addon->includes/functions.php line 48.
/**
* Search the cart for previously selected membership product
*
* @return bool
*/
function pmprowoo_cart_has_membership() {
global $pmprowoo_product_levels;
$has_membership = false;
$cart_items = is_object( WC()->cart ) ? WC()->cart->get_cart_contents() : array();
foreach ( $cart_items as $cart_item ) {
$has_membership = $has_membership || in_array( $cart_item['product_id'], array_keys( $pmprowoo_product_levels ) );
}
return $has_membership;
}
$has_membership = $has_membership always returns true. Please change this. Thank you
مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد
منبع: انجمن وردپرس