Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Automatic Discount Error Message
- This topic has 4 replies, 2 voices, and was last updated 11 years, 12 months ago by Michael DeLuca.
-
AuthorPosts
-
November 12, 2012 at 3:12 pm #7885Michael DeLucaParticipant
Hello intrepid eStore plugin maintainers,
I have a suggestion for a modification to the shopping cart code for applying coupons.
Recently I set up a coupon for automatic discount. It works fine: whenever anybody adds a product to their cart, if the product fits the requirements (if it belongs to a particular product category), a discount is automatically applied. However, if the product doesn’t fit the requirements, the cart displays a somewhat misleading error message: “Cart does not meet the minimum requirement for this coupon!”. Can you see how this is misleading? Since it’s an automatic coupon that only applies to some of our products, most people shopping on the site won’t know what coupon the error message is referring to. It seems this has caused at least one person to give up on their order, even though the Check Out button is still clearly visible.
So I want to add a small conditional variation to the code that displays that error. In my version of the plugin, (v6.6.0), it appears on lines 777 – 780 of wp_eStore1.php. Specifically I want to change this:
else
{
$_SESSION = '<p style="color: red;">'.ESTORE_COUPON_COND_NOT_MET.'</p>';
}
to this:
else if (!get_option('eStore_use_auto_discount')) //added condition to avoid confusing customers with unneeded warning message. - MJD 11/12/12
{
$_SESSION = '<p style="color: red;">'.ESTORE_COUPON_COND_NOT_MET.'</p>';
}
I’ve already done it in my local copy, but I’d prefer not to have to hack the plugin code. Would you please consider including this modification in your next update?
Thanks very much!
November 13, 2012 at 3:21 am #51306adminKeymasterHi, Can you please tell me what the condition is for this auto discount so I get a clear picture? Also tell me the discount values you were using for that coupon that it tried to apply automatically.
November 13, 2012 at 8:01 pm #51307Michael DeLucaParticipantThe coupon we’re applying automatically to all orders is for 33% off all products belonging to a specific category. Our store sells ebooks–the category in question contains all books from a specific publisher. Does that answer your question? The coupon is applied to every order placed on our site, but it only actually affects the price of a product in your shopping cart if that product is in the specified publisher category. So if you came to the site to buy a product from some other publisher and nothing else, you automatically got the warning message because none of the products in your cart fit the condition for the 33% discount.
November 14, 2012 at 5:11 am #51308adminKeymasterYou have got a two condition thing going on here which is causing this issue. First you have a condition like “Order more than 10 items” then you are applying a coupon which has a second condition. eStore currently handles one condition per coupon application.
The change you have suggested will work fine for your case but it won’t be the correct change for eStore though. If a conditional coupon is being applied (either automatically or manually) and the cart doesn’t meet the requirement for it, the plugin needs to give that message otherwise. Otherwise other users may get confused if there is no message at all.
You could also get away with customizing the message that gets shown maybe?
November 26, 2012 at 4:43 pm #51309Michael DeLucaParticipantOK…I think I get it. You’re right, I have two conditions: first, that the cart must have something in it worth more than $0.98, and second that something in the cart belongs to a certain category. When I turn off the $0.98 cents condition, the misleading error message goes away. However, so does the discount. In other words, the automatic discount feature only works if you provide a second condition. The help text for the field says so: “Customers who order more than this amount will automatically get the specified coupon applied to their cart. Leave empty if you do not want to use it.”
What would be an example of a situation involving an automatic discount where that error message is actually needed? Maybe if a customer came to the store with a different, non-automatic coupon and tried to apply it in addition to the automatic coupon that was already being applied, but tried to apply it to products it doesn’t work on. They’d need that message to help them understand why their second coupon wasn’t working. But in that case, there would be a strong chance they’d already be seeing that message for the automatic discount.
In my opinion it’s better not to show any message than to show an ambiguous message. So I guess I’ll keep using my hack.
Thanks.
-
AuthorPosts
- You must be logged in to reply to this topic.