wp estore tax calculator
function eStore_get_tax_include_price_by_prod_id($id, $price) {
global $wpdb;
$products_table_name = WP_ESTORE_PRODUCTS_TABLE_NAME;
$ret_product = $wpdb->get_row("SELECT * FROM $products_table_name WHERE id = '$id'", OBJECT);
$tax_rate = "";
if (!empty($ret_product->tax)) {
$tax_rate = $ret_product->tax;
} else {
$tax_rate = get_option('eStore_global_tax_rate');
}
$tax_inc_price = $price + (($price * $tax_rate) / 100);
return number_format($tax_inc_price, 2, '.', '');
}
function eStore_calculate_tax_included_price_without_qty($p rice, $tax_rate) {
return $price + (($price * $tax_rate) / 100);
}
function eStore_calculate_tax_included_price_with_qty($pric e, $tax_rate, $qty = 1) {
return ($price * $qty) + (($price * $qty * $tax_rate) / 100);
}
-
emptee -
Thanks - 1 reply
Signature★★★ Supercharge GSA Search Engine Ranker With PA and DA. Rank Like it's 2012 Again ★★★Is CloudFlare COSTING You Business?{{ DiscussionBoard.errors[10070217].message }}-
SuperCell -
Thanks
{{ DiscussionBoard.errors[10070758].message }} -
-