Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › Negative Variation price fails to send email or show order
Tagged: Negative Variation, variation control
- This topic has 7 replies, 2 voices, and was last updated 8 years, 4 months ago by admin.
-
AuthorPosts
-
June 23, 2016 at 1:43 am #13541hrdwareMember
I have courses that I sell on my site. The default price is the total cost for the course. I have a variant that will allow someone to make a 50% deposit. When a customer selects the deposit option and a quantity of 1, I get email notifications that a sale has been made, but the order does not show up in the orders list and the customer does not get an email. If they select a quantity of 2, then all the emails are sent correctly, however the order still is not displayed in the orders list.
Orders for the full course are processed correctly.
June 23, 2016 at 4:05 am #73506adminKeymasterWe don’t support negative variance unfortunately. So the post payment price verification will fail if you use negative variance. Thats why you don’t see the order being recorded by eStore.
You can use the following code tweak on your site to override the strict price check of the plugin. Then it will go through without failing when you use negative variance.
Add the following code block to your theme’s functions.php file (or a custom plugin) and you should be good after that:
add_filter('eStore_before_checking_price_filter', 'my_custom_override');
function my_custom_override() {
return "custom-check-override";
}June 28, 2016 at 2:59 pm #73507hrdwareMemberI added the above code to the functions.php and transactions are still failing. I moved the add_filter line to below the function and transactions still fail. Any other suggestions?
Thx
June 29, 2016 at 3:05 am #73508adminKeymasterThere is a little mistake in my previous code. Please use the following one.
Lets also add a little debug log statement to that function so we can see if is getting executed correctly.
add_filter('eStore_before_checking_price_filter', 'my_custom_override');
function my_custom_override($msg) {
eStore_payment_debug('my_custom_override() - overriding the check.', true);
return "currency-check-override";
}Let me know how it goes after that.
July 1, 2016 at 1:30 pm #73509hrdwareMemberStill not working. I still get an email that says Wrong Product Price Detected! Actual Product Price: 1 Amount Paid: 0.50
July 2, 2016 at 2:09 am #73510adminKeymasterDid you fully copy and paste the new code that I gave in my recent post? To be more specific, does the return of the function uses the “currency-check-override” string (this bit is important)?
Share the URL of the site where you have the add to cart button so I can inspect the log file. It will help me see if that code is actually getting executed. If the “add_filter” call is not done early enough in the execution or if it is not visible then it won’t get executed.
What happens if you copy and paste that code in a plugin file? Put it in the “wp_eStore1.php” file of the eStore plugin.
July 2, 2016 at 2:46 pm #73511hrdwareMemberI copied the code exactly as you had it. Moving the code from the functions.php file in my theme directory into the plug in wp-eStore1.php file seems to make it work correctly. It would be great to get it to work from my functions.php file so I don’t have to remember to put it back in the wp_eStore1.php file whenever there are upgrades to the wp eStore plugin.
I don’t know if it makes a difference or not, but I am running a child theme, and all of the LOG files in the wp-cart-for-digital-products plugin directory are empty.
July 3, 2016 at 3:53 am #73512adminKeymasterThat confirms that the code wasn’t getting executed when the IPN is received (IPN is a background post so that works a little differently than a standard page loading.
You should be able to copy that code and put it in a small custom plugin. A plugin with just your tweaks and hacks. That is a better way to handle this than to use functions.php file. Because the custom plugin will stay there even if you change your theme.
Making a custom little plugin is very easy. The following tutorial will teach you the basics that you need to know:
https://www.tipsandtricks-hq.com/how-to-create-a-wordpress-plugin-video-tutorial-4547
Let me know if that helps.
-
AuthorPosts
- You must be logged in to reply to this topic.