Added manufacturer and supplyer product numbers #30

Merged
nedimu merged 3 commits from simple-product-details into master 2018-10-18 19:00:28 +02:00
Showing only changes of commit 00e853ae6b - Show all commits

View File

@@ -94,11 +94,17 @@ class Wiaas_Admin_Product {
public static function wiaas_my_save_post($post_id) {
global $post;
$status = get_post_status( $post->ID);
$value = get_field('_wiaas_product_country', $post_id, true);
$type = get_field('_wiaas_product_type', $post_id, true);
error_log($status);
error_log($value);
if (!empty($value)) {
if (!empty($value) && $status === '_wiaas_no_country' ) {
wp_set_object_terms($post_id, $value, 'product_country', true);
wp_set_object_terms($post_id, $type, 'product_type', true);
@@ -108,14 +114,7 @@ class Wiaas_Admin_Product {
'post_status' => 'draft'
));
} else {
wp_update_post(array(
'ID' => $post_id,
'post_status' => '_wiaas_no_country'
));
}
}
}