public function increase_sales($quantity = 1) { $sales = give_get_form_sales_stats($this->ID); $quantity = absint($quantity); $total_sales = $sales + $quantity; if ($this->update_meta('_give_form_sales', $total_sales)) { $this->sales = $total_sales; return $this->sales; } return false; }
/** * * Increases the sale count of a download. * * @since 1.0 * * @param int $give_form_id Give Form ID * * @return bool|int */ function give_increase_purchase_count($give_form_id = 0) { $form = new Give_Donate_Form($give_form_id); return $form->increase_sales(); }