I posted this earlier on ubercart's forums but I wanted to post here in case anyone here may have ran into the same thing.
here is the link: http://www.ubercart.org/forum/support/7234/userpoints_only_payment_method
here is the post - many thanks in advance for any ideas or advice ~
----------------------------------------------------------------
Hello all,
I am pretty new to drupal and have started looking into and playing with ubercart (great module btw!)
I am having some basic (or seems to be basic) problems using Ubercart with Userpoints.
My Goal: To allow authenticated users to add products and place a point value on each product so that other users can buy that product using their own points. There will never be real cash involved - all points.
My problems: a user can log in and add a product and assign a point value (Sell price) no problem. When another user logs in and tries to buy that product, they get this error after clickicking checkout:
"Checkout cannot be completed without any payment methods enabled. Please contact an administrator to resolve the issue."
After searching for this error, the thread that seemed to be closest to my problem was here:
Just like the OP, I have the mods enabled and my userpoints --> ubercart payment section shows points selected as the only method of payment. And when I saw bmagistro say:
"The only other thing I can think of that might be causing this is if the user doesn't have any points. Are your points being categorized? At present there is not support for that."
Both users (buyer and seller) have points so thats not it. I have tried it both with Uncategorized (default) points and also by adding a new category of points and assigning those points to each user and enabling that category to be the method of payment and still get the same error.
The only time I had any success was when I was logged in as administrator, I was able to buy the items with points and it went thru with no error! It also showed my points being deducted for the purchase. It did not, however, award the points to the user that put the item up for sale. not only does it not show anywhere the transaction that the user received his points for the sale, but also shows his point balance as the same before the sale took place. I have tried this test with Uncategorized points as well as with creating a new category as mentioned above.
i am not sure if the 2 problems are related or not, but i wanted to point that out in case it helped in figuring this out.
One last thing, that probably is not related, but I am using the hook_form_alter() to "hide" a few form fields on the add product page (sku, list_price and cost) since i do not need them currently.
Any help or advice would be much appreciated.
Thanks again!
Comments
update...
So I enabled Userpoints Reset and reset all the points and deleted the category to start from scratch.
I added 100 points to 2 users (User 1 & User 2) and then logged in as User 1 and added a product for 25 pts. Logged out and logged in as User 2 and bought the item and it worked with no error and subtracted the 25 points from User 2. It still did not give the 25 points to User 1, what am I missing here?
In addition, the product is still in the store for sale. How would I eliminate it after it is purchased?
Thanks again
Follow updates here:
Follow updates here: http://drupal.org/node/327567
Anyone able to do this successfully?
After my couple of posts and including the issue tracker post: http://drupal.org/node/327567 - I still cant get the points added to the seller's account. I wanted to find out if anyone is successfully accomplishing this?
A user puts an item up for sale (seller) for a certain amount of userpoints and another user buys the item (buyer) with their own userpoints. It correctly subtracts the points from the buyer but instead of awarding the points to the seller, it awards the points to my admin account (user/1). The database shows the UID of the seller in the appropriate place and not the admin but it still gives the points to the admin.
So, is anyone else accomplishing something like this with Userpoints + Ubercart?
Thanks in advance.
Doh
so, it appears the problem was on my end..sorry again bmagistro.
I disabled a custom module that I created to hide some fields in ubercart on the add product page and it worked.
The module was something I copied from code in the ubercart forums with me adding other fields I wanted to hide:
<?php
// $Id$
/**
* @file
* Module to hold my customizations to Ubercart
*/
/**
* Implementation of hook_form_alter()
*/
function my_module_form_alter($form_id, &$form) {
if ($form_id == 'product_node_form') {
//hide some fields
$form['base']['model'] = array('#type' => 'hidden');
$form['base']['prices']['list_price'] = array('#type' => 'hidden');
$form['base']['prices']['cost'] = array('#type' => 'hidden');
$form['base']['shippable'] = array('#type' => 'hidden');
$form['base']['weight'] = array('#type' => 'hidden');
}
}
I also tried re-enabling it after adding an extra line of code:
$form['base']['model']['#required'] = FALSE;
I thought the problem may have been that the product page was hiding the SKU (model) but since it was still marked as required, it was causing conflicts. But even with it set to false, it still doesn't work fort me. Maybe my code is wrong?
In any case, if I disable the above code it works as intended. I just have to figure out some tweaks for my own site.
Thanks again ~