Hello! Thanks for this amazing module, it looks like it should do exactly what i need, but here's my problem:

I have implemented the this module along with the node published module in order to only publish nodes that have been purchased via node checkout.

I also implemented the UC checkout tweaks module to convert the 'Other" payment method to be called "Pay Later - trusted advertiser". I installed this module and created a certain role for Trusted Advertiser, and went to edit the predicate for the Payment via Other CA and added the condition:
Condition: Check the user's roles
checked "trusted advertiser role"
made sure was enabled.

I then granted my test account the Trusted Advertiser role and tested checking out a node checkout node and this payment method showed up! Great! but...

after successfully checkout the node wasn't published. This was tested as working with other payment methods.

to attempt to fix this, i went to CA and edited the Publish node on full payment CA predicate which I now understand came with this module...
This condition already exists:
Condition: Check the order balance
"Balance is less than or equal to $0.00." is checked

so i changed the operator to OR and added these:
Check the payment method
checked "Other"

Check the user's roles
checked "trusted advertiser"

I then tested checkout with the trusted advertiser role test user and got the same results.
I double checked the predicate it the database and it looks like the conditions were added correctly.

Is it possible that Ubercart Conditional Payment or Node Published are not compatible with UC Node Checkout Schduler? My main suspicion is that this is down to the Conditional Action for "Publish node on full payment " is somehow not paying attention to the added condition's i've added and not performing actions on Other payment method because the balance isn't 0 when paying with that method.

has anyone experienced this? Do you have any advice or questions that could help me configure this better, or do you agree that this is some sort of bug?

Thanks for any response!

and my apologies, but i'm posting in the issue queue for both the Node Published and the Ubercart Conditional Payment as well because I'm not sure which the issue lies with.

Comments

SchwebDesign’s picture

Title: not working for me- special case with UC Conditional Payments & UC Node Published modules » not working for me - incompatible with node published module?

**BEGIN EDIT: update: it looks like the "Publish node on full payment" predicate comes from the uc_node_checkout_scheduler module which i also have installed. I've posted this issue there as well for advice...

http://drupal.org/node/1180236

it creates the "Action: Set Node Publish and Unpublish Dates"
which is to "Update the node status to Published."
but doesn't for me as per the above issue and conditions i've added.
**END EDIT:

alright, after some time going through the code here's what i did and it seems to be working for me.

I believe this was happening because of the Node Published module actually, and the CA predicate i was trying to modify didn't actually do any publishing of the node upon checkout (thus i believe the name of the action "Update the node status to Published" is misleading, at least not in the context of initial checkout of the node checkout node(?), but i might not be completely understanding the big picture here)

In uc_node_published.module from the Node Published module, i edited the uc_node_published_order function as follows, which accomplishes what i initially wanted to do.

Around line 143

function uc_node_published_order($op, &$arg1, $arg2) {
  switch ($op) {
    case 'update':

/*			if ($uid = 1)  {  //added by SchwebDesign
				dargs(); //added by SchwebDesign
			} //added by SchwebDesign
*/
     // BEFORE SchwebDesign EDIT:  if ($arg2 == 'completed') {
      if (($arg2 == 'completed') || ($arg2 != 'completed' && $arg1->payment_method == 'other')) {    //AFTER SchwebDesign Edit
        foreach ($arg1->products as $item) {
          $node = node_load($item->data['node_checkout_nid']);
          $types = array_keys(uc_node_checkout_product_map());

          // Make sure we only affect uc_node_checkout related items.
          if (in_array($node->type, $types)) {
            // Publish the node.
            $node->status = 1;
            node_save($node);

            watchdog(
              'uc_node_published', 'Set @type %title to published.',
              array(
                '@type' => node_get_types('name', $node),
                '%title' => $node->title,
              )
            );
          }
        }
      }

If anyone has any advice on a better way to do this, that would be greatly appreciated. Otherwise, i hope this helps somebody.

SchwebDesign’s picture

Title: not working for me - incompatible with node published module? » not working for me- special case with UC Conditional Payments & UC Node Published modules
Status: Active » Needs work
NewZeal’s picture

Title: not working for me - incompatible with node published module? » not working for me- special case with UC Conditional Payments & UC Node Published modules
Status: Needs work » Needs review

I don't think this is a compatibility problem. Try creating a conditional action that publishes the node on checkout complete when using the "other" payment method. I have done a similar thing to create a free promotional product.

The "other" payment method does not use a payment gateway so the payment received trigger does not occur.

Having said that, the publish node action does not appear in the conditional actions options for some reason. Not sure why. Will have to look into that.