News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

[fixed] Tax by State

Started by arcticsoft, October 19, 2011, 02:36:28 AM

Previous topic - Next topic

arcticsoft

Hi,
I am trying to set up a tax rule to calculate tax per state but have encountered a problem. If the user hasn't logged in or if user hasn't provided billing address I was expecting to see no tax but it is actually adding the tax for all states.
For instance.
If the product price is 100.00 and tax for state1 is 5% and for state2 is 7% then calculated tax is 12%. As soon as I pick state1 or state2 in the billing address, the tax calculates as it should.

Am I missing something?

Milbo

no, you did afaik everthing right, interesting behaviour, I need to take a look on it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

arcticsoft

Tried with the latest release (2.0.0-RC-2j) and still having the problem.
I have different tax rates by state. If the bill to address is not in any of the states I have rules for, it is applying all tax rates (sum of all rates).

Milbo

I have fixed it. Is in the svn, this evening
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

cas

Hi Milbo,

I'm using version M, and in the shopping cart it is still showing the tax amount when the user is not logged in.  Shouldn't the tax be zero when not logged in?

Thanks,
Chuck 

arcticsoft

The same here.  If not logged in, it is still showing all taxes
What was the fix mentioned in the previous post?

chancehoggan

Hi,

Firstly thanks for all the hardwork put into VM2!

I have upgraded to the latest version and it seems all the tax rules are applied. If i select 1 default tax rule for the companies local province and the user enters an address outside this province it will apply no taxes.

If I do not define a specific tax code it still adds all the taxes for all provinces and countries together and creates a rather expensive tax price!

chancehoggan

If I modify the core the system will break on updates.

Any info you can provide on the fix above would be a big help.

ptogel

I still have that problem. Taxes are calculated if the user is not registered or when registered. They should calculate only if in South Carolina. What doe we miss? I have VM 2.0.0.

Milbo

I need backend access to understand this.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

agaudreau

I have the same problem.. All taxes are being added in the cart and once I log in to a user, they are all still there even though my tax codes are set up per province, using VM 2.0.0 on Joomla 1.7.3

I will provide backend access for you via PM.

cas

I had this same problem, and I fixed it by going into the Tax & Calculation Rules and editing the Tax rule by selecting 'default' for the Shopper Group.    This way users who are not logged in get assigned the 'anonymous' Shopper Group and no tax is calculated for them.  When a user is logged in, they get assigned the 'default' Shopper Group and the tax rule is appropriately applied if the user is from that state/province.   

I agree the system should check if the user is not logged in and just skip the tax rules for users not logged in, but until that gets changed someday, for now you can simply assign the 'default' user to the Shopper Group in the tax rule, and it will work properly.

agaudreau

That did the trick. Thanks Cas!


cas

Glad to help!  I know I suffered a long time with this one too.   After seeing how many of us are having this same problem, I hope the VM developers will add the simple logic to not calculate tax if no one is logged in, or at least set the Tax rule Shopper Group to 'default' when it's created. 

PRO

#14
Shopper group fix did not work for me, because I let some checkout as guest.

This will hide something if a user has not put in their address yet. (IN THE CART VIEW)

<?php if (!empty($this->cart->BT)){

}

Just wrap whatever with that.

For example

if (!empty($this->cart->BT)){
      foreach($this->cart->cartData['DATaxRulesBill'] as $rule){ ?>
         <tr class="sectiontableentry<?php $i ?>">
            <td colspan="4" align="right"><?php echo   $rule['calc_name'] ?> </td>

                                     <?php if ( VmConfig::get('show_tax')) { ?>
            <td align="right"><?php  ?> </td>
                                <?php } ?>
            <td align="right"><?php echo  $this->cart->prices[$rule['virtuemart_calc_id'].'Diff'];   ?> </td>
            <td align="right"><?php echo $this->cart->prices[$rule['virtuemart_calc_id'].'Diff'];   ?> </td>
         </tr>
         <?php
         if($i) $i=1; else $i=0;
      } }?>


^^^^^

PLEASE dont forget that the total is going to be wrong. BECAUSE the tax will be added to it.

hide the total when address is not filled in. default_pricelist.php


      <?php if (!empty($this->cart->BT)){ ?>  <tr class="sectiontableentry2">
         <td colspan="4" align="right"><?php echo JText::_('COM_VIRTUEMART_CART_TOTAL') ?>: </td>

                        <?php if ( VmConfig::get('show_tax')) { ?>
         <td align="right"> <?php echo "<span  style='color:gray'>".$this->cart->prices['billTaxAmount']."</span>" ?>

</td>
                        <?php } ?>
         <td align="right"> <?php echo "<span  style='color:gray'>".$this->cart->prices

['billDiscountAmount']."</span>" ?> </td>
         <td align="right"><strong><?php echo $this->cart->prices['billTotal'] ?></strong></td>
        </tr> <?php } ?>