Find Jobs
Hire Freelancers

woocommerce change role based on items qty bought in last 12 months

$10-30 USD

Opravljeno
Objavljeno pred približno 5 leti

$10-30 USD

Plačilo ob dostavi
hello there, I need coding that changes a user role in wordpress/woocommerce based on the quantity of a product a user buys within a year period....I have the code already based on the purchase of a specific product but I need it adapted to check the total quantity of a a users purchases in a year and if the purchase quantity goes over a specific amount of items in a year then the user role must change automatically function change_role_on_purchase( $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 == '416' ) { 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( 'premium' ); } } } add_action( 'woocommerce_order_status_processing', 'change_role_on_purchase' );
ID projekta: 18925038

Več o projektu

4 ponudb
Projekt na daljavo
Aktivno pred 5 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
Dodeljeno:
Avatar uporabnika
Hello I will make the user's role changed based on the item quantity they have purchased in the last year. Let me know more details in chat. Thanks!
$25 USD v 1 dnevu
4,9 (286 ocen)
7,9
7,9
4 freelancerjev je oddalo ponudbo s povprečno vrednostjo $38 USD za to delo
Avatar uporabnika
Hi there, Quick and easy. Do you need to just match the Product quantity from ALL ordered products within the year? OR do you want to include / exclude certain products / variations? I'll need WP admin and cPanel access if you decide to hire me. I have a 99% project completion rate and a 4.99 reputation (out of max 5.0!) from more than 1150 projects from a period of 12 years. Thanks. I look forward to hearing from you! Best Regards, Rajesh Soni.
$66 USD v 1 dnevu
5,0 (1011 ocen)
8,7
8,7
Avatar uporabnika
Hello, I think I understand it. We will retrieve orders for last 1 year and count products in order. If it's more than xx, user role will be changed.
$30 USD v 1 dnevu
5,0 (974 ocen)
8,3
8,3
Avatar uporabnika
Sir, I can give this work with 100% satisfaction within a time limit, and also I have great hands-on HTML, CSS, JS, jQuery, PHP, Laravel, MySQL. Very familiar with WordPress, Magneto, woo-commerce, Bootstrap, Plugins, API's and its customization. Feel free to ask any question if you have, we promise to deliver quality work to our clients, Thank you.
$30 USD v 2 dneh
4,8 (203 ocen)
7,0
7,0

O stranki

Zastava SOUTH AFRICA
Paarl, South Africa
5,0
3
Plačilna metoda je verificirana
Član(ica) od jan. 19, 2018

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.