Skip to content

Commit

Permalink
fix: allow vendor to update store terms and condition with REST API is
Browse files Browse the repository at this point in the history
…fixed #714 (#745)
  • Loading branch information
saimonh3 authored and sabbir1991 committed Jan 28, 2020
1 parent 2c1ea38 commit 0448682
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/Vendor/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ public function update( $vendor_id, $data = [] ) {
$vendor->set_enable_tnc( 'off' );
}

if ( ! empty( $data['store_tnc'] ) ) {
$vendor->set_store_tnc( $data['store_tnc'] );
}

if ( ! empty( $data['icon'] ) ) {
$vendor->set_icon( $data['icon'] );
}
Expand Down
13 changes: 13 additions & 0 deletions includes/Vendor/Vendor.php
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,19 @@ public function set_enable_tnc( $value ) {
$this->set_prop( 'enable_tnc', wc_clean( $value ) );
}

/**
* Set store tnc
*
* @since DOKAN_LITE_SINCE
*
* @param string
*
* @return void
*/
public function set_store_tnc( $value ) {
$this->set_prop( 'store_tnc', wc_clean( $value ) );
}

/**
* Set gravatar
*
Expand Down

0 comments on commit 0448682

Please sign in to comment.