[REST API] Save default total_sales, closes #10898
This commit is contained in:
parent
47ef7e17a1
commit
ccd1f48025
|
@ -847,6 +847,9 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
// Default total sales.
|
||||
add_post_meta( $product_id, 'total_sales', '0', true );
|
||||
|
||||
// Virtual.
|
||||
if ( isset( $request['virtual'] ) ) {
|
||||
update_post_meta( $product->id, '_virtual', true === $request['virtual'] ? 'yes' : 'no' );
|
||||
|
|
|
@ -806,6 +806,9 @@ class WC_API_Products extends WC_API_Resource {
|
|||
}
|
||||
}
|
||||
|
||||
// Default total sales.
|
||||
add_post_meta( $product_id, 'total_sales', '0', true );
|
||||
|
||||
// Virtual
|
||||
if ( isset( $data['virtual'] ) ) {
|
||||
update_post_meta( $product_id, '_virtual', ( true === $data['virtual'] ) ? 'yes' : 'no' );
|
||||
|
|
|
@ -1291,6 +1291,9 @@ class WC_API_Products extends WC_API_Resource {
|
|||
}
|
||||
}
|
||||
|
||||
// Default total sales.
|
||||
add_post_meta( $product_id, 'total_sales', '0', true );
|
||||
|
||||
// Virtual.
|
||||
if ( isset( $data['virtual'] ) ) {
|
||||
update_post_meta( $product_id, '_virtual', ( true === $data['virtual'] ) ? 'yes' : 'no' );
|
||||
|
|
Loading…
Reference in New Issue