I have been looking around for an EASY way to create a content type (lets say a report request for house values); this would require a person to fill out the content first, then hit submit. Upon submitting the content type has been added to the cart and the user can select to check out and pay or continue shopping.
The idea is that they can fill out the information at ease and then pay, instead of paying first and then fill out and also, it should be possible to do this without having to register or buying role credits, etc.
What would be nice is that when you create a content type, you can select if this is going to be a product and if it should take input first and then add to cart or charge first and then take the input.
This feature would work so well for a publishing system like selling ads, etc.
If this already exist, just let me know how to do it, if not let me find out if someone could write something like that. Additionally, I would love to find out how to remove the Product field from a content type once its created.
I'll put a bounty out there for $100 for anyone that would create a module like that (same bounty exist on ubercart).
/Chris

Comments
I don't think that this
I don't think that this would be too hard in Drupal 5, Basically we could just hijack the posted node form and then store this as data in the cart. Once the content has been paid for it will run the posted form though drupal_execute() and create the node.
--
Gordon Heydon
Great
And would that allow it to be done for any content type a person would create, lets say someone is doing a content type for a advertisement where the person will fill out the data first and then pay for it and only upon receiving confirmation of payment will it actually post?
How long would it take to develop? I am interested in helping but have limited skills.
Regards,
Chris W
Regards,
Chris W
For the most part yes. But
For the most part yes. But things like files that are being attached it would not work.
So in your example if it is just adding a snippet of html to create the ad, then this would be quite easy. But having to upload an image would not work without specific support for the module in question.
--
Gordon Heydon
Linking nodes to potential purchases
I've been working on creating a job listing system using e-commerce/Ubercart and have run into this same problem. It seems like the key is to create some place where a node can be temporarily stored before actually becoming a node. In other words, you would need to create a module with a table that contained a temporary node (in serialized form), the associated transaction and the transaction status (completed/incomplete), and the node id when the node is created.
This is the type of workflow that I think makes sense for what you are trying to accomplish:
1. User fills out a node using a customized node/add form. You would need to hack the permissions to allow someone to fill out the add/node form who doesn't have the appropriate permissions. Paypernode does this.
2. When the user saves their record, the node should save temporarily as a serialized array in a module table.
3. A user pays for a piece of content, upon payment, the node is created and its nid is saved to the module table. One of the existing weaknesses of pay-per-node is that it is difficult to associate transactions with created nodes.
I've been plugging away at this for awhile, so let me know if you have any questions. I am working on an Ubercart implementation of this concept. The one difference is that someone will create the node on the same form that they use to pay.
Could it be unpublished by default, then pay to publish?
Is it possible you could let the user create the node but not publish it (status != 1) , then when they pay it is automatically set as published?
I'd like to do this for a real estate site I'm currently working on. The advertiser needs to be able to add a listing and preview it themselves to make sure it's right, then pay afterward. Paying should automatically set the node to 'published'.
I'm looking at http://drupal.org/project/paypernode but it seems to require payment before creating the node - has anyone used it for an application like this?
Could it be unpublished by default, then pay to publish?
You are trying to do the same thing the rest of us are trying to do as well, however, in its current state it doesn't work on either ec or ubercart but Julia is working on a module for ubercart that she anticipate to be done in March and then it should be possible.
I have been able to do somewhat of a work around with both ec and ubercart (now only using ubercart) and workflow-ng; however, I have big hope for Julia's module to be the solution that we are all looking for.
Regards,
Chris W
Regards,
Chris W
I just thought idea of
I just thought idea of saving the node temporarily as a serialised array seemed a bit strange - why not just save it straight as a normal node, but unpublished? Or am I misunderstanding something important in the process?
Did anyone get anywhere with this?
I'm struggling with this same thing now...
I am trying to create a posting-board where you pay to post, but you can see your posting before you pay.
My goal was:
1) User creates the node (which, incidentally contains uploaded images and files)
2) Node is created as unpublished by default (I have achieved this by denying "administer nodes" and setting unpublished as the default state for all created nodes)
3) User pays for this node
4) Node is automatically published upon completion of transaction
I cannot figure out how to accomplish #3.
I was thinking I'd just need to make some generic product they buy "A Listing" and then pass the nid of the new node in the query string, hook_form_alter() the nid into a product attribute, hide that product attribute and I'd then have the nid that was purchased at my finger tips.
I haven't gotten that far and it seems difficult. :-)
Has anyone gotten any further with these solutions? I imagine #4 is easy with ECv3.x... just wait for transaction completion and then publish the node (again, based on the nid which would be a custom attribute of the product). My trouble is figuring out the product and how to get the nid into the transaction in the first place.
Has anyone gotten this far or done something better/easier?
I ended up writing a kind of
I ended up writing a kind of token system, where the user pays and it automatically publishes the most recent, unpublished node of theirs. Then they have a form page that lists all their nodes and whether they're published or not - and have the ability to tick them on and off to choose to publish a different one if the auto-chosen node was incorrect. They can only publish up to the number of tokens (purchased nodes) they have.
This system isn't ideal because it means a user could publish one node and then change to publish a different node a week later, without paying any extra - but depending on the way your site works you could sell that as an advantage...
Otherwise check out the pay2publish module, I believe it does what you're asking for using taxonomy settings, but it's not fully ported to 5.x
maybe this is heresy..
I ended up using ubercart.
Here's my solution:
1. Auth'd users can produce but not publish a node. I did this by setting "Publish" as un-checked by default and not granting "administer content" to their user role. (Drupal Core)
2. Created a product in Ubercart with 2 attributes:
a. Duration (for how long is this node published, 12 months, 24 months or 36 months) and had that attribute adjust the cost accordingly.
b. "NID" which has no options. This makes Ubercart treat it as a text-field the user can modify.
3 Unpublished nodes need a block on them "Pay to publish this node" . That block has 3 text-links on it, using Ubercart's "Cartlinks" module to directly add the product to their cart with attributes pre-selected. This block is visible by listing owners only
4 Built a new workflow-ng action - When payment is processed, check balance. if "$0" balance, grab attributes from the order (duration and nid) and modify field_expiry in our CCK node. Use now or field_expiry (whichever is greater).
5 hook_cron() to unpublish on expire
Heresey! :)
I'm overcommited to ecommerce right now because of its integration withthe Events/Signup combo that I need. I did, however run into the Pay Per Node module here: http://drupal.org/project/paypernode that looks like it might be what I need to use in combination with an expiration module. I haven't toyed with it yet, but will report back!
Did anyone figure out how to
Did anyone figure out how to do this? with ubercart or otherwise?
subscribing
subscribing
The heights by great men reached and kept, were not attained by sudden flight. But they, while their companions slept, were toiling upward in the night.
Ubercart + (uc_node_checkout / (workflow_ng + cart links) )
I'm currently building a site in D5 with Ubercart (my first Ubercart site - I've tried E-commerce before but found it difficult).
The additional UC_node_checkout module allows you to specify that when a node of a particular type is created, a particular product will be added to the user's cart, and the user taken straight to checkout. This seems to work fine, but I also wanted to be able to specify options for the product, so instead I am now using the Workflow_ng module (which you have to have for Ubercart anyway) and Cart Links (part of Ubercart).
Workflow_ng allows you to create an event/action pair, so for example, my event is someone creating content of type A, and my action is a page redirect to a URL defined with the Cart Links module.
Cart Links allow you to define a URL with parameters which do things to the cart. For example, I have defined a URL which empties the user's cart (this is optional), puts in one product X with option Y, and proceeds to the checkout.
So to summarise: a user creates a node of type A, Workflow_ng detects the node creation and redirects the user to a URL defined by Cart Links, and the parameters in the URL cause the cart to be emptied, a product to be added to the cart with certain options and the user taken to the checkout.
The site isn't live yet but everything seems to be working so far.
How did this go
It's been a while since your post but I was wondering if you had any success with this approach?
Subscribing
Subscribing