Zen Cart Logo
Forums / Bug Reports / [INPROGRESS CHANGE-196] Store pickup Tax all who pick up

[INPROGRESS CHANGE-196] Store pickup Tax all who pick up

Views: 2,792

Results 1 to 11 of 11
11 Jan 2011, 8:00 PM
#1
shortysclimbin avatar

shortysclimbin

New Zenner

Join Date:
Oct 2010
Location:
San Juan Puerto Rico
Posts:
62
Plugin Contributions:
0

[INPROGRESS CHANGE-196] Store pickup Tax all who pick up

Guys,

I was able to fix some of my tax issues by properly addressing some zones, but now If I have a customer who lives in say FL want to drive in and pick up a product it does not charge them tax unless they are from VT!

Under the store pickup module it displays

"Tax Basis
On what basis is Shipping Tax calculated. Options are
Shipping - Based on customers Shipping Address
Billing Based on customers Billing address
Store - Based on Store address if Billing/Shipping Zone equals Store zone"

Shipping
Billing

But then it only displays two options???? Any way to fix this?

11 Jan 2011, 8:32 PM
#2
shortysclimbin avatar

shortysclimbin

New Zenner

Join Date:
Oct 2010
Location:
San Juan Puerto Rico
Posts:
62
Plugin Contributions:
0

Re: [INPROGRESS CHANGE-196] Store pickup Tax all who pick up

Looks like others in the past have had this same issue...

I tried this

http://www.zen-cart.com/forum/showthread.php?t=65454

" In Config-> My Store,

I have "Basis of Product Tax" set to "STORE" and it calculates on pick ups at the rate where the store is.

For the tax zone on the shipping module you have here, I'd say to calculate on Store Zone IF the shipping/billing zone equals the store zone. That way, whichever address is in CT and it is a store pick-up, the tax should calculate. It works in mine and I have it set up this way.

Hope this helps what you want to do."

But no dice.

13 Jan 2011, 11:56 AM
#3
shortysclimbin avatar

shortysclimbin

New Zenner

Join Date:
Oct 2010
Location:
San Juan Puerto Rico
Posts:
62
Plugin Contributions:
0

Re: [INPROGRESS CHANGE-196] Store pickup Tax all who pick up

Still looking no dice. Anyone have any ideas?

13 Jan 2011, 6:05 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [INPROGRESS CHANGE-196] Store pickup Tax all who pick up

One thing you can try, and you really need to test this well as I have not tested it under all conditions ...

Customize the order.php class file and around line 434, change the code to read:

if (stristr($_SESSION['shipping']['id'], 'storepickup') == TRUE) {
      $taxRates = zen_get_multiple_tax_rates($products[$i]['tax_class_id'], STORE_COUNTRY, STORE_ZONE);
} else {
      $taxRates = zen_get_multiple_tax_rates($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']);
}

What this should do is when the Shipping Module for Store Pickup is selected it will use the Store Address for the Taxes ...

But check that this method does not cause issues on anything else regarding taxes ...

13 Jan 2011, 8:17 PM
#5
shortysclimbin avatar

shortysclimbin

New Zenner

Join Date:
Oct 2010
Location:
San Juan Puerto Rico
Posts:
62
Plugin Contributions:
0

Re: [INPROGRESS CHANGE-196] Store pickup Tax all who pick up

ajeh thanks,

I did try what you mentioned, but I am slightly lost. Excuse my lower level of PHP knowledge, But can you do an if then statement nested in an array?

If so thats what I think we would want to do or make another function outside of the array that determines Tax.

In the Array starting on line 434 as shouldn't you change the value on line 437 'tax' => To what ever value you require? In this case setting tax class to store address when picking up. I am not very fluent with PHP coding since I come from a plc and assembly background. Any help would be great. I am going to do some more testing.

I am shocked this is not already done in ZC though..

13 Jan 2011, 8:21 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [INPROGRESS CHANGE-196] Store pickup Tax all who pick up

The original line is:

      $taxRates = zen_get_multiple_tax_rates($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']);

that is being replaces with the IF that I posted ...

Test and see if this works for you and if so, then you can customize if further or build a function or what have you for changing the code ...

13 Jan 2011, 9:03 PM
#7
shortysclimbin avatar

shortysclimbin

New Zenner

Join Date:
Oct 2010
Location:
San Juan Puerto Rico
Posts:
62
Plugin Contributions:
0

Re: [INPROGRESS CHANGE-196] Store pickup Tax all who pick up

ok perfect. I just updated it as you stated and I am now testing it. thanks again.

15 Nov 2011, 8:50 PM
#8
numinix avatar

numinix

Totally Zenned

Join Date:
Apr 2007
Location:
Vancouver, Canada
Posts:
1,567
Plugin Contributions:
58

Re: [INPROGRESS CHANGE-196] Store pickup Tax all who pick up

Ajeh, I see the tax being shown in the order total section, but it isn't being added to the order total...

Your Total $19.99
Sub-Total:

  $0.00
 Store Pickup (Walk In):


  $2.00
 Washington DC Alcohol Sales Tax - 10%:


  $19.99
 Total:
15 Nov 2011, 9:14 PM
#9
numinix avatar

numinix

Totally Zenned

Join Date:
Apr 2007
Location:
Vancouver, Canada
Posts:
1,567
Plugin Contributions:
58

Re: [INPROGRESS CHANGE-196] Store pickup Tax all who pick up

Here is the correct code:

      // modified to use store address for tax calculation IF shipping method is store pick-up
      $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                      'name' => $products[$i]['name'],
                                      'model' => $products[$i]['model'],
                                      'tax_groups'=>$taxRates,
                                      'tax_description' => zen_get_tax_description($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']),
                                      'price' => $products[$i]['price'],
                                      'final_price' => $products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']),
                                      'onetime_charges' => $_SESSION['cart']->attributes_price_onetime_charges($products[$i]['id'], $products[$i]['quantity']),
                                      'weight' => $products[$i]['weight'],
                                      'products_priced_by_attribute' => $products[$i]['products_priced_by_attribute'],
                                      'product_is_free' => $products[$i]['product_is_free'],
                                      'products_discount_type' => $products[$i]['products_discount_type'],
                                      'products_discount_type_from' => $products[$i]['products_discount_type_from'],
                                      'id' => $products[$i]['id'],
                                      'rowClass' => $rowClass);
                                      
      
      if (STORE_PRODUCT_TAX_BASIS == 'Shipping' && stristr($_SESSION['shipping']['id'], 'storepickup') == TRUE) {
        $taxRates = zen_get_multiple_tax_rates($products[$i]['tax_class_id'], STORE_COUNTRY, STORE_ZONE);
        $this->products[$index]['tax'] = zen_get_tax_rate($products[$i]['tax_class_id'], STORE_COUNTRY, STORE_ZONE);
      } else {
        $taxRates = zen_get_multiple_tax_rates($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']);
        $this->products[$index]['tax'] = zen_get_tax_rate($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']);
      }
      //end modified code
```Notice that I first check to make sure the tax basis is set to "shipping" (so it will not disrupt stores that want to charge tax on billing).  Second, the STORE_COUNTRY and STORE_ZONE need to be added to the $this->products[$index] array.
26 Oct 2012, 3:38 AM
#10
cjmarley avatar

cjmarley

Zen Follower

Join Date:
May 2004
Posts:
96
Plugin Contributions:
2

Re: [INPROGRESS CHANGE-196] Store pickup Tax all who pick up

Do you have an update to this code for the newer version of the cart? I've got a cart I've been working on that wants the same thing. Store pick-ups should be taxed regardless of where they live. The code above did not change anything.