Hi, I am currently working on a ecommerce website and I was looking for a module allowing me to assign a price on a product according to a specified amount (2 € from 1 to 99, 1.5 € from 100 to 500 etc. ...).

The worry is that after install the quantity_discount module, but after that, the "?q=cart/view" page tell me : "warning: Invalid argument supplied for foreach () in [...] \ modules \ quantity_discount \ quantity_discount.module on line 418. "

After research it seems that on this famous line: foreach ($form["items"] as &$item)

$form["item"] seems not to be an array ??

thanks,

Martouff

ps: scuze my poor english !! (I'm french)

Comments

janusman’s picture

Status: Active » Fixed

Fixed; will post this soon.

For now you can just insert this before the foreach() in the .module file:

if(is_array($form["items"]))
foreach($form["items"] as &$item) {
[... rest of code ...]

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.