nAtic86
Forum Replies Created
-
right when you ask….
you find the solution by yourself :]
it should work somehow like this:
<?php add_action( 'woocommerce_order_status_completed', 'my_function' ); /* * Do something after WooCommerce sets an order on completed */ function my_function($order_id) { // order object (optional but handy) $order = new WC_Order( $order_id ); $user_id = 123; $user = new WP_User($user_id); $user->set_role("s2member_level1"); }
This also works for ccaps. Full documentation can be found here:
https://www.s2member.com/kb/roles-caps-via-php/does anyone has experience with that? would that work? ??
The main goal behind all this is that I want to show/hide content of a post/page with the s2member conditionals, while using the payment gateways of WooCommerce.
1.
i just red that expiring one-time-payments are not supported.
neither is it possible for the same customer to have multiple levels? this seems very odd.2.
for what i understood reading the forums, i could make it work like that. there are few workarounds that need to be done though.3.
i guess you could hook an action that updates a custom field in every post by the author when he cancels his subscription. your theme would have to check if this custom field has been voided or not.so all in all, i think, i will need to wait for another major release.
i need multiple levels per user and i need them to expire automaticaly.:((
keep up the good work, i hope you’ll add these functions soon.
Forum: Plugins
In reply to: [Frontend File Manager Plugin] bypassing file size limitationsso nobody knows?
that’s awkward