Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Regular price function editor

$
0
0

Replies: 0

Good night,

I need to do a function for the selling price of the products.
It will be the priceB2B + 5€ (shipping) + 23% (VAT) + 23% (profit)
I’m not getting the job done. Is it possible to help?
Printscreen on this link.Print exampleo

On Regular price field I’m putting this: [correct_price({priceB2B[1]})]

<?php
function finalprice($priceB2B = null, $shipping =5, $vat = 23, $profit = 23){
    $only_shipping = ($priceB2B / 100) + $shipping;
    $pricewithship = $priceB2B + $shipping;
	$only_vat = ($pricewithship / 100) * $vat; 
	$price_n_vat = $pricewithship + $only_vat; 
	$profit = ($price_n_profit / 100) * $profit;  
	$payprice = $price_n_profit + $tax;  
	echo correct_price;
}
?>

Viewing all articles
Browse latest Browse all 59525

Trending Articles