Impleneted search by country, and added mesurment unit
This commit is contained in:
@@ -114,12 +114,25 @@ class Wiaas_Countries {
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public static function get_product_country($product) {
|
||||
public static function get_product_country($product) {
|
||||
$product_country = get_the_terms($product->get_id(), 'product_country');
|
||||
return is_array($product_country) && isset($product_country[0]) ?
|
||||
self::$available_countries[$product_country[0]->name] :
|
||||
null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves country term id from db for provided product
|
||||
* @param $product
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public static function get_product_country_term_id($product) {
|
||||
$product_country = get_the_terms($product->get_id(), 'product_country');
|
||||
return is_array($product_country) && isset($product_country[0]) ?
|
||||
$product_country[0]->term_id :
|
||||
null;
|
||||
}
|
||||
}
|
||||
|
||||
Wiaas_Countries::init();
|
||||
|
||||
Reference in New Issue
Block a user