Find Jobs
Hire Freelancers

Tweak some functions.php code to change wordpress user roles after purchase

$10-30 USD

Zaprt
Objavljeno pred približno 8 leti

$10-30 USD

Plačilo ob dostavi
I need user roles to be change after they purchase a package level. For example, if they purchase a Silver Diamond Package, I need their user role to be changed to "Silver Diamond" I need the code below modified with my specific product info in. There will be 4 different levels that someone can be changed to when they purchase a product. I only wish to pay $10 since this is so simple. This is a good project for a person to use to increase their Freelancer cred. Here is the code we have so far: /** * Change Roles Upon Checkout * */ function lgbk_add_member( $order_id ) { $order = new WC_Order( $order_id ); $items = $order->get_items(); foreach ( $items as $item ) { $product_name = $item['name']; $product_id = $item['product_id']; $product_variation_id = $item['variation_id']; if ( $order->user_id > 0 && $product_id == '33' ) { update_user_meta( $order->user_id, 'paying_customer', 1 ); $user = new WP_User( $order->user_id ); // Remove role $user->remove_role( 'subscriber' ); // Add role $user->add_role( 'contributor' ); } } } add_action( 'woocommerce_order_status_completed', 'lgbk_add_member' );
ID projekta: 10413167

Več o projektu

13 ponudb
Projekt na daljavo
Aktivno pred 8 leti

Želite zaslužiti?

Prednosti oddajanja ponudb na Freelancerju

Nastavite svoj proračun in časovni okvir
Prejmite plačilo za svoje delo
Povzetek predloga
Registracija in oddajanje ponudb sta brezplačna
13 freelancerjev je oddalo ponudbo s povprečno vrednostjo $19 USD za to delo
Avatar uporabnika
Hello! With 98% to 99% completion rate, 900+ successfully completed projects, and a 4.99 reputation (maximum possible, 5.0) (can be verified on my profile page https://www.freelancer.com/u/rajeshsonisl.html !!)... you can never go wrong choosing me :) I am available to get started on your project right away. I look forward to your reply. Thanks. Kind Regards, Rajesh Soni
$29 USD v 1 dnevu
5,0 (733 ocen)
8,0
8,0
Avatar uporabnika
Hello. Wordpress dev expert ready to help you with role code development. I have more 200 good reviews in dev projects, so all will be done on highest level. Price can be discussed. Please, do not award project until we will clear details.
$35 USD v 1 dnevu
4,9 (377 ocen)
7,6
7,6
Avatar uporabnika
Hi there - My name is Jhalak. I’ve read your brief and can see that you’d like to build an Website. My team has 4 years experience designing and developing mobile apps and Websites. I would approach your project by starting with wireframes and getting the site completed, before starting the actual development phase. I am highly qualified for this project and would love to speak with you further about taking this project on. If you'd like to view my previous work, take a look at my Freelancer Portfolio. Regards, Jhalak Thanks, Diamond looking forward for your reply.
$15 USD v 5 dneh
4,8 (52 ocen)
5,0
5,0
Avatar uporabnika
Hi, I've over-viewed the details of the project provided by you and I am please to declare myself the right candidate for this project as I've completed many successful projects of such kind (urls will be provided on request). If you are looking for quality results in reasonable time and rate then lets discuss the further details for successful completion of project. We deliver on time and on budget. I can start on it right now. I can start on it right now.
$13 USD v 1 dnevu
5,0 (18 ocen)
4,1
4,1
Avatar uporabnika
----------Hello Sir,I can do that your full project .Ready to start Now and completed ASAP "----------- Thanks Reply
$10 USD v 2 dneh
4,3 (7 ocen)
3,0
3,0
Avatar uporabnika
A proposal has not yet been provided
$15 USD v 1 dnevu
5,0 (1 ocena)
1,6
1,6
Avatar uporabnika
Can work in theme functions file or use action hooks for this. 2 years experience in WordPress
$15 USD v 1 dnevu
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
Hi I am highly interested to do this project. I will make you happy.I don’t need any upfront or milestone payment. Pay me when you will happy. Looking forward. Thanks
$25 USD v 1 dnevu
0,0 (0 ocen)
0,0
0,0

O stranki

Zastava UNITED STATES
Sheridan, United States
4,9
59
Plačilna metoda je verificirana
Član(ica) od apr. 26, 2016

Verifikacija stranke

Hvala! Po e-pošti smo vam poslali povezavo za prevzem brezplačnega dobropisa.
Pri pošiljanju vašega e-sporočila je šlo nekaj narobe. Poskusite znova.
Registrirani uporabniki Skupaj objavljenih del
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Nalaganje predogleda
Geolociranje je bilo dovoljeno.
Vaša prijavna seja je potekla, zato ste bili odjavljeni. Prosimo, da se znova prijavite.