Points not being added on purchase
glennnz - July 9, 2009 - 10:57
| Project: | Ubercart Userpoints |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi
Fantastic module!
Currently points are not being added when a product i purchased. Buying with and discounting with points works great, but users are not earning any.
Thanks
Glenn

#1
same here ! , :(
#2
1.function uc_userpoints_product_feature_form()
$form['nid'] = array(
'#type' => 'value',
'#value' => $nid, // not $node->nid
);
2. function uc_userpoints_product_feature_form_submit()
select pfid from {uc_product_features} where nid = %d and fid = %d",$data['nid'],$data['fid']
// table name is not 'uc_userpoints_products'
try it again.
#3
Nope, no joy.
Thanks.
Glenn
#4
same here
#5
same here .... I am looking out to sell points to users ..... like 1 Product ... $1 .... 1Point ... In Product features :: On product purchase give 1 point ..... Tested the same by checking out ..... no points added
#6
Solved now @ #595890.
#7
Getting this error message when saving edit at product => features => operations , put points to 3 and set category as above commit link.
I have run cron.php / update.php / flushed cache but no fix. Also tested on fresh install of Drupal and same error.
Anyone else experiencing this issue?
user warning: Unknown column 'tid' in 'field list' query: UPDATE uc_userpoints_products SET points = 3, tid= 0 WHERE nid = 16 AND pfid = 1 in /home/example/public_html/drupal/sites/all/modules/userpoints_ubercart/uc_userpoints_product.module on line 137.
#8
See my reply @ http://drupal.org/node/595890#comment-2193404
#9
For me, points are still not being added upon purchase of a product. I'm using the latest dev version and have done a complete re-install of the module. No luck. Using Ubercart 6.x-2.0 and Userpoints 6.x-1.1.
#10
Nevermind, I got this to work. But, after looking at the code, there are several problems. The most obvious is the improper usage of the t() function.
For example, this line:
'description' => t('A user purchased \''. l($product->title, drupal_get_path_alias('node/' . $product->nid)) .'\' containing ' .$productPoints.' '. variable_get(USERPOINTS_TRANS_LCPOINTS, 'points')),should be:
'description' => t('A user purchased !product containing !amount !points.', array('!product' => l($product->title, 'node/' . $product->nid), '!amount' => $productPoints, '!points' => userpoints_translation())),Note that you don't have to call drupal_get_path_alias(). The alias will be used automatically. Also, tabs should not be used. Use 2 spaces instead. Anyway, these are separate issues.
#11
@jtsnow: commited, thanks
#12
The problem i now have, is the problem that i can say that a product is worth 10 points .
but if i look back after saving the points are 0 again. in the DB the SQL table stays empty.
What is the problem with this ;)
#13
See my reply @ http://drupal.org/node/595890#comment-2193404
#14
Automatically closed -- issue fixed for 2 weeks with no activity.