Administrator
- Join Date:
- Feb 2006
- Posts:
- 10,620
- Plugin Contributions:
- 212
Shipping Surcharge [Support Thread]
https://www.zen-cart.com/downloads.php?do=file&id=2308
Administrator
Zen Follower
Administrator
Totally Zenned
swguy:
Updated version 1.1 has weight and value thresholds in case you want to check those before imposing the surcharge.
Administrator
New Zenner
swguy:
This issue has been fixed in version 1.2, which is now available.
New Zenner
Administrator
Administrator
Zen Follower
Zen Follower
Zen Follower
pilou2:
Your second problem is due to the fact there is no tax applied but module try to calculate it anyway. Suppressing this line won't work if you want to apply some tax on the surcharge, which is probably the case if you already applied some tax everywhere else.
You can modify code as follow:
[PHP] if ($charge_it) {
$tax_address = zen_get_tax_locations();
$tax = zen_get_tax_rate(MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_TAX_CLASS, $tax_address['country_id'], $tax_address['zone_id']);
// calculate from flat fee or percentage
if (substr(MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_AMOUNT, -1) == '%') {
$shipping_surcharge = ($order->info['subtotal'] * ((float)MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_AMOUNT/100));
} else {
$shipping_surcharge = MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_AMOUNT;
}
$order->info['total'] += $shipping_surcharge;
if ($tax > 0) {
$tax_description = zen_get_tax_description(MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_TAX_CLASS, $tax_address['country_id'], $tax_address['zone_id']);
$order->info['tax'] += zen_calculate_tax($shipping_surcharge, $tax);
$order->info['tax_groups'][$tax_description] += zen_calculate_tax($shipping_surcharge, $tax);
$order->info['total'] += zen_calculate_tax($shipping_surcharge, $tax);
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$shipping_surcharge += zen_calculate_tax($shipping_surcharge, $tax);
}
}
$this->output[] = array('title' => $this->title . ':',
'text' => $currencies->format($shipping_surcharge, true, $order->info['currency'], $order->info['currency_value']),
'value' => $shipping_surcharge);
}[/PHP]
Zen Follower
Zen Follower
Zen Follower
Zen Follower
Zen Follower
Zen Follower
Zen Follower
pilou2:
Forgot the link:
https://www.zen-cart.com/downloads.php?do=file&id=2308
Zen Follower
njcyx:
Hi @pilou2, I just tried v2.0.0 and it worked great on my end. No warnings.
One small issue, but it doesn't bother me: "Tax Class" options still doesn't work. There is no change on the surcharge value, no matter Taxable Goods is selected or not. But anyway, I don't plan to surcharge the sales tax. I used the local sales tax module here.
Destination thread ID and reason are required when shown.
Tell staff why this post should be reviewed.
Required for login, security, and core site functionality.
Help us understand how the site is used so we can improve it.
Used for promotion and personalized campaign measurement.