Code Duplication    Length = 4-5 lines in 2 locations

classes/class-wetu-importer-tours.php 2 locations

@@ 801-804 (lines=4) @@
798
	 */
799
	public function set_price( $data, $id ) {
800
		//Price
801
		if ( isset( $data['price'] ) && '' !== $data['price'] ) {
802
			$price = preg_replace( '/[^0-9,.]/', '', $data['price'] );
803
			$this->save_custom_field( $price,'price',$id );
804
		}
805
806
		//Price includes
807
		if ( isset( $data['price_includes'] ) && '' !== $data['price_includes'] ) {
@@ 821-825 (lines=5) @@
818
	 * Set the duration
819
	 */
820
	public function set_duration( $data, $id ) {
821
		if ( isset( $data['days'] ) && ! empty( $data['days'] ) ) {
822
			$price = $data['days'];
823
			$price = preg_replace( '/[^0-9,.]/', '', $price );
824
			$this->save_custom_field( $price,'duration',$id );
825
		}
826
	}
827
828
	/**