add_action('woocommerce_order_status_completed', 'wpa_120656_convert_paying_customer' );
function wpa_120656_convert_paying_customer( $order_id ) {
$order = new WC_Order( $order_id );
$user_id = $order->user_id;
$customer_orders = get_posts(array(
'numberposts' => -1,
'meta_key' => '_customer_user',
'meta_value' => $user_id,
'post_type' => 'shop_order',
) );
if ( $customer_orders > 1 ) {
update_user_meta( $order->user_id, 'paying_customer', 1 );
$user = new WP_User( $order->user_id );
// Remove role
$user->remove_role( 'customer' );
// Add role
$user->add_role( 'dovclient' );
}
}
All muhaza's note in developing website. Front-end & uiux method. Real life implementation for webdesigner.
Tuesday, 4 August 2020
Change user role if it's orders count more than
Auto select after redirect to the contact page SELECT JAVASCRIPT
https://domain.my/contact/?startup_package=UltimateImpact <select name="startup_package" class="form-select"...
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 < div style = "background-color:#D94A38;width:170px;height:80px;ma...
-
/* for Big PC & Display */ @media only screen and ( min-width : 1900px ) { .tps-section { height : 1080px ; ...