Author Topic: Modification to the way ps_checkout->calc_order_taxable function works  (Read 17384 times)

Anthony C.

  • Jr. Member
  • **
  • Posts: 286
Re: Modification to the way ps_checkout->calc_order_taxable function works
« Reply #15 on: March 15, 2007, 04:36:59 am »
Hi Brian,

If more people agree that your mod is useful, I hope soreen can see it and put it into the next version.

However, i think there are other issues related to other functions. I am not sure why people don't want this badly. I think it is important in a shopping cart.

Anyhow, I will try your hack. I will report to you what I did.

Cheers,

Anthony
---------------------------------
Update...

I realized that the one I said was wrong..   You are right. The logic seems not working.
hum..  I think radio buttom should be working.. 
Let me try it..
Hope i can get it to work... 
I still have house chores to do .....  @@


Anthony C.

  • Jr. Member
  • **
  • Posts: 286
Re: Modification to the way ps_checkout->calc_order_taxable function works
« Reply #16 on: March 15, 2007, 05:14:27 am »
Hi Brian,

It works partially..@@
Only works if the order from local users who have to pay the tax..
We don't charge tax on international order. The result is that the shipping method are gone!!..@@

did you modify any other places?

Anthony

BrianCockle

  • Beginner
  • *
  • Posts: 20
Re: Modification to the way ps_checkout->calc_order_taxable function works
« Reply #17 on: March 15, 2007, 05:54:13 am »
Quote
It works partially..@@
Only works if the order from local users who have to pay the tax..
That is what the mod is designed to do: Allow you to charge sales tax on certain items shipped to customers in the same state.  Anyone outside the state will not be charged sales tax.
Quote
We don't charge tax on international order.
I don't ship internationally, so I haven't tried it, but I wouldn't anticipate it to charge a tax on it.
Quote
The result is that the shipping method are gone!!..@@
did you modify any other places?
Do you have weights setup in your product definitions (since this is what the the real-time shipping calculators use)?

Anthony C.

  • Jr. Member
  • **
  • Posts: 286
Re: Modification to the way ps_checkout->calc_order_taxable function works
« Reply #18 on: March 15, 2007, 07:49:52 am »
yes I do have weight setup for calculation...

The problem happens when I enable the the field.... so weird..
if i make the product_taxable = Y, then the International shipping method will display.

any idea what may cause this result?

Thanks,

Anthony
------------------------------------------
update:

my bad..
i forgot to setup more shipping rate to allow heavier weight.

@@ stupid me ....

Anthony C.

  • Jr. Member
  • **
  • Posts: 286
Re: Modification to the way ps_checkout->calc_order_taxable function works
« Reply #19 on: March 15, 2007, 17:21:13 pm »
Hi Brian,

Actually, your mod is working now.
However, I added two steps when adding to my site

1. input the Y value to every product's product_taxable (so it makes everyone to be taxable as default)

2. change your code in product.product.form to
     <tr>
        <td>
           <div style="text-align:right;font-weight:bold;">
           <?php echo $VM_LANG->_PHPSHOP_PRODUCT_FORM_TAXABLE ?>:</div>
        </td>
        <td>
          <?php if ($db->sf("product_taxable")=="Y")
        {
         echo "Yes<input type=\"radio\" name=\"product_taxable\" value=\"Y\" checked=\"checked\" />";
         echo "No<input type=\"radio\" name=\"product_taxable\" value=\"N\" />";
               }
             else {
          echo "Yes<input type=\"radio\" name=\"product_taxable\" value=\"Y\" />";
         echo "No<input type=\"radio\" name=\"product_taxable\" value=\"N\" checked=\"checked\" />";
               }
          ?>
       </td>
    </tr>

This logic works better than checkbox because checkbox has 2 variables in one field.

Thank you,

Anthony

BrianCockle

  • Beginner
  • *
  • Posts: 20
Re: Modification to the way ps_checkout->calc_orde
« Reply #20 on: March 15, 2007, 17:27:33 pm »
Cool.  Great idea on using the radio box.

Eric Tischler

  • Beginner
  • *
  • Posts: 20
Re: Modification to the way ps_checkout->calc_orde
« Reply #21 on: July 01, 2007, 20:27:37 pm »
Send the latest version to the virtuemart team and get them to build it into the component permanently. this is a very important mod.

unleash.it

  • Jr. Member
  • **
  • Posts: 150
Re: Modification to the way ps_checkout->calc_order_taxable function works
« Reply #22 on: January 17, 2008, 08:17:02 am »
This patch was a matter of life and death for me. Can they please include it?

Here's an update I made to work with VM 1.1 beta 2 build 1142. Language strings have changed and code has moved around. But unless you have that particular build, I recommend reading the text file and implementing the changes one by one instead of overwriting your files with mine. If anyone finds a problem let me know and I'll try to fix, but it's working great with my set up.

[attachment cleanup by admin]

alanna

  • Beginner
  • *
  • Posts: 3
Re: Modification to the way ps_checkout->calc_order_taxable function works
« Reply #23 on: March 28, 2008, 00:06:44 am »
hi,

i'm trying to get this to work with Joomla! 1.0.15 and VirtueMart 1.0.14. I've followed all the steps you outline in the read me file, but run into issues after pasting the code for ps_checkout.php.

I get this error message when I replace the for loop in ps_checkout.php:

Fatal error: Call to a member function convert() on a non-object in *********************************************/shop/administrator/components/com_virtuemart/classes/ps_checkout.php on line 1169

everything else seems to work, but not this.

any thoughts on how to get this to work?

thanks!

alanna

BrianCockle

  • Beginner
  • *
  • Posts: 20
Re: Modification to the way ps_checkout->calc_order_taxable function works
« Reply #24 on: April 17, 2008, 08:52:35 am »
Hi Alanna,

Sorry, I haven't hopped on the forums in a while and for some reason missed the topic notification e-mail on this.  Were you able to get it to work?  At the moment the only thing I could suggest would be to check and make sure the function adds and updates in ps_product.php are correct.

Otherwise I'm glad to see it has been working for people and that some have even made a few updates on it!