Posted: December 3, 2017 at 5:55 pm
|
Hi I am trying to add an online only discount for all events. so all order through the website would receive a automatic discount but all orders through the admin panel (ie. phone order done my staff) no discount is applied. to promo users to use the website and not call us. I see codeless promotion will automatically apply a discount which is great but this is also applied when making a booking through the admin panel. So from want i can see i have 2 options either: Do you have any thoughts on how i should approach this problem, or a non custom function way to do this? Thanks |
Hi Jonathan, The approach I would take is #1, its easier to remove a function than it is to add your own…. which would be doing the same thing as the promotions add-on anyway. Luckily, this is actually fairly simple to do. So if your in the admin you don’t want promotions to apply to the cart meaning an is_admin() check is needed, however, all WP ajax requests return true for Then if those conditions are true, remove the action the Promotions add-on sets to automatically process promotions on in the cart:
Hook that remove call into something that loads later in the request than the promotion adds the call, for example ‘init’ and that should be it. All together that looks like this: Add that function to a Custom Functions Plugin on your site and test both a front end registration and one add via the admin. |
|
The support post ‘Online only discount’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.