A lot of prices we only have the sale price including tax ( GST in our case)
So wanted a way to enter it like that
This appears to work but use at your own risk I did it for 1.4 so am unsure if it works for other versions
also does not work for sales price yet if I have time will do that as well
Unzip it in your cart directory and it all overwrite
admin\language\english\catalog\product.php
admin\view\template\catalog\product_form.tpl
admin\index.php
admin\controller\catalog\product.php
In your admin set display prices with TAX
It will also use your store settings country and location for the TAX rate when entering
so make sure you have a Geo class that matches that with a tax rate in the tax class
When entering your products you can enter as Gross ( eg with tax ) and it will back calculate the net ( before tax price ) or if you enter that price then it to forward calculate the gross price
It still only saves the price to the database
and if the shopper has other taxes because of his area he will still get these
anyway it works for my case and certainly helps the person entering the prices
So wanted a way to enter it like that
This appears to work but use at your own risk I did it for 1.4 so am unsure if it works for other versions
also does not work for sales price yet if I have time will do that as well
Unzip it in your cart directory and it all overwrite
admin\language\english\catalog\product.php
admin\view\template\catalog\product_form.tpl
admin\index.php
admin\controller\catalog\product.php
In your admin set display prices with TAX
It will also use your store settings country and location for the TAX rate when entering
so make sure you have a Geo class that matches that with a tax rate in the tax class
When entering your products you can enter as Gross ( eg with tax ) and it will back calculate the net ( before tax price ) or if you enter that price then it to forward calculate the gross price
It still only saves the price to the database
and if the shopper has other taxes because of his area he will still get these
anyway it works for my case and certainly helps the person entering the prices
Attachments
Is this solution upgrade proof or I should reinstall files after every upgrade of OC? Houw about compatibility issues after OC update? Any chances this could be implemented in core? In my opinion it very usefull feature, because when you sold as enterprice and need to add VAT using backward math it's practically impossible to get "marketig price" as XX.99 or so.
Also I get an error, that required file /system/library/measurement.php can not be found.
Also I get an error, that required file /system/library/measurement.php can not be found.
considering the files it overwrites no it absolutely would not be upgrade proof. And you wouldn't want to blindly go overwriting the files for the next version either. If there are any changes in the product entry at all it would completely remove them.isparduotuvele wrote:Is this solution upgrade proof or I should reinstall files after every upgrade of OC? Houw about compatibility issues after OC update? Any chances this could be implemented in core? In my opinion it very usefull feature, because when you sold as enterprice and need to add VAT using backward math it's practically impossible to get "marketig price" as XX.99 or so.
Also I get an error, that required file /system/library/measurement.php can not be found.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
yeah when the forum had to be reinstalled a while back some of the files got corrupted the op or someone who has the files would have to reupload them.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
Here's the original attachment.
Attachments
Or simply use this hack by only exchanging this templatefile in admin/views/template/catalog/product_form.php
and change TAXVALUE - ENTER DIRECTLY according to your value. Ok this is a bit simpler but much easier to handle.
There are only 2 blocks needed, easy to update them in the next release, marked with
<!-- TAXMOD1 BEGIN --> <!-- TAXMOD1 END -->
Cheers,
tronics
and change TAXVALUE - ENTER DIRECTLY according to your value. Ok this is a bit simpler but much easier to handle.
There are only 2 blocks needed, easy to update them in the next release, marked with
<!-- TAXMOD1 BEGIN --> <!-- TAXMOD1 END -->
Cheers,
tronics
Unfortunately the upload does not work however just replace the price against:
--------------
and below use this javascript but change the TAX value first:
Code: Select all
<!-- TAXMOD1 BEGIN -->
<tr>
<td><b>Bruttopreis</b> Komma mit . angeben nicht mit Komma</td>
<td><input type="text" id="grossprice" name="grossprice" onkeyup="updateNet()" value="<?php print ($price*1.2); ?>" /></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 -->
and below use this javascript but change the TAX value first:
Code: Select all
<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 = 20; //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 = 20; //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 -->
Last edited by i2Paq on Wed Jun 16, 2010 3:37 am, edited 1 time in total.
Reason: Code-tags added
Reason: Code-tags added
Sorry but can you please tell me if I can change this for the latest opencart. I am not totally sure exactly where to change this - is on the product.php and product_form.tpl
Thanks - don't want to upset the beautiful code.
I changed the code in the product_form.tpl after reading it again but can't get it to have the gross working correctly. Every time I add say 500.0000 and save it when I go back it has 545.4546
Any reason why the gross amount won't stay?
Thanks - not sure if it is because I have to change files anywhere else.
Thanks - don't want to upset the beautiful code.
I changed the code in the product_form.tpl after reading it again but can't get it to have the gross working correctly. Every time I add say 500.0000 and save it when I go back it has 545.4546
Any reason why the gross amount won't stay?
Thanks - not sure if it is because I have to change files anywhere else.
Thanks I got this sorted it was on the gross field having $price*1.2 whereas I needed to change this to 1.1
Cheers
Cheers
Hi,
I'm using the code / script posted by tronics, which works fine for a "single" price.
I tried to use and change the code, so that also the prices in the options table are being shown with/without tax. I was able to add the fields, but the automatic calculation does not work here. I'm not very familiar with JavaScript so any help is appriciated.
Here's the code I'm trying to find the solution
Many thanks for your help.
Cheers, Chris
I'm using the code / script posted by tronics, which works fine for a "single" price.
I tried to use and change the code, so that also the prices in the options table are being shown with/without tax. I was able to add the fields, but the automatic calculation does not work here. I'm not very familiar with JavaScript so any help is appriciated.
Here's the code I'm trying to find the solution
Code: Select all
<!-- TAXMOD1 BEGIN -->
<input type="text" id="grossprice1" name="grossprice1" onkeyup="updateNet1()" value="<?php print ($product_option_value['price']*1.025); ?>" size="5" />
<input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][price]" id="price" onkeyup="updateGross1()" value="<?php echo $product_option_value['price']; ?>" size="5" /></td>
<!-- TAXMOD1 BEGIN -->
<script type="text/javascript"><!--
function doRound(x, places) {
return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
}
function updateGross1() {
var taxRate = 2.5; //TAXVALUE - ENTER DIRECTLY
var grossValue = document.forms["form"].price.value;
if (taxRate > 0) {
grossValue = grossValue * ((taxRate / 100) + 1);
}
document.forms["form"].grossprice1.value = doRound(grossValue, 4);
}
function updateNet1() {
var taxRate = 2.5; //TAXVALUE - ENTER DIRECTLY
var netValue = document.forms["form"].grossprice1.value;
if (taxRate > 0) {
netValue = netValue / ((taxRate / 100) + 1);
}
document.forms["form"].price.value = doRound(netValue, 4);
}
//--></script>
<!-- TAXMOD1 END -->
Cheers, Chris
Working solution for 1.5.4.x: http://forum.opencart.com/viewtopic.php ... 42#p198234
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
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
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
Guntis
Partneris.lv - opencart web site development and support
Who is online
Users browsing this forum: No registered users and 117 guests