Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › display TTC price (tax included) on product page
Tagged: german tax, included tax, price, Regional Sales Tax, tax, tax included price, VAT
- This topic has 29 replies, 9 voices, and was last updated 12 years, 1 month ago by admin.
-
AuthorPosts
-
February 25, 2011 at 2:40 pm #2809guidumMember
Hi,
is there any mean to display the VAT included price of a product on its page ?
all webstores in France do so and my clients do not wish to do differently.
thanks for reply, urgently needed…
February 26, 2011 at 12:44 am #29471amin007Participant=================================
Update: We have added an option in the plugin to display tax inclusive price for fancy displays. Check the following option from eStore settings menu to enable this feature:
Show Tax Inclusive Amount
=========================================
eStore doesn’t have an option to display tax included price.
There are two possible workarounds:
1) Place an asterisk (*) next to the price field and then explain that this price is not including tax
2) The plugin can be tweaked so that when eStore displays the product it can calculate the tax of a product and add that to the actual price and display the sum amount as the product price. The thing to note here is that this price is for display only. When the item details are submitted to PayPal it will separately submit the true product price and tax and shipping.
Let me know if any of these above workarounds might work.
February 27, 2011 at 10:08 am #29472guidumMemberoption 2 would fit, how can i implement this ?
thanks for your help …
February 27, 2011 at 7:28 pm #29473happyshieldMemberI also need this for the UK where it is frowned upon to show ex-VAT prices. Thanks.
February 28, 2011 at 5:36 am #29474amin007ParticipantLets try this tweak. First we will change it so the fancy display 1 shows the tax included price and then we will change the shopping cart to show the tax included price when it lists the items in the cart.
1) Open the “eStore_misc_functions.php” file and search for the following line:
$output .= '<div class="eStore_price"><strong>'.ESTORE_PRICE.': </strong>'.WP_ESTORE_CURRENCY_SYMBOL.$ret_product->price.'</div>';
Once you find it replace that line with the following block of code:
$tax_rate = get_option('eStore_global_tax_rate');
$tax_included_price = $ret_product->price + (($ret_product->price * $tax_rate)/100);
$output .= '<div class="eStore_price"><strong>'.ESTORE_PRICE.': </strong>'.print_digi_cart_payment_currency($tax_included_price, WP_ESTORE_CURRENCY_SYMBOL, ".").'</div>';This should make it so the fancy display 1 shows the price with the tax included.
2. Now, lets modify the shopping cart… open the “eStore_cart.php” file and find the following block of code:
foreach ($_SESSION['eStore_cart'] as $item)
{
$output .= "
<tr><td style='overflow: hidden;'><a href='".$item['cartLink']."'>".$item['name']."</a></td>
<td style='text-align: left'><form method="post" action="" name='peStore_cquantity' style='display: inline'>
<input type="hidden" name="product" value="".htmlspecialchars($item['name'])."" />
<input type='hidden' name='eStore_cquantity' value='1' /><input type='text' name='quantity' value='".$item['quantity']."' size='1' onchange='document.peStore_cquantity.submit();' onkeypress='document.getElementById("pinfo").style.display = "";' /></form></td>
<td style='text-align: left'>".print_digi_cart_payment_currency(($item['price'] * $item['quantity']), $currency_symbol, $decimal)."</td>
<td style='text-align: left'><form method="post" action="">
<input type="hidden" name="product" value="".htmlspecialchars($item['name'])."" />
<input type='hidden' name='eStore_delcart' value='1' />
<input type='image' src='".WP_ESTORE_URL."/images/Shoppingcart_delete.gif' class='eStore_remove_item_button' value='Remove' title='".ESTORE_REMOVE_ITEM."' /></form></td></tr>
";
$total += $item['price'] * $item['quantity'];
$item_total_shipping += $item['shipping'] * $item['quantity'];
$total_items += $item['quantity'];
}Once you find it replace it with the following:
$tax_rate = get_option('eStore_global_tax_rate');
foreach ($_SESSION['eStore_cart'] as $item)
{
$output .= "
<tr><td style='overflow: hidden;'><a href='".$item['cartLink']."'>".$item['name']."</a></td>
<td style='text-align: left'><form method="post" action="" name='peStore_cquantity' style='display: inline'>
<input type="hidden" name="product" value="".htmlspecialchars($item['name'])."" />
<input type='hidden' name='eStore_cquantity' value='1' /><input type='text' name='quantity' value='".$item['quantity']."' size='1' onchange='document.peStore_cquantity.submit();' onkeypress='document.getElementById("pinfo").style.display = "";' /></form></td>
";
if(!empty($item['tax'])){
$tax_rate = $item['tax'];
}
$tax_included_price = ($item['price'] * $item['quantity']) + (($item['price'] * $item['quantity'] * $tax_rate)/100);
$output .= "<td style='text-align: left'>".print_digi_cart_payment_currency(($tax_included_price), $currency_symbol, $decimal)."</td>";
$output .= "<td style='text-align: left'><form method="post" action="">
<input type="hidden" name="product" value="".htmlspecialchars($item['name'])."" />
<input type='hidden' name='eStore_delcart' value='1' />
<input type='image' src='".WP_ESTORE_URL."/images/Shoppingcart_delete.gif' class='eStore_remove_item_button' value='Remove' title='".ESTORE_REMOVE_ITEM."' /></form></td></tr>
";
$total += $item['price'] * $item['quantity'];
$item_total_shipping += $item['shipping'] * $item['quantity'];
$total_items += $item['quantity'];
}This should make it so the shopping cart lists the tax inclusive price for individual items.
February 28, 2011 at 8:13 am #29475guidumMemberseems to be good but i get €9.99856 price on product page, can we get a round number instead of this ?
thanks !
February 28, 2011 at 11:30 pm #29476amin007ParticipantOkay I have modified the code of step 1 in the above post so it does the round up. Just reapply step 1 and it should be good.
March 1, 2011 at 9:22 am #29477guidumMemberworks fine.
thanks!
April 5, 2011 at 6:56 am #29478fyrefytaMemberI have changed the code as per above…. it is adding the 10% tax to the price and displaying the price OK for the item in the shop, but when it goes to the checkout it is showing
Total price $44
subtotal = $0
tax = $4
total = $4
I have reverted back to the old code pending a reply….
I need to deal with the Australian GST and the price needs to be inc GST,
April 5, 2011 at 6:59 am #29479fyrefytaMemberNow having reverted to the old code, in the checkout the individual item price is correct but it shows a total of $0.00 ???
April 6, 2011 at 12:38 am #29480amin007ParticipantLooks like some coding has gone wrong (may have been a copy and paste error). It is usually a good idea to get a fresh build of the plugin from here and try applying the code change again:
https://support.tipsandtricks-hq.com/update-request
Please post a link to your product page so I can add an item to the cart and check it out.
April 6, 2011 at 4:34 am #29481fyrefytaMemberThanks Amin, I have re-loaded the plugin and re-done the code tweak and it all appears to be working OK.
It has raised another question but I will start a new thread as it is not directly related to this question.
Thanks
July 5, 2011 at 8:54 am #29482ramonaParticipantHave made the changes too, everthing works fine!
Will we have to make changes again after a pugin update?
July 6, 2011 at 3:01 am #29483amin007ParticipantAt the moment yes but I am going to add a settings option for this feature. When I do that you will just be able to enable this by checking a checkbox in the settings menu of eStore.
July 7, 2011 at 8:45 am #29484ramonaParticipantSounds good and absolutely professional. Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.