Title: Regular price function editor
Last modified: April 7, 2022

---

# Regular price function editor

 *  Resolved [miguelpenas](https://wordpress.org/support/users/miguelpenas/)
 * (@miguelpenas)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/regular-price-function-editor/)
 * 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](https://imgur.com/KWrhtzo)
 * 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 1 replies (of 1 total)

 *  Thread Starter [miguelpenas](https://wordpress.org/support/users/miguelpenas/)
 * (@miguelpenas)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/regular-price-function-editor/#post-15554683)
 * Solved:
    <?php function preco_final( $priceB2B,$portes=5,$iva=23,$lucro=23 ) {
   $preco_sem_portes=0; $preco_sem_portes = $priceB2B + $portes; $preco_sem_portes
   = round($preco_sem_portes, 2); $preco_com_iva = $preco_sem_portes + ($iva*($preco_sem_portes/
   100)); $preco_com_iva = round($preco_com_iva, 2); $preco_com_lucro = $preco_com_iva
   + ($lucro*($preco_com_iva/100)); $preco_com_lucro = round($preco_com_lucro, 2);
   return $preco_com_lucro; } ?>

Viewing 1 replies (of 1 total)

The topic ‘Regular price function editor’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [price](https://wordpress.org/support/topic-tag/price/)

 * 1 reply
 * 1 participant
 * Last reply from: [miguelpenas](https://wordpress.org/support/users/miguelpenas/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/regular-price-function-editor/#post-15554683)
 * Status: resolved