Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Quiros Segura fufales

View GitHub Profile
@fufales
fufales / wc_customer_bought_product.php
Created Sep 28, 2016 — forked from codearachnid/wc_customer_bought_product.php
WooCommerce check if user has already bought product.
View wc_customer_bought_product.php
<?php
// if product is already in global space
global $product;
// or fetch product attributes by ID
if( empty( $product->id ) ){
$wc_pf = new WC_Product_Factory();
$product = $wc_pf->get_product($id);
}