jdw_id wrote:
i found another problem with this minimum qty...
if i have options for that product....lets say red, green & blue...
the minimum qty for this product is 5...
i can't add to cart directly red (2), green (2), blue (1).... because it was block automaticaly..
what i do is, order red (5), green (2), blue (1).. and then go to shopping cart and edit red to 2...
and then check out succesfully...
maybe it's better if admin have option if this minimum per options, or minimum for total options...
here is the solution for my problem...
change line 310 until 322 with this..
Code: Select all
$product_total = 0;
$hasoption = false;
foreach ($this->session->data['cart'] as $key => $value) {
$product = explode(':', $key);
if ($product[0] == $this->request->post['product_id']) {
$product_total += $value;
$hasoption = true;
}
}
if ($product_info['minimum'] > ($product_total + $quantity)) {
if (!$hasoption) {
$json['error']['warning'] = sprintf($this->language->get('error_minimum'), $product_info['name'], $product_info['minimum']);
}
}
i only add hasoption variable... so now, it will bypass minimum checking if there is options on that product... and let the checkout check for the minimum order...