Hi there,
I have this function that is working out the carriage cost based on a previous function (the amount/value of products in the checkout). Basically I’m saying if the basket value is over £100 then offer £0.00 carriage else work it out as normal.
[php]function carriage_cost($cartID) {
$this->db->select(‘SUM(p.carriage*sc.quantity) AS total’,FALSE);
$this->db->join(‘products AS p’, ‘sc.product_id = p.product_id’);
$this->db->where(‘sc.cart_id’,$cartID);
$query = $this->db->get(‘shopping_cart AS sc’);
$query->row(‘total’);
//echo $this->db->last_query();
if ($this->get_cart_total($cartID) < “100”)
{
return $query->row(‘total’);
}
else
{
return “0.00”;
}
}[/php]
This works fine however I want to cap this also at 250. so free carraige applies to basket values of between 100 & 250. (the reason for this is because it’s extremely difficult to sort the products it actually applies to) I’ve tried;
[php]if ($this->get_cart_total($cartID) >“100” && $this->get_cart_total($cartID) <“250”;
{
return “0.00”;
}
else
{
return $query->row(‘total’)"
}[/php]
But seem to be getting a line error; I’m not sure if this format is possible??