Skip to content

Commit

Permalink
fix: set default total_sales count on adding a new product is fixed #565
Browse files Browse the repository at this point in the history
 (#566)
  • Loading branch information
saimonh3 authored and sabbir1991 committed Feb 25, 2019
1 parent 9fc4d43 commit 72d3402
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/product-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ function dokan_save_product( $args ) {
update_post_meta( $product_id, '_visibility', 'visible' );
}

if ( ! $is_updating ) {
update_post_meta( $product_id, 'total_sales', 0 );
}

if ( ! $is_updating ) {
do_action( 'dokan_new_product_added', $product_id, $data );
} else {
Expand Down

0 comments on commit 72d3402

Please sign in to comment.