Hello,
We just developed it and will add it through the next Hikashop version, but if you want it now, you'll have to edit the file :
- administrator\components\com_hikashop\classes\shipping.php" and change these lines
case 'product_excluded':
$value = 'X_PRODUCTS_ARE_NOT_SHIPPABLE_TO_YOU';
break;
default:
$value = $key;
break;
}
By
default:
$value = $key;
break;
}
}elseif(is_string($value)) {
$number = $value;
$value = $key;
- administrator\components\com_hikashop\helpers\helper.php" and change these lines
$price = 0;
foreach($order->products as $k => $row) {
if(!empty($rate->products) && !in_array($row->product_id, $rate->products))
continue;
if(isset($rate_prices['products'][$row->product_id])) {
$price += $rate_prices['products'][$row->product_id];
$rate_prices['products'][$row->product_id] = 0;
} elseif(isset($rate_prices['products'][$row->product_parent_id])) {
$price += $rate_prices['products'][$row->product_parent_id];
$rate_prices['products'][$row->product_parent_id] = 0;
} elseif(!isset($rate->shipping_params->shipping_virtual_included) || $rate->shipping_params->shipping_virtual_included || $row->product_weight > 0) {
$price += $rate_prices['price'] * $row->cart_product_quantity;
}
}
if($price > 0) {
if(!isset($rate->shipping_price_base))
$rate->shipping_price_base = hikashop_toFloat($rate->shipping_price);
else
$rate->shipping_price = $rate->shipping_price_base;
$rate->shipping_price = $currencyClass->round($rate->shipping_price + $price, $currencyClass->getRounding($rate->shipping_currency_id, true));
}
if($price < 0) {
if(!isset($rate->errors['product_excluded']))
$rate->errors['product_excluded'] = 0;
$rate->errors['product_excluded']++;
}
By
$price = 0;
$rate_prices['products']['product_names'] = array();
foreach($order->products as $k => $row) {
if(!empty($rate->products) && !in_array($row->product_id, $rate->products))
continue;
if(isset($rate_prices['products'][$row->product_id])) {
$price += $rate_prices['products'][$row->product_id];
if($rate_prices['products'][$row->product_id] < 0)
$rate_prices['products']['product_names'][] = '"' . $row->product_name . '"';
$rate_prices['products'][$row->product_id] = 0;
} elseif(isset($rate_prices['products'][$row->product_parent_id])) {
$price += $rate_prices['products'][$row->product_parent_id];
$rate_prices['products'][$row->product_parent_id] = 0;
} elseif(!isset($rate->shipping_params->shipping_virtual_included) || $rate->shipping_params->shipping_virtual_included || $row->product_weight > 0) {
$price += $rate_prices['price'] * $row->cart_product_quantity;
}
}
if($price > 0) {
if(!isset($rate->shipping_price_base))
$rate->shipping_price_base = hikashop_toFloat($rate->shipping_price);
else
$rate->shipping_price = $rate->shipping_price_base;
$rate->shipping_price = $currencyClass->round($rate->shipping_price + $price, $currencyClass->getRounding($rate->shipping_currency_id, true));
}
if($price < 0) {
$rate->errors['X_PRODUCTS_ARE_NOT_SHIPPABLE_TO_YOU'] = implode($rate_prices['products']['product_names'], ', ');
}
- Edit your translation file and change that line
X_PRODUCTS_ARE_NOT_SHIPPABLE_TO_YOU="There are %s items in your cart which we cannot ship to you"
By
X_PRODUCTS_ARE_NOT_SHIPPABLE_TO_YOU="The %s item(s) in your cart cannot be shipped to you"