I am working on a site with Pay-Per-Node and UberCart. I have two allowed content types, but the trouble is that it makes the user select which content types they want to create when they purchase the nodes. I need users to be able to purchase the nodes and be able to create nodes of both types. Is there a known way to do this?

Comments

giupenni’s picture

+1

maurizio.ganovelli’s picture

Assigned: Unassigned » maurizio.ganovelli
Status: Active » Postponed (maintainer needs more info)

Hi all, if you're still interested in this feature please describe an example use-case.

j2b’s picture

+1. My example of this featrue would be connected with different content types like adverts with extended information. E.g. Ads are for different objects with different description. And each advert would cost for potential buyer different amount. Still keeping in mind possibility to purchase several ads of one content type and several - of another.

I just stepped over this module and yet haven't tested it for now. Will do it in a fiew hours. For now, I was struggling with userpoints (still not the case I can use, as I have to categorize purchased points, which is not in full support now) and precreation exact content types upon UC purchase, after letting user to edit them. But none of my initial experiments are fully satisfied. This module would make things easier.

Additional info: (Sorry, I'll test module in a couple of hours) how does porcess is taken over, if user, who purchased availability to create, say, 3 nodes, reacts, if a user deletes one. Or this should be addressed via some custom coding, rules, or just do not allow to delete nodes?

j2b’s picture

Sorry, just noticed another issue to my last question: http://drupal.org/node/962928

j2b’s picture

I'd confirm, that using UC and PPN together does what is expected. The only thing I could not get is trigger function on order status change. But if I add update PPN data on Checkout, everything is working, including amount of purchased nodes.

How to trigger Order status update?

maurizio.ganovelli’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Hi j2b, ppn adds the "Update the user pay-per-node balance when order is completed" predicate, called by "Order status gets updated" trigger. You can configure this predicate using admin/store/ca/uc_paypernode_grant/edit page. I think this issue is similar to #1105546: Won't let user create purchased node.
Ad module integration has been removed from 2.x version: i think a possible clean solution is to create a "wrapper" content type around ad type, holding information about ad specific type (image, text etc..), ad channels, number of impressions or clicks etc... then let users create it through ppn.
I think a new module is needed to handle ad type and some changes to current ppn module code.

j2b’s picture

Hi, blackice78. Sorry, you are correct about the version. I am using 2.x-dev.

Yes, PPN does ad predicate. And I am aware of your noted issue, but there should be something I am missing, as I can not trigger this status. Currently I use Creditcard payments system with Test gateway. After completing an order, there is a checkout process, which runs smoothly, and order status gets set to "Completed". I could not find detailed information on UC order workflow processes in test environment. According to your mentioned issue, I tried to update as uid 1 order statuses in different ways and steps, but still could not trigger this event, to let PPN predicate run. For test purposes I moved it to When checkout is completed..., to prove, that PPN is working. And no issues there for now. That for me should be looked over again, as it would not be the case on prod environment.

Concerning Ad: I allready did it with custom content types, as my ads are very specific, and Ad module is a little bit overkill for my purposes. I created: Ad No1 type and correspondingly UC Product Ad No1, with feature to give availability to create 1 Ad No1 type content type node. This is working as expected and no issues for this one. For me, at least for now, I do not see any necessity for modifications of PPN, unless, you are planning things for future.

And I guess, UC order status should be posted to UC issue queue, as it is more related. I just wanted to note to other guys, that with UC this process works. Have not tested it as standalone.

maurizio.ganovelli’s picture

Hi j2b, i'll try to reproduce this issue in my local environment. Are you using ubercart 2.4 with cc payment + test gateway, right?
Concerning Ad, it's just a possible (future) idea, since ad.module generated content type doesn't work at all with 2.x version.

j2b’s picture

Thank you very much, blackice78. Although, as I allready mentioned, this UC testing is not really PPN module issue, but my lack of understanding UC. But, if you can spend a little time on my behalf, to clarify these things out, I'd really appreciate this, as I assume, that you have deeper knowledge on UC, than myself.

Yes, UC 2.4 stable + all activated modules from default UC stuff, except PPN modules, and a bunch of others, which should not influence UC statuss change functionality (althoug - may be can or are influencing).

What I did noticed, that there is some how unclear notification on orders completed and tested in the manner I've written before. The column for status in the UC order says "-" (e.g. no status at all), and near it - Completed - something like a note. I didn't make any changes or modifications to Conditional actions of UC. Just for beginning left default offered. And up to my lack of information, I can not get a grasp on order of these actions.

As far as I understood, triggers are not really connected with order, how they are tested/triggered. E.g., that list of triggers is something like alphabetical. And each of them fall into certain situation. But real show maker is to manage all triggers with their Conditions, respectively deploying specific actions, if Condition is TRUE. So far it would be OK, but I do not know, whether UC default Conditional actions could be safely deleted/disabled and if they will interfere with other contributed modules in some cases. Looking on internet, I stepped over different screenshots, where these conditional actions were listed completely different from UC default. May be because of old posts and UC 1, but I somehow understood, that it could be safe to disable all default, and build Conditional actions exactly according to my needs. Afterwards, the magic of long sitting and large amount of coffe/beer will hopefully shed a light, and I could manage to configure them. But for now, I do not have a feeling, that it is worth doing it (deleting default ones), if UC guys claim, that default should work.

Then, the other issue could be connected with usage of Test gateway, which probably do not mimic full authorization process, thus missing some cornerstones in CA Conditions - statuses, upon which other statuses get changed. It just assigns allready "completed", without changing a status and going through the workflow. I could not find an info if status is assigned to order during checkout process, or up to that time, order remains uncreated/unmarked with status. So I am misleading myself with thoughts and ideas, but no details yet.

I'd be happy to give more detailed info, if you'd still be so kind and help me out on this UC issue, but tonight I am recompiling PHP and moving site to new server. Due to this, I can not get this information at the moment, but will be available tomorrow.

For future things on PPN - probably there could be more connections to UC order pages, to let/get links/clicks from order to exact PPN nodes created, or vice versa - in PPN balance page, make it more descriptive - which order number this node was purchased/created by, and for me, what I have to solve it next week - publishing expiration of these PPN nodes, according to bought subscription from UC products, including management of these subscriptions. The last I intend to achieve by rules and uc_rules module.

maurizio.ganovelli’s picture

Hi j2b, i tested the issue using the same environment (uc 2.4), with default conditional actions: all seems to work well. During checkout the test gateway processes dummy credit card data (debug mode) and at the end of process ppn charges nodes when order status gets "Completed". I tested the checkout as admin (uid==1) and as authenticated user, with same results.
This is the order log:
Lun, 05/23/2011 - 11:19 | 2 | Credit card payment for $10.00 entered by 2.
Lun, 05/23/2011 - 11:19 | 2 | Order status changed from In checkout to Payment received.
Lun, 05/23/2011 - 11:19 | 2 | Order status changed from Payment received to Completed.
This is the content of admin comments:
05/23/2011 11:19:18 AM | 2 | Credit card charged: $10.00
05/23/2011 11:19:21 AM | 2 | Customer now can create 5 of type job_posting.
05/23/2011 11:19:21 AM | - | Order created through website.
It's hard for me to tell something else without reproducing the issue...

Concerning a tighter integration with ubercart, it's not simple. PPN node creation is based on content types and not on context/object (e.g. order): i think that module requires heavy changes to allow this, but it is certainly an interesting feature.

j2b’s picture

Thank you for your reply. Are those logs from D Watchdog? To realize the most stupid thing, I even have not went there, thinking, that these logs will be general ones. I'll have a check in my sistem.

maurizio.ganovelli’s picture

The first is the per-order log available at admin/store/orders/[order-id]/log.
The second is the content of admin comments pane availble at admin/store/orders/[order-id]/edit.
But you can find also useful informations in system logs, filtering by "ca", "paypernode" and "uc_credit" message types.

j2b’s picture

I think I start moving out of dark place. Comparing your posted logs messages from order log, my are different with the fact, that there are no status movements from In checkout to Payment received. My logs say:

Fri, 2011-05-20 09:22 | 3 | Credit card payment for 300.00€ entered by 3.
Fri, 2011-05-20 09:22 | 3 | Order status changed from Payment received to Payment received.
Fri, 2011-05-20 09:22 | 3 | Order status changed from Completed to Completed.

And here is probable cause - e.g. status changed from Payment received to Payment received, or from Completed to Completed. And that could be a reason, why after successfull checkout and complete workflow, PPN does not create nodes, cause this trigger conditions are effective, if status changed from not compelted to completed. I have to look once more what causes this action. And this is why PPN does not finish job in my case when order status is changed.

But, due to these logs, in fact it does change status from Payment received to Completed. So, does this trigger look at the exact transaction, or takes (considers) previous order status? E.g. if we look the way, that former status was payment received (despite strange log message), after status is Completed. It seems to me, that this trigger is activated taking in mind one row from log, not previous. And as it says - completed to completed, it decides, that it was not previously uncompleted. Right? Sorry for hard explanation.

j2b’s picture

Which sequentially leads to fact, that I have to rebuild UC CAs, as I could not find a registered trigger, which could cause to change status from In checkout to Payment received, and from Payment received to Completed. Here are mine Triggers registered:

Trigger: A payment gets entered for an order
Update order status on full payment payment

Trigger: Customer completes checkout
E-mail customer checkout notification
E-mail admin checkout notification
Update order status upon checkout completion with full payment

Trigger: E-mail for granted roles
Notify customer when a role is granted

Trigger: E-mail for renewed roles
Notify customer when a role is renewed

Trigger: E-mail for revoked roles
Notify customer when a role is revoked

Trigger: E-mail for role expiration reminders
Notify customer when a role is about to expire

Trigger: E-mail requested for order status update
E-mail an order update notification

Trigger: Order status gets updated
Update the user pay-per-node balance when order is completed.
Grant or renew purchased roles

I can not remember the default triggers for now, but probably this was changed due to some other modules which I installed, checked and removed afterwards. An above explains, why I see different situation in others internet posts concerning list of registered triggers.

My thoughts are that, if I manage to get correct triggers and conditions, everything should work as expected.

maurizio.ganovelli’s picture

Hmm, seems like the problem is related to your installation.

So, does this trigger look at the exact transaction, or takes (considers) previous order status?

On order status change trigger, you have two arguments available in conditions, original order and updated order. PPN predicate checks if original order status is different from "Completed" AND if updated order status is "Completed": only if this two conditions are TRUE, node charging action being called. From your order log, the first condition is always FALSE (Payment received to Payment received, Completed to Completed) so the system works as designed without charging nodes.

j2b’s picture

That really makes sense, why status change is not triggered. Today I tried to install UC Drupal profile, and again, the CA list was completely different. I went to UC demo site - again - completely different. Will try tomorrow my last way - clear D installation with default UC and look again. If you don't mind, I'll post my findings afterwards here.

Meanwhile, can you please additionally explain the following? In in one trigger action there are manu prediactes, each with its own conditions and actions, what is the order of their activation? Today I was trying to find out, why each log message does not take former status, e.g. Payment received > Completed. But rather states Payment received > Payment received and after Completed > Completed. But for now - no news. I'll definately digg into this tomorrow. But as my question - if there are different predicates in one trigger, does the order of them in a list is the way they are checked and triggered? And as far as I understood from todays experiments, each predicate in a trigger does not have info about each other, except, if manually configure conditions for them. Is this right?

maurizio.ganovelli’s picture

Component: Miscellaneous » User interface
Category: feature » support
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Hi j2b,

In in one trigger action there are manu prediactes, each with its own conditions and actions, what is the order of their activation?

Every predicate has a weight, as you can read from Weight field description "Predicates will be sorted by weight and processed sequentially".

each predicate in a trigger does not have info about each other

Every predicate works like a statement of type if {conditions} then {actions}. Conditions and actions can check and modify arguments passed by trigger. As far i know, if a trigger has 2 predicates, the second predicate can see changes made by first predicate actions.

I think that it's better for you to move this support request to ubercart issue queue: you can receive more accurate information from the module maintainers.
I'm going to close this issue, as it's not related to PPN, but feel free to post again or re-open it.

Regards.

j2b’s picture

Status: Closed (cannot reproduce) » Closed (works as designed)

Hi, blackice78,

As far i know, if a trigger has 2 predicates, the second predicate can see changes made by first predicate actions.

Thank you - these are golden words for me, as I could not find discussions on this item. And really thank you for your support. Again, excuse me, for kind of high-jacking this issue, as I've mentioned before, this is UC related, but not PPN.