Hello,
My situation is, when a customer adds a quantity of four or more to a product, I want to set a discount of $40 off the price of that product. I have setup up a discount conditions and actions to do this (see discount1.JPG attachment) but whenever I add that product and change the quantity to four it never adds the discount onto it. Also whenever I add a product to the shopping cart, no matter if I have set up a discount for it or not, the shopping cart gives me this error, "warning: Invalid argument supplied for foreach() in /home/inst5969/public_html/modules/uc_discounts/uc_discounts.module on line 309." (see discount2.jpg attachment).

Any help would be greatly appreciated!
Thanks in advance.
Stephen

CommentFileSizeAuthor
discount2.JPG31.03 KBsmschwindt
discount1.JPG52.48 KBsmschwindt
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cakka’s picture

Ehmm... i am getting same trouble...
The discount not affected the product price.

I have setting the discount. I have submit some products to discount.
But the discount not run anyway.

Any ideas ?

Thanks

cakka’s picture

Helloo, are there any one that have the same problem and know about the solution ?
Thanks

cakka’s picture

Any ideas ? Thanks

smschwindt’s picture

Status: Active » Closed (fixed)
rkeppner’s picture

Status: Closed (fixed) » Needs review

For some reason, this just cropped up on one of my sites using uc_discounts. I don't have time to track down what's being passed in at the moment, since the discounts aren't being actively used right now. (They get used heavily for a few weeks a year, surrounding a conference event.)

I got around the problem by changing this (starting at line 309):


foreach($node->discounts as $discount) {
  $discounts_amount += $discount['amount'];
}

to this:


if (property_exists($node, 'discounts')) {
  foreach((array)$node->discounts as $discount) {
    $discounts_amount += $discount['amount'];
  }
}

I'd roll a patch for it, but it looks like the module isn't being maintained. Let me know if someone actually wants one.

smschwindt’s picture

Status: Needs review » Closed (fixed)