Page 1 of 1
Add price including tax in add products
Posted: Thu May 13, 2010 2:23 am
by kroozing
I have searched the forum with no avail, I need to be able to put the price including tax (17.5%) instead of the price excluding tax when entering a new product.
I have tried the tax change contribution posted in this forum however it doesn't work.
Has anyone got a solution to this?
i am only selling to the uk with a standard tax of 17.5%
Many thanks
Re: Add price including tax in add products
Posted: Thu May 13, 2010 3:54 am
by Xsecrets
in the settings there is an option show prices with tax just choose yes.
Re: Add price including tax in add products
Posted: Thu May 13, 2010 4:21 am
by kroozing
Thanks for your reply,
I have set that setting to yes and it does what i want on the front end. I am wanting to input the sale price in admin including the tax, otherwise i have to have a calculator with me all the time.
Re: Add price including tax in add products
Posted: Thu May 13, 2010 4:34 am
by Xsecrets
ahhh there was another thread at one point in time with someone wanting that same thing. Not sure if they ever got it working or not.
Re: Add price including tax in add products
Posted: Thu May 13, 2010 4:41 am
by kroozing
Yeah i saw that however no body posted a solution.
Was hoping i could be more lucky
Thanks anyway
Re: Add price including tax in add products
Posted: Wed Jun 02, 2010 8:50 am
by mcs107
Yes, I am needing the same thing (to add product price including tax). If anyone has a solution, it will much appreciated.
Re: Add price including tax in add products
Posted: Wed Jun 02, 2010 2:03 pm
by kroozing
I'm sorry but I am yet to find a solution
Re: Add price including tax in add products
Posted: Tue Sep 14, 2010 3:29 am
by Smile
Well maybe we should make a donation for the person who fix this problem! I really would love to see this as well!
Re: Add price including tax in add products
Posted: Wed Sep 15, 2010 12:44 am
by i2Paq
There is a solution on the Dutch forums
Here.
Find in admin\view\template\catalog\product_form.tpl
Code: Select all
<tr>
<td><?php echo $entry_price; ?></td>
<td><input type="text" name="price" value="<?php echo $price; ?>" /></td>
</tr>
Replace with:
Code: Select all
<!-- TAXMOD1 BEGIN -->
<tr>
<td><?php echo $entry_price_gross; ?></td>
<td><input type="text" id="grossprice" name="grossprice" onkeyup="updateNet()" value="<?php print ($price*1.19); ?>" /></td>
</tr>
<tr>
<td><?php echo $entry_price; ?></td>
<td><input type="text" id="price" name="price" onkeyup="updateGross()" value="<?php echo $price; ?>" /></td>
</tr>
<!-- TAXMOD1 END -->
<script type="text/javascript"><!--
var image_row = <?php echo $image_row; ?>;
function addImage() {
html = '<tbody id="image_row' + image_row + '">';
html += '<tr>';
html += '<td class="left"><input type="hidden" name="product_image[' + image_row + ']" value="" id="image' + image_row + '" /><img src="<?php echo $no_image; ?>" alt="" id="preview' + image_row + '" class="image" onclick="image_upload(\'image' + image_row + '\', \'preview' + image_row + '\');" /></td>';
html += '<td class="left"><a onclick="$(\'#image_row' + image_row + '\').remove();" class="button"><span><?php echo $button_remove; ?></span></a></td>';
html += '</tr>';
html += '</tbody>';
$('#images tfoot').before(html);
image_row++;
}
//--></script>
<script type="text/javascript" src="view/javascript/jquery/ui/ui.datepicker.js"></script>
<script type="text/javascript"><!--
$(document).ready(function() {
$('.date').datepicker({dateFormat: 'yy-mm-dd'});
});
//--></script>
<script type="text/javascript"><!--
$.tabs('#tabs a');
$.tabs('#languages a');
//--></script>
<!-- TAXMOD1 BEGIN -->
<script type="text/javascript"><!--
function doRound(x, places) {
return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
}
function updateGross() {
var taxRate = 19; //TAXVALUE - ENTER DIRECTLY
var grossValue = document.forms["form"].price.value;
if (taxRate > 0) {
grossValue = grossValue * ((taxRate / 100) + 1);
}
document.forms["form"].grossprice.value = doRound(grossValue, 4);
}
function updateNet() {
var taxRate = 19; //TAXVALUE - ENTER DIRECTLY
var netValue = document.forms["form"].grossprice.value;
if (taxRate > 0) {
netValue = netValue / ((taxRate / 100) + 1);
}
document.forms["form"].price.value = doRound(netValue, 4);
}
//--></script>
<!-- TAXMOD1 END -->
Add to admin\language\dutch\catalog\product.php
Code: Select all
$_['entry_price_gross'] = 'Price (incl Tax): <strong>Use .<strong/>';
tested on 1.4.8a
($price*1.19) this is set to Tax beeing 19%, adjust this to fit your own need eg. Tax 20% = ($price*1.20)
Re: Add price including tax in add products
Posted: Wed Sep 15, 2010 2:28 am
by Qphoria
You got some addimage code that doesn't look like it should be there
Re: Add price including tax in add products
Posted: Wed Sep 15, 2010 2:57 am
by i2Paq
Qphoria wrote:You got some addimage code that doesn't look like it should be there
Well, it is not my code, I just copied it here
I do think that if you would have a look at this code, adjust it to your standard, a lot of OC-users would benefit from it
Re: Add price including tax in add products
Posted: Fri Oct 07, 2011 8:39 pm
by karmadjez
the above code works in 1.5.1 althoug there are two things that happen
1. on the product entry page you get Notice: Undefined variable: entry_price_gross in /var/www/vhosts/bedstorquay.co.uk/httpdocs/admin/view/template/catalog/product_form.tpl on line 66
although it does not stop it working it is untidied
2. if you enter say 79.00 in the gross price it works the vat out (at 20% for uk) but once saved it reverts to 79.8884 and it looks rather untidy again
any offers of how to cure these two irritants
in the whole though made life alot easier
Re: Add price including tax in add products
Posted: Fri Oct 07, 2011 9:19 pm
by uksitebuilder
You have replied to a post that is 12 months old, I'm shocked it works at all in 1.5.x
I believe this may be a better solution for you:
http://forum.opencart.com/viewtopic.php ... 0&p=198242
Re: Add price including tax in add products
Posted: Wed Jun 24, 2015 8:00 pm
by guntis.e
Here is commercial solution:
For Opencart 1.5.x:
Price Input Helper - Entering Price With Tax Included
For Opencart 2.x:
Price Input Helper 2 - Enter price with tax
This OpenCart extension allows e-commerce store owner to input prices with tax on product edit form. The price without tax will be automatically calculated and saved with the form.
Features
possibility to
edit and save the price modifyer (or myltiplyer)
possibility to
auto-detect the tax rate based on product tax class
helper field available in all places where the price input is done:
product price
options prices
discounts prices
special prices
Product list page has additional column with price incl. tax
Re: Add price including tax in add products
Posted: Sat Oct 29, 2016 6:22 am
by PSMDanny
Another solution would be:
https://www.opencart.com/index.php?rout ... n_id=28303
this modification allows you to insert prices with tax in:
- Product Price
- Product Options
- Product Discounts
- Product Specials
click the demo button and see it in action
Best Regards,
Danny