Hi I am using Joomla 3.4.1, and VM 3.0.8
The default tax calculation rules are working on the products themselves - but not on the shipping (using Shipment Method: weight_countries)
I have selected the 'use default rules' in the dropdown
if I select a specific tax rule the tax calculates correctly for the shipping for that one specific rule - but I ship all over & need to calculate tax accordingly
is there any way to get the Shipment Method: weight_countries to use the default tax rules?
thank you!
as u saw the ship method only takes one tax rule "statically"
I assume you need to clone the ship method for each country etc .. and filter by the same filters as the rule
thanks for your suggestion
unfortunately it is by state / province that I need the rules to apply so cloning by country does no good.
so you are saying that the shipping module does not work with default rules?
why would they make that an option then?
well here's a funny thing
in the weight ship plugin weight_countries.php VM3.0.8
the function plgVmOnProductDisplayShipment() (which I assume is the annoying ship cost that everyone switches off on the product details) doesn't use the plugin configured tax id at all
it takes what ever vat tax is currently used on the prices
Quoteif(isset($product->prices['VatTax']) and count($product->prices['VatTax'])>0){
reset($product->prices['VatTax']);
$rule = current($product->prices['VatTax']);
if(isset($rule[1])){
$product->prices['shipmentTax'] = $product->prices['shipmentPrice'] * $rule[1]/100.0;
$product->prices['shipmentPrice'] = $product->prices['shipmentPrice'] * (1 + $rule[1]/100.0);
}
}
where as the getCosts() function (used in the cart I think) doesn't factor in tax at all
complete function
Quotefunction getCosts (VirtueMartCart $cart, $method, $cart_prices) {
if ($method->free_shipment && $cart_prices['salesPrice'] >= $method->free_shipment) {
return 0.0;
} else {
return $method->shipment_cost + $method->package_fee;
}
}
the only place I can find the configured tax id used (the one selected in the plugin) is in the plgVmConfirmedOrder() function
used when the order is stored
Quote$values['tax_id'] = $method->tax_id;
$this->storePSPluginInternalData ($values);
and in the admin order display getOrderShipmentHtml()
Quote$tax = ShopFunctions::getTaxByID ($shipinfo->tax_id);
$taxDisplay = is_array ($tax) ? $tax['calc_value'] . ' ' . $tax['calc_value_mathop'] : $shipinfo->tax_id;
$taxDisplay = ($taxDisplay == -1) ? vmText::_ ('COM_VIRTUEMART_PRODUCT_TAX_NONE') : $taxDisplay;
all very odd... have u checked if the shipping display on the productdetails is correct if an address is given?
Quotehave u checked if the shipping display on the productdetails is correct if an address is given?
I just turned on the shipping display on the product details page, the basic shipping is displaying correctly, but no mention of tax (tried both the default rule & a static rule which is working in the cart)
* I have modified the product details page to not show taxes / discounts etc on the product pricing, not sure if that would effect the shipping pricing as well
Quote* I have modified the product details page to not show taxes / discounts etc on the product pricing, not sure if that would effect the shipping pricing as well
it tries to get the tax rate from the $product->prices['VatTax']
you can echo that out in the details and see if set
print 'Debug Line '.__LINE__.' $product->prices[VatTax] <pre>'; print_r ($product->prices['VatTax']); print "</pre><br />\n";
I ran that on the default_showprices file and got a result
Debug Line 43 $product->prices[VatTax]
1
is that the page you meant for me to enter it on?
what does '1' mean?
oops - should be
print 'Debug Line '.__LINE__.' $this->product->prices[VatTax] <pre>'; print_r ($this->product->prices['VatTax']); print "</pre><br />\n";
should be the tax applied
[VatTax] => Array
(
[1] => Array
(
- => Tax
[1] => 20.0000
[2] => +%
[3] => 0
[4] => 47
[5] =>
[6] => 1
[7] => 1
)
)
in this case $product->prices['shipmentTax'] = $product->prices['shipmentPrice'] * $rule[1]/100.0;
from above $rule[1] would be 20.0000