VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: rustle on March 01, 2012, 17:44:19 PM

Title: Please Help - Trying to create a 1-time fee based upon a category
Post by: rustle on March 01, 2012, 17:44:19 PM
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]
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: PRO on March 01, 2012, 21:08:18 PM
have you tried the "tax per bill"
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: rustle 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
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: PRO on March 02, 2012, 01:07:02 AM
Quote from: rustle on March 01, 2012, 21:38:10 PM
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.
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: rustle 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.
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: PRO on March 02, 2012, 12:59:32 PM
default_pricelist

views/cart/tmpl
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: rustle 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.)
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: PRO 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.
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: rustle 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.
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: rustle 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
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: PRO 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.
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: rustle 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]
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: PRO on March 04, 2012, 19:25:34 PM
have you tried to go into the actual products and apply the rules to the products?

Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: rustle 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'
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: PRO 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?
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: rustle on March 04, 2012, 20:29:14 PM
This is what I have done in the mean time

I am kinda of frustrated because on the main reasons we went down the VM route is because we believed that this functionality was possible
We want to mandate this fee, not expect our users to apply it

I'm sure you understand

My client really wants this accomplished and we are 99% complete the working site..

With your wealth of VM experience,
how would you recommend I proceed to get this accomplished

Should I report this as a bug?

or try to find custom development? (this won't help other people though)
I'm sure I won't be the last to request this functionality, in fact I know this, as people have PM me through this post about this issue

Thank you for your time to date
Title: Re: Please Help - Trying to create a 1-time fee based upon a category
Post by: PRO on March 04, 2012, 20:39:38 PM
This is not bug.
It can be done via a 3rd party plugin.

It can also be done via the payment modules. With a little coding to check the category, and apply the fee.