MarketPress - VAT / TAX

Hi there Guys.

I know there was a previous thread about this from like nine months ago.

The question is how to display pricing with Tax / VAT included for front end display of marketpress.

Monolith had a post with some code as a work around which was supposed to be added into the core system there after but it looks like that may have been pushed aside for more pressing matters. However this is not a polite suggestion in South Africa and is part of our legislation in our national Consumer Protection Act, sellers not displaying complete costs are in serious hot water.

Additionally this cannot be loaded as VAT inclusive as again by law this needs to be displayed separate on the invoice.

Right so after a bit of panel beating of Monoliths workaround code int he Template-Functions.php document, I have this working for general price display.

Line 1354 ->

if ((is_array($meta["mp_price"]) && count($meta["mp_price"]) == 1) || !empty($meta["mp_file"])) {
    if ($meta["mp_is_sale"] && $meta["mp_sale_price"][0]) {
	    $price = '<span class="mp_special_price"><del class="mp_old_price">'.$mp->format_currency('', $meta["mp_price"][0] + ($meta["mp_price"][0]* $settings ['tax']['rate'])).'</del>';
	    $price .= '<span class="mp_current_price">'.$mp->format_currency('', $meta["mp_sale_price"][0] + ($meta["mp_sale_price"][0]* $settings ['tax']['rate'])).'</span></span>';
	  } else {

		$price = '<span class="mp_normal_price"><span class="mp_current_price">'.$mp->format_currency('', $meta["mp_price"][0] + ($meta["mp_price"][0]* $settings ['tax']['rate'])).'</span></span>';

Which is all Good..

Now where I am having an issue.

Further down where the system handles Variations it is a slightly more complex system:

Line 1439 ->

//create select list if more than one variation
		  if (is_array($meta["mp_price"]) && count($meta["mp_price"]) > 1 && empty($meta["mp_file"])) {
	      $variation_select = '<select class="mp_product_variations" name="variation">';
				foreach ($meta["mp_price"] as $key => $value) {
				  $disabled = (in_array($key, $no_inventory)) ? ' disabled="disabled"' : '';
				  $variation_select .= '<option value="' . $key . '"' . $disabled . '>' . esc_html($meta["mp_var_name"][$key]) . ' - ';
					if ($meta["mp_is_sale"] && $meta["mp_sale_price"][$key]) {

		        $variation_select .= $mp->format_currency( '',$meta["mp_sale_price"][$key]);

		      } else {
		        $variation_select .= $mp->format_currency('', $value+($value* $settings ['tax']['rate']));
		      $variation_select .= "</option>\n";
	      $variation_select .= "</select> \n";
	 		} else {

It seems to use $key to define the product or something and combine "mp_price" as the key and use this as $value...

Fine this works for all normal prices loaded into the system but the moment a product price is set to sale I am struggling to generate this as a VAT / TAX inclusive amount.

For the majority of this i have been able to run the following equation to generate the taxe inclusive figure for display

$value+($value* $settings ['tax']['rate'])

However I just cant get this to work for

$variation_select .= $mp->format_currency( '',$meta["mp_sale_price"][$key]);

Please some help and a status update on the tax handling, shipping waybills and other additions to marketpress that were stated for launch in the next version which has come and gone would be nice.

Thank you kindly.

  • sixthcore
    • Site Builder, Child of Zeus

    Ok here are a couple of other issues - >

    Shopping cart for non logged in users dosnt display tax or shipping prior to clicking through to the payment gateway is there a way to sort this out?

    Additionally all shopping carts should display all data and complete pricing, shoppers will get hacked off if they get 2 different prices, and get bundled with hidden prices.

    As a feature suggestion:

    An inverse VAT / TAX handling system that generates so that all prices are tax inclusive but the invoice generated would show this as a separate figure.,

  • sixthcore
    • Site Builder, Child of Zeus

    Equation to handle the above suggestion would be as follows:

    Cost inclusive 100 + 14% = 114
    to reverse engineer this back to the cost ex tax: 114 / 1.14 ( percentage as decimal + 1 - to make it relative)

    or the Direct addition with MarketPress - Financial Handling as it stands using exclusive figures:

    Adding Vat for vat exclusive figures
    "mp_price" + ("mp_price" * Tax Rate as Decimal {note MP generates this already})

    Removing Vat for the inverse system that could be toggled in the store settings:

    "mp_price" / (1+TAX RATE IN DECIMAL)

    Dunno if this helps.

  • sixthcore
    • Site Builder, Child of Zeus

    Phil the code is simply defining how the numerals are out put to the display of the product

    I have added as per the above section

    "mp_price" + ("mp_price" * Tax Rate as Decimal {note MP generates this already})

    .$mp->format_currency('', $meta["mp_price"][0] + ($meta["mp_price"][0]* $settings ['tax']['rate'])).

    This takes MP_PRICE and multiplies it by MP_PRICE Multiplied by the TAX Setting.

    This effectively manes that this will work for stores running with out VAT / TAX and stores that do...

    It is purely the Varation prices for items on SALE that i cant get to work.

  • sixthcore
    • Site Builder, Child of Zeus

    Cart differences:

    It appears that some versions of the cart show tax and shipping and others dont...

    Non logged in users appear to get blank shipping and tax... no values.

    I am going to reinstall Marketpress accross the board on this system to see if it is a core hack that is causing the gremlins or what..

  • Aaron
    • CTO

    We can't show tax or shipping until we have their shipping address. If at some point in the current session they add their address, further views of the cart will show calculated values. Has nothing to do with being logged in. Also the cart widget is designed not to show those details because of lack of room.

    As far as tax inclusive values, on the cart what should it show? Should products in the cart include tax also, as well as tax listed separately?

    Also some of the gateways (like Paypal) show the cart item details, and you can't change the tax display in those, which might be confusing to the user.

    And how should default tax be calculated from, should it be your base location?

  • sixthcore
    • Site Builder, Child of Zeus

    I understand the shipping line item..

    However, as a shopper looking at a product for say $100 which shows in the cart as $100 dollars only to find out that at checkout the product is going to cost you $114 is going to inflame shoppers and quite possibly hinder a sale.

    As the system is built for multiple country supply, The shipping I can get a round with a line of text to show that shipping costs are only handled on the user supplying shipping details.

    The tax handling is of much higher importance.

    Tax handling is based ont he country that the products are being supplied from am i not correct?>

    To my understanding the tax of the base of the store is the tax that will be charged regardless of the country it is shipped from or to... This is a pretty standard process.

    If you havent looked at it..

    JigoShop handles this very nicely as do the majority of E-Commerce systems. Possibly a little poke around in the handling of alternate systems would be a good call.

    The general handling is either to display prices with or without as a toggle, and alternately to have prices entered into the backend on product load as either incluse or exclusive.

    For users utilizing paypal they could simply disable the handling and use it on the paypal side.


    If you could guide me in how to build a work around for the

    Multiple Variations on Sale price and how to add the TAX to that I can just hack the rest of the system to work around the holes.

    However I and it seems a few other users feel that this is possibly the biggest hole in the plugin at present.

  • Aaron
    • CTO

    Tax handling is based ont he country that the products are being supplied from am i not correct?>

    Every country is different. In the USA we only have to charge tax on products shipped within the same state. In the EU you only tax items shipped within the EU. UK I think has different rates for in country, EU, or other locations.

    I think i'm going to go with this method:

    have prices entered into the backend on product load as either inclusive or exclusive.

  • sixthcore
    • Site Builder, Child of Zeus

    Hmmm just checking the majority of products i order out of the states, have tax added on? as do from the UK and German....

    I had to go and do a quick check.

    So it does appear that companies are charging tax on all sales probably to ease the accounting process.

  • Aaron
    • CTO

    So it does appear that companies are charging tax on all sales probably to ease the accounting process.

    Or to make more money. Tax laws are a nightmare for online commerce, they are still playing catch up. Every country and often state/province have different ever changing rules.

  • sixthcore
    • Site Builder, Child of Zeus

    Hi there

    Have setup a test network to demo through:


    Appears that there is a parameter string issue will check it is not an issue my side.

    Payfast - Official (brand new)

    Processing payment but adding Tax on so probably a variable adding it on.


    Appears to be working perfectly.


    I am guessing that you have changed one of the variables or arrays in the gateway handling to achieve this so that could be what is throwing 2CO out and Payfast which we are testing now which is adding the vat over and above the figure but at the right amount.


    Also well done on the shipping handling... it looks like it is going to be perfect.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.