I was getting various errors using uc_discounts for multiple products:

implode() [function.implode]: Bad arguments. in /home/vhosts/sportsmens/site/modules/uc_discounts/discounts/uc_discounts_multi_product.module on line 76.

and
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY title' at line 1 query: SELECT n.nid,n.title FROM uc_products p LEFT JOIN node n ON n.nid=p.nid WHERE p.nid IN () ORDER BY title in /home/vhosts/sportsmens/site/includes/database.mysql.inc on line 174.

and
in_array() [function.in-array]: Wrong datatype for second argument in /home/vhosts/sportsmens/site/modules/uc_discounts/discounts/uc_discounts_multi_product.module on line 46.

Turns out item_id field in both uc_discount_actions and uc_discounts_actions was a varchar 255 so if you have enough products in the discount category you'll end up truncating these data and blow up your discounts.

the fix?

Simple change those two fields to 'text' or some other longer format depending on your database.

whew!

cheers

-zachary of the Sportsmenscannery.com

Comments

Status: Fixed » Closed (fixed)

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

Scott M. Sanders’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Closed (fixed) » Active

Wow, this still needs fixed. Thanks for that tip though!