I am using "PayPal IPN - Website Payments Standard".
I am using "PayPal IPN - Website Payments Standard".
Version of Zen Cart? Have you verified that your copy of ipn_main_handler.php is current and has not been modified?
That Software Guy. My Store: Zen Cart Modifications
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
I am running
Zen Cart 1.3.8a
Database Patch Level: 1.3.8
PHP Version 5.2.6
My copy of ipn_main_handler.php is dated 11/27/07 (long before my fresh install of this September) -- I haven't touched or altered it in any way.
Somehow the order object that's created in ipn_main_handler.php does not contain the correct customer email address, or this address is not getting passed to the order total process function. Don't know why.
You could try printing session variables and the order object after it's instantiated using ipn_debug_email to see what you have if you want to track this down.
That Software Guy. My Store: Zen Cart Modifications
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
If you think we might be able to get this to work, then I am happy to work with you to track this down.
I'm afraid that I've never done that before. Is it as simple as me turning the debug mode to "Log and Email" in the PayPal module? After doing that, would I just try checking out with one of these 100% discount products and then post the results of the debug file here? (Are there any security concerns -- meaning is there anything from the debug logs I SHOULDN'T post here?)You could try printing session variables and the order object after it's instantiated using ipn_debug_email to see what you have if you want to track this down.
OK, I went ahead and turned on the Log and Email debug mode. Here is what happened:
When I used a non-subscriber email account and checked out with an item that would get 100% discount for a subscriber, it skipped PayPal, just like before, even though it did not indicate any discount. More importantly, I didn't get a debug email. It was like PayPal was bypassed altogether when I set my discount to 100%.
Just to check it, though, I then changed the discount amount to 50% while still logged in with this non-subscriber email. I then checked out with the same product. Just like the last time I did this, this time I was taken to PayPal AND a debug email was immediately sent to me.
So the debug feature seems to be working, but it's as if PayPal is bypassed altogether when the Discount Amount is set to 100, so I'm not even getting debug reports in this case.
In the file includes/modules/order_total/ot_newsletter_discount.php find
function calculate_deductions() {
global $db, $order, $currencies;
right underneath this, add
if (!$this->is_subscriber()) {
return;
}
and retest with 100%.
That Software Guy. My Store: Zen Cart Modifications
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
That seems to have done it. I tested with both a subscriber email and a non-subscriber email, with both category 4 products and non-category 4 products and the behavior is exactly as it should be.
I'll keep testing over the next few days to be sure, but everything seems to work now.
Thank you for your help!
Well... it's not like I spoke too soon.... the most important thing is working, but I just looked over the order confirmation that is sent to the customer who just had a successful checkout with a free (100% discount) product and under payment method it is says:
It seems like it is using Money Order for 100% discounts (and probably would be using Credit Card if I had not uninstalled that module.) It's not the end of the world I suppose but it would probably be a little confusing for the customer.Code:Payment Method Check/Money Order Please make your check or money order payable to: the Store Owner/Website Name Mail your payment to: The Yaoi 911™ Store 2370 Market Street Suite 339 San Francisco, CA 94114 U.S.A. (206) 202-3243 Your order will not ship until we receive payment.
This seems like a much harder fix, but is there a way for Newsletter Discount to use The Zen Cart FREE CHARGE CARD for 100% discount transactions? I think if it did that it would create the order confirmations you would expect in such cases...
The question of which payment method to use is made by Zen Cart, not the Newsletter Discount.
That Software Guy. My Store: Zen Cart Modifications
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Bookmarks