Still looking no dice. Anyone have any ideas?
Still looking no dice. Anyone have any ideas?
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:
What this should do is when the Shipping Module for Store Pickup is selected it will use the Store Address for the Taxes ...Code: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']); }
But check that this method does not cause issues on anything else regarding taxes ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
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..
The original line is:
that is being replaces with the IF that I posted ...Code:$taxRates = zen_get_multiple_tax_rates($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']);
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 ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
ok perfect. I just updated it as you stated and I am now testing it. thanks again.
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:
Here is the correct 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.PHP 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