Author Topic: Please Help - Trying to create a 1-time fee based upon a category  (Read 4708 times)

rustle

  • Jr. Member
  • **
  • Posts: 83
  • Mad love for the VM project
    • Independent Development
Hi Guys,

I really need halp with this issue,

I aloso posted a similar topic in the Production Creation thread a couple of days ago, with no takers.

All I am trying to do is create a mandatory, 1-time fee, based on all products in a category (this fee should not be multiplied by the product quantity!)
I have attached an image with my configuration

Joomla 1.7.3
virtuemart 2.0.2

This seem like it ought to be an easy process to complete, and in factc i the only thing holding me back from going live with the site

please help


[attachment cleanup by admin]

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10365
  • VirtueMart Version: 3+
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #1 on: March 01, 2012, 21:08:18 pm »
have you tried the "tax per bill"
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

rustle

  • Jr. Member
  • **
  • Posts: 83
  • Mad love for the VM project
    • Independent Development
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #2 on: March 01, 2012, 21:38:10 pm »
Hi Banquet

Thank you for your assistance once again

Yes I have tried "tax per bill"
This was my immediate idea in fact

but VM then automatically assigns the tax to the cart, even if no purchase is made.

I believe that this is due to the fact that the "tax" functionality is looking for a region  :o

I just want to assign it to a category only


any ideas would be appreciated

VM 2.02

J 1.73

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10365
  • VirtueMart Version: 3+
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #3 on: March 02, 2012, 01:07:02 am »
but VM then automatically assigns the tax to the cart, even if no purchase is made.

U can hide it in the cart.
http://forum.virtuemart.net/index.php?topic=92144.msg318217#msg318217

and assign the tax per bill to the category.
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

rustle

  • Jr. Member
  • **
  • Posts: 83
  • Mad love for the VM project
    • Independent Development
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #4 on: March 02, 2012, 02:38:24 am »
HI Banquet

thank you for this post,

I have read it numerous times. but your template override solution does not specify the file to edit
Is this still effective in 2.0.2

can you point me in the right direction

also I have a global setup fee levied.
Will this effect this tax as well?
or just the one that is assigned to the category

thank you in advance.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10365
  • VirtueMart Version: 3+
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #5 on: March 02, 2012, 12:59:32 pm »
default_pricelist

views/cart/tmpl
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

rustle

  • Jr. Member
  • **
  • Posts: 83
  • Mad love for the VM project
    • Independent Development
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #6 on: March 02, 2012, 20:00:01 pm »
Hi Banquet

I am little confused as to how you got your fix to work

Just to be clear I am trying to put your:

"<?php 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;
      } }?>"

fix in the com_virtuemart/views/cart/tmpl/default_pricelist.php file

I seems to me that the most logical place to put this override is around line 264... Is this not correct?

However the tax is still visible in the cart

What am I doing wrong

Would it possible to let me know what lines of code you altered in order to get over this hurdle


Thank you in advance
Also a couple of people have PM'ed about this hoping to find a solution as well. (so I know that I am not the only one facing this challenge.)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10365
  • VirtueMart Version: 3+
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #7 on: March 02, 2012, 21:00:17 pm »
Thats the tax per bill.

There are also tax per product and other , calculation in the cart.

You can wrap whatever you dont want to showup in that code.
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

rustle

  • Jr. Member
  • **
  • Posts: 83
  • Mad love for the VM project
    • Independent Development
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #8 on: March 03, 2012, 02:13:03 am »
Hi Banquet

The calculation is set to  'tax per bill'

it is set to 'not visible for shopper'

I have tried with both region set on and off but still it appears in the cart

what am I doing wrong

I have a feeling it is to do with where I placed the php script you posted

what line or general location did you place your code?

thank you in advance.

rustle

  • Jr. Member
  • **
  • Posts: 83
  • Mad love for the VM project
    • Independent Development
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #9 on: March 03, 2012, 18:33:32 pm »
PLease can you assist further Banquet

this is all that is keeping us from going live with the site

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10365
  • VirtueMart Version: 3+
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #10 on: March 04, 2012, 15:47:47 pm »
THIS code will make ANYTHING you want NOT show up, until a billing address is filled in.

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

SO,.

<?php

      foreach($this->cart->cartData['taxRulesBill'] as $rule){ ?>
         <?php if (!empty($this->cart->BT)){ ?><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 echo $this->cart->prices[$rule['virtuemart_calc_id'].'Diff']; ?> </td>
             <?php } ?>
            <td align="right"><?php    ?> </td>
            <td align="right"><?php echo $this->cart->prices[$rule['virtuemart_calc_id'].'Diff'];   ?> </td>
         </tr><?php } ?>


BOLD text is what I added.
YOU do the same with whatever you dont want to show up.
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

rustle

  • Jr. Member
  • **
  • Posts: 83
  • Mad love for the VM project
    • Independent Development
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #11 on: March 04, 2012, 18:54:32 pm »
Hi Banquet

Thank you for the explanation that was much more clear  :D

I have now got the 'Tax per bill' to only display when the user has entered their billing information
this is a good fix which hopefully will be applied in a future upgrade.

However this did not solve the original intent of this post, which is to levy a a 'tax per bill' based upon a category ONLY

the tax still appears globally when ANY product is selected  :(

What I am trying to do is have a categories like - $50 set up fee / $25 dollar setup fee (which have been created & are published)
any products that belong to these categories would have the associated 'tax per bill' applied one time to the final bill

you can see my settings below
what ends up happening is that ANY product which gets selected has the 'tax per bill' applied

how do I resolve this?

[attachment cleanup by admin]

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10365
  • VirtueMart Version: 3+
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #12 on: March 04, 2012, 19:25:34 pm »
have you tried to go into the actual products and apply the rules to the products?

J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

rustle

  • Jr. Member
  • **
  • Posts: 83
  • Mad love for the VM project
    • Independent Development
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #13 on: March 04, 2012, 19:30:36 pm »
Yes-  if you do this,
then the tax gets multiplied by the quantity of the product - even if the tax rule is a 'tax per bill'

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10365
  • VirtueMart Version: 3+
Re: Please Help - Trying to create a 1-time fee based upon a category
« Reply #14 on: March 04, 2012, 20:18:15 pm »
I have tried it many ways and cannot get it to work the way you want.

Why not have the setup fee as a product?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)