nicolas wrote: Well, yes and no. The shipping plugins extend the hikashopShippingPlugin class.
The code which checks the weight comes from that class hikashopShippingPlugin so the code is not directly in the plugins.
This class is defined in the file administrator/components/com_hikashop/helpers/shippingplugin.php so that's where you want to look.
The code is in the function onShippingDisplay. You will be able to use it quite easily in the global cart fee plugin code.
For the zone, the simplest is to get the current zone id with the function hikashop_getZone(). Then, you can just check it against the id of the colorado state zone you can get from System>Zones.
I did just a quick down and dirty change, which looks to be working. I replaced the last line of code with the code below. As a feature request, it would be nice to provide a more flexible plugin by allowing the user to restrict by a selected zone and if only for orders with shipping.
$physicalProduct = false;
foreach($cart->products as $product) {
if (isset($product->product_weight) && $product->product_weight > 0) {
$physicalProduct = true;
break;
}
}
if ($physicalProduct && $cart->shipping_address->address_state[0] == 'state_Colorado_4266') {
$cart->additional['global_cart_fee_'.$plugin] = $additional;
}