OK guys, after fiddling with the codes, I finally got it.
So, anyone who needs to have the funtion required on ur ZC like me, here are the codes:
At the includes/modules/shipping/perweightunit.php, at around line 93, you will find this:
Code:
function quote($method = '') {
global $order, $shipping_weight;
$total_weight_units = $shipping_weight;
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_WAY,
'cost' => (MODULE_SHIPPING_PERWEIGHTUNIT_COST * $total_weight_units)
+ MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING)));
From the codes above, find:
Code:
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_WAY,
'cost' => (MODULE_SHIPPING_PERWEIGHTUNIT_COST * $total_weight_units)
+ MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING)));
and replace with:
Code:
//note that the "1" in the line below is the minimum weight for the shipping charge. Anything weighing below 1, e.g 0.5 the shipping will still be charged as for 1
if ($total_weight_units < 1) {
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_WAY,
'cost' => (MODULE_SHIPPING_PERWEIGHTUNIT_COST * 1)
+ MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING)));
} else {
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_WAY,
'cost' => (MODULE_SHIPPING_PERWEIGHTUNIT_COST * $total_weight_units)
+ MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING)));
}
Thanks for reading
Bookmarks