That's what it looks like to me. I would do something like this.
Is assigning user level-1 all that is required for s2members to then kick in and allow access to the member?
Or is there other data that also must be checked/saved?
**If that is all that is required, could you ask Jason or one of the devs to give me a quick action snippet that I can add to woocommerce which I can hook to 'order_status_completed' which will tie s2members together?
<?php
add_action('woocommerce_order_status_completed', 'woocommerce_paying_customer');
function woocommerce_paying_customer($order_id)
{
if(is_object($order = &new woocommerce_order($order_id)) && !empty($order->user_id))
{
update_user_meta($order->user_id, 'paying_customer', 1);
$user = new WP_User($order->user_id);
$user->set_role("s2member_level1");
/**/
/* Or, do this if the Role clashes. */
// $user->add_cap("access_s2member_level0");
// $user->add_cap("access_s2member_level1");
}
}
?>
Statistics: Posted by Jason Caldwell — December 30th, 2011, 4:41 pm
Statistics: Posted by Cristián Lávaque — December 27th, 2011, 4:12 am
add_action('woocommerce_order_status_completed', 'woocommerce_paying_customer');
function woocommerce_paying_customer( $order_id ) {
$order = &new woocommerce_order( $order_id );
if ( $order->user_id > 0 ) update_user_meta( $order->user_id, 'paying_customer', 1 );
}
Statistics: Posted by anointed — December 26th, 2011, 7:02 am
Statistics: Posted by Cristián Lávaque — December 26th, 2011, 5:56 am
Statistics: Posted by anointed — December 24th, 2011, 11:08 pm
Statistics: Posted by Harty — December 24th, 2011, 10:20 pm
Statistics: Posted by anointed — December 24th, 2011, 3:01 pm
Statistics: Posted by anointed — December 24th, 2011, 3:37 am