Завершено

Upgrade Woocommerce Function

I need to check if user bought specific product type, and if cost of this product was greater then 0 $ (if it was not free)

Needed product type:

job_package OR promotion_package

For now I have function to check if user bought anything, i would like something similar with mentionet upgrade.

function has_bought( $user_id = 0 ) {

global $wpdb;

$customer_id = $user_id == 0 ? get_current_user_id() : $user_id;

$paid_order_statuses = array_map( 'esc_sql', wc_get_is_paid_statuses() );

$results = $wpdb->get_col( "

SELECT [login to view URL] FROM {$wpdb->prefix}posts AS p

INNER JOIN {$wpdb->prefix}postmeta AS pm ON [login to view URL] = pm.post_id

WHERE p.post_status IN ( 'wc-" . implode( "','wc-", $paid_order_statuses ) . "' )

AND p.post_type LIKE 'shop_order'

AND pm.meta_key = '_customer_user'

AND pm.meta_value = $customer_id

" );

// Count number of orders and return a boolean value depending if higher than 0

return count( $results ) > 0 ? true : false;

}

Квалификация: PHP, MySQL, WordPress, Архитектура ПО, SQL

Показать больше function count number posted data php, list number orders status oscommerce, woocommerce database stock status, woocommerce code, woocommerce classes, woocommerce internal api, woocommerce product functions, woocommerce functions documentation, woocommerce hooks, woocommerce email functions, woocommerce price hook, hello all i need is 90 into my skrill acount bcuze i cant withdrall my, i have 300 names in excel file need to done copy from excel file into notepad file, i have created an app where you can sell stuff and chat directly with the seller i need a logo for this app to be used on the ap, i have started a new job as a tour guide and i need some audio transcribing from a colleagues tour of oxford stratford upon avon, i need a graphic artisist from san diego, i need a job working from home, i need a marketing person from singapoure, write a story that illustrate expression a friend in need is a friend in deed, online translator all you need is one bite

О работодателе:
( 0 отзыв(-а, -ов) ) Poland

ID проекта: #23463686

Поручен:

jaykushwaha817

Hi Please let us know your details requirements so we could analyze it and start working. we have few questions to clarify before we start, could you kindly reply us. Relevant Skills and Experience I already completed Больше

$10 USD за 7 дней(-я)
(0 отзывов(-а))
0.0

2 фрилансеров(-а) в среднем готовы выполнить эту работу за $10

Seraj2372

Some of my previously built websites are:- 1) [login to view URL] 2) [login to view URL] 3) [login to view URL] 4) [login to view URL] I'd love working with you. Let's talk furthur i Больше

$10 USD за 3 дней(-я)
(1 отзыв)
0.6