Hey there guys,

I am kinda hitting a wall here.

I am using the Paypal node module along with Advertisement module.

For some reason when I charge for an 'ad' content type, the user doesn't get prompted to buy it, and it goes right ahead and publishes it.
Though when I charge for a story content type or page, it works fine.

I am thinking its the advertisement modules problem when working with paypal node.
One thing I did find that for some reason, paypalnode was losing the price when submit the advertisement, compared to advertisement.
Which I think is the problem. Though I am not really sure why this is happening.

Any thoughts on this are greatly appreicated!
I have to have this for a client very soon, ugh!

Thanks so much guys,
Justin

Comments

TheDarkFlop’s picture

this line:
ad_owners_add($node->nid, $node->uid);

under the nodeapi function is causing the problem and where
advertisement is overiding paypal redirect.

Though I am not really sure how to move forward. How do I redirect but still keep in the info
on the back burrner so it can be submited after payment?

giggler’s picture

I don't know how to exactly do it since I can't code. The simple way might be to target _blank /paypalnode/$nodeID but also will have conditions like if publishing cost value is more than 0 as well as it being the first time being submitted, so that edits will not prompt the paypalnode.

UPDATE: anyway, I tried this and it seem to redirect to paypal and does add the ad. I don't know what happens after payment or anything, but at least the redirect and insert works. Maybe this can be a alter form hook thing so that it doesn't need to change the module code, but I don't know how to do that:

Added this:
$_REQUEST['destination'] = 'paypalnode/'.$node->nid;

So function ad_owners_add will look like this:

  $rc = db_affected_rows() ? 1 : 0;
$_REQUEST['destination'] = 'paypalnode/'.$node->nid;
    $permissions = array();